1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

(fill-region): Leave point and mark where they were before filling

Fixes: debbugs:5399
This commit is contained in:
Lars Magne Ingebrigtsen 2012-04-10 04:06:19 +02:00
parent 9ea49b28ab
commit 24d78a88ad
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-04-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
* textmodes/fill.el (fill-region): Leave point and mark where they
were before filling (bug#5399).
2012-04-09 Glenn Morris <rgm@gnu.org>
* version.el (emacs-bzr-get-version):

View File

@ -1011,7 +1011,8 @@ space does not end a sentence, so don't break a line there."
(if current-prefix-arg 'full))))
(unless (memq justify '(t nil none full center left right))
(setq justify 'full))
(let (max beg fill-pfx)
(let ((start-point (point-marker))
max beg fill-pfx)
(goto-char (max from to))
(when to-eop
(skip-chars-backward "\n")
@ -1042,6 +1043,8 @@ space does not end a sentence, so don't break a line there."
(setq fill-pfx
(fill-region-as-paragraph (point) end justify nosqueeze))
(goto-char end))))
(goto-char start-point)
(set-marker start-point nil)
fill-pfx))