aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2012-04-10 04:06:19 +0200
committerLars Magne Ingebrigtsen2012-04-10 04:06:19 +0200
commit24d78a88add65761b0d0f63777e76fca6f2d66f8 (patch)
treeb915263fecdc42fe3c5a293ced324dc5d06792cf
parent9ea49b28ab86d5207553d0827e1209276d03cd72 (diff)
downloademacs-24d78a88add65761b0d0f63777e76fca6f2d66f8.tar.gz
emacs-24d78a88add65761b0d0f63777e76fca6f2d66f8.zip
(fill-region): Leave point and mark where they were before filling
Fixes: debbugs:5399
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/textmodes/fill.el5
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a3f992eb9dc..4e3d7b3f492 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * textmodes/fill.el (fill-region): Leave point and mark where they
4 were before filling (bug#5399).
5
12012-04-09 Glenn Morris <rgm@gnu.org> 62012-04-09 Glenn Morris <rgm@gnu.org>
2 7
3 * version.el (emacs-bzr-get-version): 8 * version.el (emacs-bzr-get-version):
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 08254c6f5f7..d0e90c99516 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -1011,7 +1011,8 @@ space does not end a sentence, so don't break a line there."
1011 (if current-prefix-arg 'full)))) 1011 (if current-prefix-arg 'full))))
1012 (unless (memq justify '(t nil none full center left right)) 1012 (unless (memq justify '(t nil none full center left right))
1013 (setq justify 'full)) 1013 (setq justify 'full))
1014 (let (max beg fill-pfx) 1014 (let ((start-point (point-marker))
1015 max beg fill-pfx)
1015 (goto-char (max from to)) 1016 (goto-char (max from to))
1016 (when to-eop 1017 (when to-eop
1017 (skip-chars-backward "\n") 1018 (skip-chars-backward "\n")
@@ -1042,6 +1043,8 @@ space does not end a sentence, so don't break a line there."
1042 (setq fill-pfx 1043 (setq fill-pfx
1043 (fill-region-as-paragraph (point) end justify nosqueeze)) 1044 (fill-region-as-paragraph (point) end justify nosqueeze))
1044 (goto-char end)))) 1045 (goto-char end))))
1046 (goto-char start-point)
1047 (set-marker start-point nil)
1045 fill-pfx)) 1048 fill-pfx))
1046 1049
1047 1050