aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter J. Weisberg2011-09-23 10:56:00 -0400
committerStefan Monnier2011-09-23 10:56:00 -0400
commitd68e189a96918b113f565d5ce46257c7e9bc963c (patch)
tree1710cc9fe9f642eae0a43e2eb1e677d8559b59d2
parenteca3f3ea3aa263603369eaee2c549b7ba0454902 (diff)
downloademacs-d68e189a96918b113f565d5ce46257c7e9bc963c.tar.gz
emacs-d68e189a96918b113f565d5ce46257c7e9bc963c.zip
* lisp/simple.el (delete-trailing-whitespace): Also delete
extra newlines at the end of the buffer.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/simple.el6
2 files changed, 9 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8c52d626c02..f17ba200815 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12011-09-23 Peter J. Weisberg <pj@irregularexpressions.net> 12011-09-23 Peter J. Weisberg <pj@irregularexpressions.net>
2 2
3 * simple.el (delete-trailing-whitespace): Also delete
4 extra newlines at the end of the buffer.
5
3 * textmodes/picture.el: Make motion commands obey shift-select-mode. 6 * textmodes/picture.el: Make motion commands obey shift-select-mode.
4 (picture-newline): Use forward-line so as to ignore fields. 7 (picture-newline): Use forward-line so as to ignore fields.
5 8
diff --git a/lisp/simple.el b/lisp/simple.el
index 35193135396..c828584c17f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -586,6 +586,12 @@ If the region is active, only delete whitespace within the region."
586 (if (looking-at ".*\f") 586 (if (looking-at ".*\f")
587 (goto-char (match-end 0)))) 587 (goto-char (match-end 0))))
588 (delete-region (point) (match-end 0))) 588 (delete-region (point) (match-end 0)))
589 (save-restriction
590 (goto-char end-marker)
591 (widen)
592 (if (and (eobp)
593 (looking-back "\n\n+" nil t))
594 (replace-match "\n")))
589 (set-marker end-marker nil)))) 595 (set-marker end-marker nil))))
590 ;; Return nil for the benefit of `write-file-functions'. 596 ;; Return nil for the benefit of `write-file-functions'.
591 nil) 597 nil)