unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: jwiegley@gmail.com, monnier@iro.umontreal.ca, 23999@debbugs.gnu.org
Subject: bug#23999: 25.0.95; Emacs hangs in rectangle-mark-mode with numeric prefix argument to `C-f'
Date: Fri, 22 Jul 2016 13:19:14 +0200	[thread overview]
Message-ID: <87zip9c43x.fsf@gmx.net> (raw)
In-Reply-To: <834m7ixbm2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 22 Jul 2016 12:31:33 +0300")

On Fri, 22 Jul 2016 12:31:33 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> > I'm fine with pushing to master if no one objects to this particular
>> > solution.
>> 
>> Why not emacs-25, given that the behavior is a regression from 24.5 (and
>> of course assuming the fix doesn't break anything else)?
>
> Because a workaround exists, 

You mean just repeating a motion command instead of using a numeric
prefix?

>                              and because we cannot assume it doesn't
> break anything else without prolonging the pretest.

Thanks for your healthy scepticism here; I checked again and indeed the
patch changes the behavior in rectangle-mark-mode when attempting to
move past bol or eol.  The patch tries to rectify this and according to
my tests, it works with a numeric prefix argument but behaves the same
as the current version when attempting to move past bol or eol.

If you think this corrected patch should still not go into emacs-25,
perhaps there should be a note in PROBLEMS, since motion commands in
general accept a numeric prefix and someone who successfully used
rectangle-mark-mode that way in 24.5 will naturally assume it works in
25.1 and be surprised when Emacs hangs.

Steve Berman

diff --git a/lisp/rect.el b/lisp/rect.el
index fb85b18..bb01b98 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -653,6 +653,12 @@ rectangle--*-char
                   (end-of-buffer (+ col (1+ n)))
                   (beginning-of-buffer (- curcol 1))))
                (diff (abs (- nextcol col))))
+	  ;; Move to the correct column when selecting a rectangular
+	  ;; region by passing a numeric prefix argument to a motion
+	  ;; command, but stop at bol in any case.
+	  (if (wholenump nextcol)
+	      (move-to-column nextcol)
+	    (goto-char bol))
           (cond
            ((and (< nextcol curcol) (< curcol col))
             (let ((curdiff (- col curcol)))





  reply	other threads:[~2016-07-22 11:19 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zip9c43x.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=23999@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jwiegley@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).