From a97dc380601446c00adfbd1d8e86e73e7d81a359 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 30 Sep 2012 16:41:37 +0800 Subject: [PATCH] Minor code tweak for delete-trailing-whitespace. * lisp/simple.el (delete-trailing-whitespace): Avoid an unnecessary restriction change. --- lisp/ChangeLog | 3 +++ lisp/simple.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f9a81c2b7cb..65ff71c74f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-09-30 Chong Yidong + * simple.el (delete-trailing-whitespace): Avoid an unnecessary + restriction change. + * bindings.el (goto-map): Bind M-g TAB to move-to-column. * help-fns.el (help-fns--obsolete): Fix last change. diff --git a/lisp/simple.el b/lisp/simple.el index 417dedb43db..616a4d7b1ea 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -606,7 +606,7 @@ buffer if the variable `delete-trailing-lines' is non-nil." (when (and (not end) delete-trailing-lines ;; Really the end of buffer. - (save-restriction (widen) (eobp)) + (= (point-max) (1+ (buffer-size))) (<= (skip-chars-backward "\n") -2)) (delete-region (1+ (point)) end-marker)) (set-marker end-marker nil)))) -- 2.39.2