2

whitespace-mode will show the whitespace all the time in entire buffer, Is there the way to show whitespaces only when the region is selected. which is pretty cool to have, does there mode exist for such feat or an configuration.

There is exists the similar functionality in sublime editor, as show in screenshot.

enter image description here

  • 1
    To clarify, in addition to "show whitespace only when the region is selected" did you also mean you only want whitespace to show in the selected region? – Aquaactress Dec 11 '19 at 3:33
  • yes, within the selected region only, similar to what sublime text does. – rho Dec 11 '19 at 5:01
  • 1
    Show a screenshot of "what sublime text does" (few readers will have used it), and point out any particularly aspects which are most important (as I'm doubtful that whitespace-mode can be adapted easily, but maybe something else can be done which would suffice). – phils Dec 11 '19 at 20:45
  • 2
    This is theoretically possible by recreating the features of whitespace mode using overlays or other tools, but as is, you can't configure whitespace mode to do this, whitespace mode uses display tables. It is not possible to have a display table apply to part of a buffer, it must be applied to the whole thing. Is there a specific feature of whitespace mode that is most important? Such as just displaying space or tab characters as a different character? – Jordon Biondo Dec 12 '19 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.