From: Chong Yidong Date: Sun, 30 Sep 2012 08:41:37 +0000 (+0800) Subject: Minor code tweak for delete-trailing-whitespace. X-Git-Tag: emacs-24.2.90~244^2~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a97dc380601446c00adfbd1d8e86e73e7d81a359;p=emacs.git Minor code tweak for delete-trailing-whitespace. * lisp/simple.el (delete-trailing-whitespace): Avoid an unnecessary restriction change. --- 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))))