Wednesday, August 12, 2020

[hhndpovv] Some emacs customizations to avoid surprise

M-x customize-option

'(electric-indent-mode nil) ; This prevents spaces at the end of lines from being silently automatically deleted.  This is especially essential for editing Markdown, for which two spaces at the end of line encodes <br>.  I don't know of a way to keep trailing whitespace that does not require disabling all of electric-indent-mode.

'(show-trailing-whitespace t) ; This is just to check that the above change worked.

'(mode-require-final-newline (quote ask)) ; This prevents a newline from being silently automatically added when you save a file whose last line does not end with a newline.

'(search-whitespace-regexp nil) ; This allows using isearch to search for two spaces in a row.  Another way to do this is to setq isearch-lax-whitespace to nil, but that is not a customizable variable.

No comments :