emacs-oob-reboot
emacs-oob-reboot copied to clipboard
Remove trailing whitespace (right trim lines) in all lines
Dear Dan,
This seems better to me:
;; Nuke all trailing whitespaces in the buffer.
(add-hook 'before-save-hook
#'(lambda () ; Except for ...
(let ((buffer-undo-list buffer-undo-list)) ; For goto-chg.
(unless (or (derived-mode-p 'message-mode)
; ... where "-- " is the signature
; separator (for when using emacsclient
; to compose emails and doing C-x #).
(derived-mode-p 'diff-mode))
; ... where the patch file can't be
; changed!
(delete-trailing-whitespace)))))