From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25773: 25.2; movement w/ prefix args in rectangle-mark-mode Date: Fri, 17 Feb 2017 17:00:24 +0200 Message-ID: <83y3x4rhfb.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1487343757 27123 195.159.176.226 (17 Feb 2017 15:02:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 17 Feb 2017 15:02:37 +0000 (UTC) Cc: 25773@debbugs.gnu.org To: charles@aurox.ch (Charles A. Roelli) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 17 16:02:33 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cek3K-0006O4-HI for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Feb 2017 16:02:30 +0100 Original-Received: from localhost ([::1]:54207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cek3Q-0000KE-A8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Feb 2017 10:02:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cek1y-0007QR-OQ for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 10:01:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cek1u-00019k-Ph for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 10:01:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45471) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cek1u-00019g-M2 for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 10:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cek1u-0003Pt-Bs for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2017 10:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Feb 2017 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25773 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25773-submit@debbugs.gnu.org id=B25773.148734360813059 (code B ref 25773); Fri, 17 Feb 2017 15:01:02 +0000 Original-Received: (at 25773) by debbugs.gnu.org; 17 Feb 2017 15:00:08 +0000 Original-Received: from localhost ([127.0.0.1]:43670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cek11-0003OZ-NM for submit@debbugs.gnu.org; Fri, 17 Feb 2017 10:00:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cek10-0003Ml-C5 for 25773@debbugs.gnu.org; Fri, 17 Feb 2017 10:00:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cek0r-0000jL-BH for 25773@debbugs.gnu.org; Fri, 17 Feb 2017 10:00:01 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cek0r-0000jH-8Q; Fri, 17 Feb 2017 09:59:57 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3920 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cek0q-0003HT-JQ; Fri, 17 Feb 2017 09:59:57 -0500 In-reply-to: (charles@aurox.ch) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:129450 Archived-At: > 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))))