Browse Source

add save hook correctly

master
Taylor Bockman 7 years ago
parent
commit
1757941635
  1. 5
      dotfiles/emacs.d/init.el

5
dotfiles/emacs.d/init.el

@ -159,9 +159,10 @@ setq org-log-done t)
(let ((trailnewlines (abs (skip-chars-backward "\n\t")))) (let ((trailnewlines (abs (skip-chars-backward "\n\t"))))
(if (> trailnewlines 0) (if (> trailnewlines 0)
(progn (progn
(delete-char trailnewlines)))))) (delete-char trailnewlines)))))))
(add-hook 'before-save-hook 'delete-trailing-whitespace)) (add-hook 'before-save-hook 'delete-trailing-whitespace)
(add-hook 'before-save-hook 'delete-trailing-blank-lines)
;; Comment this if you dont mind git diffs complaining about missing ending newlines. ;; Comment this if you dont mind git diffs complaining about missing ending newlines.
(setq require-final-newline t) (setq require-final-newline t)

Loading…
Cancel
Save