summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-03-30 01:42:59 -0400
committerKyle Meyer <kyle@kyleam.com>2015-03-30 01:43:22 -0400
commita4d627b752ba66838781283bc35cefcdb2ad5f71 (patch)
treef2ea2bef15ce1fc9ff97d4080def3b15514c04da
parent5c9589128f543649a37e61e96bc6e4e1831a821c (diff)
downloademacs.d-a4d627b752ba66838781283bc35cefcdb2ad5f71.tar.gz
Add delete-trailing-whitespace to cleanup function
With 5f4f111cd, I replaced by old buffer cleanup functions with whitespace-mode. This resulted in similar behavior, but empty lines at the end of the buffer were no longer deleted. The 'empty' option for whitespace-style will do this, but it also deletes empty lines at the beginning of the buffer, which I don't want. Add delete-trailing-whitespace to km/cleanup-buffer so that trailing whitespace is removed.
-rw-r--r--lisp/init-editing.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/init-editing.el b/lisp/init-editing.el
index c13df37..ca7573b 100644
--- a/lisp/init-editing.el
+++ b/lisp/init-editing.el
@@ -211,7 +211,8 @@ touches."
(defun km/cleanup-buffer ()
(interactive)
(unless km/prevent-cleanup
- (whitespace-cleanup)))
+ (whitespace-cleanup)
+ (delete-trailing-whitespace)))
(define-key km/editing-map "t" 'km/toggle-prevent-cleanup)