From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#23999: 25.0.95; Emacs hangs in rectangle-mark-mode with numeric prefix argument to `C-f' Date: Fri, 22 Jul 2016 09:01:12 +0200 Message-ID: <878twucg1z.fsf@gmx.net> References: <87twfq1qtr.fsf@moondust.awandering> <87y4517udy.fsf@gmx.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469170950 7933 80.91.229.3 (22 Jul 2016 07:02:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Jul 2016 07:02:30 +0000 (UTC) Cc: jwiegley@gmail.com, monnier@iro.umontreal.ca To: 23999@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 22 09:02:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQUTP-0001NZ-Kg for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jul 2016 09:02:15 +0200 Original-Received: from localhost ([::1]:45465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQUTO-0007l6-Pi for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jul 2016 03:02:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQUTH-0007l0-Uw for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 03:02:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQUTD-0003SI-0y for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 03:02:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQUTC-0003S6-U6 for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 03:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bQUTC-0007qD-HR for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 03:02:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87twfq1qtr.fsf@moondust.awandering> Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Jul 2016 07:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23999 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23999-submit@debbugs.gnu.org id=B23999.146917088830037 (code B ref 23999); Fri, 22 Jul 2016 07:02:02 +0000 Original-Received: (at 23999) by debbugs.gnu.org; 22 Jul 2016 07:01:28 +0000 Original-Received: from localhost ([127.0.0.1]:60746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQUSd-0007oO-Dx for submit@debbugs.gnu.org; Fri, 22 Jul 2016 03:01:27 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:49325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQUSb-0007mY-M7 for 23999@debbugs.gnu.org; Fri, 22 Jul 2016 03:01:26 -0400 Original-Received: from rosalinde ([89.245.112.242]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MDE6y-1bYFHD0sMG-00GaAy; Fri, 22 Jul 2016 09:01:15 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-Provags-ID: V03:K0:9VEdCBKSu0zp/zRvYfz9p8I/+R3qNriW36jezmzfGvOwSp7pL5q 1LpY6DozcjL9pgBcRMejCXZ7YwNymNSY3eWkwdvtdBGikznJnpybSyT+GX2xQqQUnIZnxIV R31wD9QasSisATvjR8Vokv83jdTCqQZly0MHE98MnH2oITBXUHsVFIKYlAxhnktJIBmCjCa rcquB9cwuHWlp9rGKhRHg== X-UI-Out-Filterresults: notjunk:1;V01:K0:VeZ/9eTKva4=:+CxVcP7AeNaotMNyY53nZf 9dCAcfDq+KDoq+mML0q6X51TtMFiMQzXrlo7s3NAy0UChRej07dUK91eHSbK/IAE1WGl0uiEm j78ZLXTgn3fsKNioSnzfdveff2n6Hi5hFKgYy0aBQCv9aa0Q+Ovg82kMzzVVivxx4l90tCABb P5e36HvUFTsHKBVlhHOu0XGcKcBnTbJ9snDQDAL6ZWx5LVKJ85WTXrG3hWs9iXPgdmNj/fvOV w4JaX32FvbPcVUooqPiGvsZUbaSOzEMvbLExDW2jURcWJhFkMSdcAzlET8Y0k4fu3Xqz9l3PW C2kjrH/slQVhmaraNwUZPcvdeO4UQtmOzdGGkE8cKl6o/TWiHexT3SstCLCozeZ1lFN59VNxa NKA4+sOuD9LYss4f3LieYDUmIsExuNcfqm/J7CdhtOrnoO60oEfatCay5+hA3yhAR4ELPjZGd zzZLFbb+Z8PKeO+zzUvgQhLtlW/Z0/Xi6kwY696ZonT2YY5xO8Dmsh10CmZXPynRbBtBHdILu ovP5nL/bznryC74yYtSBGKcmJzK0Ctu8JlyyvSfWJhQUkQvJ5aVIwDltpPmF3rrgF1AEK/1QU hoTh2Lw/vsqOp19akSaqmUh1mZv3xjGKGnHiLOU+D4MEl9y+G8BARHKFORVW8V58FtgQoA+u9 wPV1/k50vYoyMGshPhWQDgHD8x2/e4zfpUZjinfNj8Ix9LakKZArGH1cUGL/ZfAOXQNGgsUB2 wWzkgZgf+sMPn72uu3qfuJfz/FDXqL0CzC8YPK7WzdG0QVEy22UMZJTVCsGeZ5XMChAp1bup X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:121403 Archived-At: Ping! (This was made a blocking bug for 25.1.) On Sat, 16 Jul 2016 12:24:41 +0200 Stephen Berman wrote: > On Fri, 15 Jul 2016 19:25:52 -0300 nljlistbox2@gmail.com (N. Jackson) wrote: > >> emacs -Q >> C- ; Go to top left corner of scratch buffer. >> C-x ; Start a rectangular selection. >> C-3 C-f ; Extend the selection to the right by 3 characters. >> >> Expected result: Emacs creates a rectangular selection one character >> high and three characters wide. >> >> Actual result: Emacs hangs. (C-g quits.) >> >> With debug-on-quit on, I then get: >> >> Debugger entered--Lisp error: (quit) >> rectangle--*-char(forward-char 3 backward-char) >> rectangle-forward-char(3) >> funcall-interactively(rectangle-forward-char 3) >> call-interactively(rectangle-forward-char nil nil) >> command-execute(rectangle-forward-char) >> >> On the other hand, the following recipe works as expected: >> >> emacs -Q >> C- ; Go to top left corner of scratch buffer. >> C-x ; Start a rectangular selection. >> C-f C-f C-f ; Extend the selection to the right by 3 characters. >> >> Note 1: The exact position in the scratch buffer seems to be unimportant. >> >> Note 2: `C-n' with a numeric prefix argument seems to work fine to extend >> the rectangular region downwards. >> >> Note 3: I see this with the Emacs 25.0.95 pre-test tarball [and with the >> 25.0.90 pre-test for that matter]. The problem is still present in the >> Emacs 25 branch as of earlier this afternoon. I do not see the problem >> with Emacs 24.5. > > This is due to using save-excursion in rectangle--*-char. Replacing > that with progn makes it work with a numeric prefix argument AFAICT, and > I have not seen any resulting problems, but maybe Stefan Monnier, who > made the changes in commit 7e74ad0 that caused this regression, had a > particular case in mind that the save-excursion was intended to deal > with. If not, I think this change should go into emacs-25 (since it is > a regression from 24.5). > > diff --git a/lisp/rect.el b/lisp/rect.el > index 43621d9..9dd5db4 100644 > --- a/lisp/rect.el > +++ b/lisp/rect.el > @@ -644,7 +644,7 @@ rectangle--*-char > (curcol (current-column)) > (nextcol > (condition-case nil > - (save-excursion > + (progn > (funcall cmd 1) > (cond > ((> bol (point)) (- curcol 1)) > > Steve Berman