From a4d627b752ba66838781283bc35cefcdb2ad5f71 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 30 Mar 2015 01:42:59 -0400 Subject: 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. --- lisp/init-editing.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/init-editing.el') 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) -- cgit v1.2.3