all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#25773: 25.2; movement w/ prefix args in rectangle-mark-mode
@ 2017-02-17 13:55 Charles A. Roelli
  2017-02-17 15:00 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Charles A. Roelli @ 2017-02-17 13:55 UTC (permalink / raw)
  To: 25773

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.



In GNU Emacs 25.2.1 (x86_64-apple-darwin10.8.0, NS appkit-1038.36 Version 10.6.8 (Build 10K549))
 of 2017-02-07 built on gray
Windowing system distributor 'Apple', version 10.3.1038
Configured using:
 'configure --with-modules'

Configured features:
JPEG RSVG NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25773: 25.2; movement w/ prefix args in rectangle-mark-mode
  2017-02-17 13:55 bug#25773: 25.2; movement w/ prefix args in rectangle-mark-mode Charles A. Roelli
@ 2017-02-17 15:00 ` Eli Zaretskii
  2017-02-17 16:39   ` Charles A. Roelli
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2017-02-17 15:00 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: 25773

> From: charles@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))))
 





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#25773: 25.2; movement w/ prefix args in rectangle-mark-mode
  2017-02-17 15:00 ` Eli Zaretskii
@ 2017-02-17 16:39   ` Charles A. Roelli
  2017-02-18  9:33     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Charles A. Roelli @ 2017-02-17 16:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25773

The patch fixes the problem.  Thank you.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#25773: 25.2; movement w/ prefix args in rectangle-mark-mode
  2017-02-17 16:39   ` Charles A. Roelli
@ 2017-02-18  9:33     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2017-02-18  9:33 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: 25773-done

> From: charles@aurox.ch (Charles A. Roelli)
> Cc: 25773@debbugs.gnu.org
> Date: Fri, 17 Feb 2017 17:39:55 +0100
> 
> The patch fixes the problem.  Thank you.

Thanks, pushed to the master branch.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-18  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-17 13:55 bug#25773: 25.2; movement w/ prefix args in rectangle-mark-mode Charles A. Roelli
2017-02-17 15:00 ` Eli Zaretskii
2017-02-17 16:39   ` Charles A. Roelli
2017-02-18  9:33     ` Eli Zaretskii

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.