From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#5399: 23.1.50; fill-region Date: Sun, 18 Sep 2011 13:44:17 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1316347638 12652 80.91.229.12 (18 Sep 2011 12:07:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 18 Sep 2011 12:07:18 +0000 (UTC) Cc: 5399@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 18 14:07:13 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R5G9Q-00042H-Hw for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Sep 2011 14:07:12 +0200 Original-Received: from localhost ([::1]:45578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5G9P-0001z8-So for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Sep 2011 08:07:11 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5G9M-0001yl-GY for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 08:07:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5G9L-0007Kg-GJ for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 08:07:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5G9L-0007Kc-Dj for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 08:07:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R5GE6-0006iC-8Q for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2011 08:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Magne Ingebrigtsen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Sep 2011 12:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5399 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: 5399@debbugs.gnu.org, emacs-pretest-bug@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.131634792125791 (code B ref -1); Sun, 18 Sep 2011 12:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Sep 2011 12:12:01 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5GE3-0006hm-OM for submit@debbugs.gnu.org; Sun, 18 Sep 2011 08:12:00 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R5GE0-0006ha-P6 for submit@debbugs.gnu.org; Sun, 18 Sep 2011 08:11:57 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56196) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1R5G9F-0003XZ-Hl for emacs-pretest-bug@gnu.org; Sun, 18 Sep 2011 08:07:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5G9E-0007JW-0K for emacs-pretest-bug@gnu.org; Sun, 18 Sep 2011 08:07:01 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:50239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5G9D-0007J7-Lb; Sun, 18 Sep 2011 08:06:59 -0400 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1R5G95-0002QB-TD; Sun, 18 Sep 2011 14:06:51 +0200 In-Reply-To: (Richard Stallman's message of "Sat, 16 Jan 2010 16:09:31 -0500") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) X-Now-Playing: Jane Siberry's _Jane Siberry_: "Above The Treeline" X-MailScanner-ID: 1R5G95-0002QB-TD MailScanner-NULL-Check: 1316952411.99705@K+9WEmZTqDm9G0P/4ZtGHQ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 18 Sep 2011 08:12:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:51399 Archived-At: Richard Stallman writes: > I insert the following text > > This is > a test > > of fill region > and how it affects the mark. > > (but not indented), then put the mark at the end and point at the beginning, > and type M-x fill-region. > > It finishes with point and the mark both at the end. > > It ought to leave point at the beginning if it was there before, > at the end if it was there before. And likewise with the mark. The mark doesn't really change currently, I think? The following patch should fix the problem, but it is a change in behaviour. Would it be OK to install this during the feature freeze? === modified file 'lisp/textmodes/fill.el' --- lisp/textmodes/fill.el 2011-07-16 20:05:54 +0000 +++ lisp/textmodes/fill.el 2011-09-18 11:42:16 +0000 @@ -1010,7 +1010,8 @@ (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") @@ -1041,6 +1042,8 @@ (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)) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/