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: Sat, 16 Jul 2016 12:24:41 +0200 Message-ID: <87y4517udy.fsf@gmx.net> References: <87twfq1qtr.fsf@moondust.awandering> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468664734 15098 80.91.229.3 (16 Jul 2016 10:25:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Jul 2016 10:25:34 +0000 (UTC) Cc: 23999@debbugs.gnu.org To: nljlistbox2@gmail.com (N. Jackson) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 16 12:25:23 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 1bOMmb-00014m-0a for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jul 2016 12:25:17 +0200 Original-Received: from localhost ([::1]:36774 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOMma-0004D3-7e for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jul 2016 06:25:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOMmR-0004Bk-N3 for bug-gnu-emacs@gnu.org; Sat, 16 Jul 2016 06:25:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOMmM-0003A8-J4 for bug-gnu-emacs@gnu.org; Sat, 16 Jul 2016 06:25:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOMmM-00039z-Eo for bug-gnu-emacs@gnu.org; Sat, 16 Jul 2016 06:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bOMmM-0006wx-7u for bug-gnu-emacs@gnu.org; Sat, 16 Jul 2016 06:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jul 2016 10:25: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.146866469126679 (code B ref 23999); Sat, 16 Jul 2016 10:25:02 +0000 Original-Received: (at 23999) by debbugs.gnu.org; 16 Jul 2016 10:24:51 +0000 Original-Received: from localhost ([127.0.0.1]:53508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOMmA-0006wF-Q3 for submit@debbugs.gnu.org; Sat, 16 Jul 2016 06:24:50 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:56939) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOMm9-0006w2-61 for 23999@debbugs.gnu.org; Sat, 16 Jul 2016 06:24:49 -0400 Original-Received: from rosalinde ([89.245.64.28]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MSMKx-1bmNf72iNv-00TSyj; Sat, 16 Jul 2016 12:24:42 +0200 In-Reply-To: <87twfq1qtr.fsf@moondust.awandering> (N. Jackson's message of "Fri, 15 Jul 2016 19:25:52 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-Provags-ID: V03:K0:JhIzqV5NN4Of6DBIGXGBewjVXkMxVdviPxbb1f2wCYVZ/HP+E+W PHK9FunXv/3O4Zm0MslJJmOFFMo2S3KNvfdIB8FyRgHIo2GPushSP3JvmvUhbbSUMNExKca 8qzzwvJL8Ubj5DGqoFd6HFUXhri5WegC5htJbfuWNoJ3m2o1tocgZrDH/Rewc9uN52wAKHo pAvuBxPC0StQno1dDAQLw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Q0GfXr1Tc8w=:SN020ikF9P+WNdLkDUGPQx gsW/KXvKoY50o4p4YlrtQCAHVA+AZycFx8yWfaav6OpiE4/+CxE/Qro1RfHoow0Jh7Cr6WIQQ /ui4fxFTrlq1slaJNWhmvXbrtBoTIycrnVcbYTBomef95QkvQlm2iwtFfPt3dZaQ+2HyAv6Ux WJGUgWOn/DHYHwF6YDyNkQ7xGYt0nfIi9mLWyqI1gApXZVN/AFILstMcFiW6KmJBQjVdApRJ9 mWPcMr0Qc4yl6cmwCYWu11G8MMWydnyqAhUcigchQyjwwRXCx9HkESBeDlJgVr4H5z0OrDZ41 ESfUwem8LAQCyLzIXpxaki1XCCDODvaXkGNAbDfz3cwKBO4wKabM9a4ty81/lViHuXmq+LR/F 9ALjGCcYeIoRii1PFi+RlvDE2TNyE6AUqtxRIBZcRoVclHSFGlYLRz5sHuxtCOiz1UVliAipO 1NUrfmp41qUD6pljx900mjgIu1UtMSRPwVNP7zZzqjnG759P8MzotUvO+oH8x1CiiWlN+5HjM g9OBkors0qe0qjswEMBXx8WCDNXr9+tDH/Ne3HnJXeUbCCTzNHmpz0+zSb/dcfE14LVs6102w jzNfd76w8YF4aF4YkWE+D8djPZkF+AgXqz8ikAkTN2ZnUjPchg1ftXVIKgowsnINn8rT8uN5y KBKi0521fUQvL+7CelBGMjewVNkc4oF5wyFDqV7izAX4MSwHsEprJL3pJW2x3MmIG+jYbxjRt XxS8mwXj1N1OU29fvaz6M4BYjfCPTYB3s+Egt5UONNMoHum3m59JvZYhnteIVChiiwxmK6Yb 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:121140 Archived-At: 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