GNU bug report logs - #25773
25.2; movement w/ prefix args in rectangle-mark-mode

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch (Charles A. Roelli)

Date: Fri, 17 Feb 2017 13:56:01 UTC

Severity: normal

Found in version 25.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 25773 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: charles <at> aurox.ch (Charles A. Roelli)
Cc: 25773 <at> debbugs.gnu.org
Subject: Re: bug#25773: 25.2; movement w/ prefix args in rectangle-mark-mode
Date: Fri, 17 Feb 2017 17:00:24 +0200
> From: charles <at> aurox.ch (Charles A. Roelli)
> Date: Fri, 17 Feb 2017 14:55:32 +0100
> 
> >From emacs -Q:
> 
> - C-u 2 C-p
> - C-x SPC
> - C-u C-f
> 
> Emacs hangs before point can move, and you can exit the hang with enough
> C-g's.  C-f works fine without a prefix arg, however.

(It also works with a prefix arg, as long as the arg is 1.)

Does the patch below give good results?  (I myself am not much of a
rectangle-mode user.)

Thanks.

diff --git a/lisp/rect.el b/lisp/rect.el
index a4fa282..a85101f 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -639,7 +639,8 @@ rectangle--*-char
   ;; rectangles" and not "visual rectangles", so in the presence of
   ;; bidirectional text things won't work well anyway.
   (if (< n 0) (rectangle--*-char other-cmd (- n))
-    (let ((col (rectangle--point-col (point))))
+    (let ((col (rectangle--point-col (point)))
+          (step 1))
       (while (> n 0)
         (let* ((bol (line-beginning-position))
                (eol (line-end-position))
@@ -647,7 +648,7 @@ rectangle--*-char
                (nextcol
                 (condition-case nil
                     (save-excursion
-                      (funcall cmd 1)
+                      (funcall cmd step)
                       (cond
                        ((> bol (point)) (- curcol 1))
                        ((< eol (point)) (+ col (1+ n)))
@@ -666,7 +667,8 @@ rectangle--*-char
            (t ;; (> nextcol curcol)
             (if (<= diff n)
                 (progn (cl-decf n diff) (setq col nextcol))
-              (setq col (if (< col nextcol) (+ col n) (- col n)) n 0))))))
+              (setq col (if (< col nextcol) (+ col n) (- col n)) n 0))))
+          (setq step (1+ step))))
       ;; FIXME: This rectangle--col-pos's move-to-column is wasted!
       (rectangle--col-pos col 'point))))
 




This bug report was last modified 8 years and 157 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.