]> saetta.ns0.it Git - msys2/commitdiff
emacs_cross: tolto il trailing degli spazi in diff-mode.
authorAndrea Zagli <andrea.zagli@email.it>
Tue, 4 Apr 2017 09:40:28 +0000 (11:40 +0200)
committerAndrea Zagli <andrea.zagli@email.it>
Tue, 4 Apr 2017 09:40:28 +0000 (11:40 +0200)
tools/emacs_cross

index a439624c83926674c72f1918b650954281754ec8..1e38881c3b6f88ad4ee335f94350f7b0a926ad25 100644 (file)
 (setq auto-save-default nil)
 
 ;; delete trailing whitespaces on saving
-(add-hook 'before-save-hook 'delete-trailing-whitespace)
+(defun my-delete-trailing-whitespace ()
+  (when (not (eq major-mode 'diff-mode))
+    (delete-trailing-whitespace)))
+(add-hook 'before-save-hook #'my-delete-trailing-whitespace)
 
 ;; ibuffer
 (global-set-key (kbd "C-x C-b") 'ibuffer)