Add an opt-out mechanism for deleting trailing whitespace on save

This commit is contained in:
Jeremy Dormitzer 2020-05-09 16:20:17 -04:00
parent 9a71355a13
commit 7f45bc0a6c

View File

@ -166,7 +166,11 @@ Better keybinding.
Delete trailing whitespace on save:
#+BEGIN_SRC emacs-lisp
(add-hook 'before-save-hook #'delete-trailing-whitespace)
(defvar *should-delete-trailing-whitespace* t)
(defun delete-trailing-whitespace-hook-fn ()
(when *should-delete-trailing-whitespace*
(delete-trailing-whitespace)))
(add-hook 'before-save-hook #'delete-trailing-whitespace-hook-fn)
#+END_SRC
* Autocompletion