emacs-oob-reboot icon indicating copy to clipboard operation
emacs-oob-reboot copied to clipboard

Remove trailing whitespace (right trim lines) in all lines

Open fniessen opened this issue 5 years ago • 0 comments

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)))))

fniessen avatar Feb 25 '20 13:02 fniessen