From: Stephen Berman <stephen.berman@gmx.net>
To: nljlistbox2@gmail.com (N. Jackson)
Cc: 23999@debbugs.gnu.org
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 [thread overview]
Message-ID: <87y4517udy.fsf@gmx.net> (raw)
In-Reply-To: <87twfq1qtr.fsf@moondust.awandering> (N. Jackson's message of "Fri, 15 Jul 2016 19:25:52 -0300")
On Fri, 15 Jul 2016 19:25:52 -0300 nljlistbox2@gmail.com (N. Jackson) wrote:
> emacs -Q
> C-<home> ; Go to top left corner of scratch buffer.
> C-x <SPC> ; 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-<home> ; Go to top left corner of scratch buffer.
> C-x <SPC> ; 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
next prev parent reply other threads:[~2016-07-16 10:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 22:25 bug#23999: 25.0.95; Emacs hangs in rectangle-mark-mode with numeric prefix argument to `C-f' N. Jackson
2016-07-16 10:24 ` Stephen Berman [this message]
2016-07-22 7:01 ` Stephen Berman
2016-07-22 7:14 ` Eli Zaretskii
2016-07-22 7:25 ` Stephen Berman
2016-07-22 9:31 ` Eli Zaretskii
2016-07-22 11:19 ` Stephen Berman
2016-07-22 11:21 ` Stephen Berman
2016-07-22 13:27 ` Eli Zaretskii
2016-07-22 14:17 ` Stefan Monnier
2016-07-20 17:19 ` Kaushal Modi
2016-07-22 23:25 ` Kaushal Modi
2016-07-23 7:35 ` Eli Zaretskii
2017-12-19 19:44 ` Charles A. Roelli
2017-12-19 21:55 ` N. Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y4517udy.fsf@gmx.net \
--to=stephen.berman@gmx.net \
--cc=23999@debbugs.gnu.org \
--cc=nljlistbox2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.