From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs 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 Message-ID: <87zip9c43x.fsf@gmx.net> References: <87twfq1qtr.fsf@moondust.awandering> <87y4517udy.fsf@gmx.net> <878twucg1z.fsf@gmx.net> <83a8haxhy8.fsf@gnu.org> <874m7icexi.fsf@gmx.net> <834m7ixbm2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469186427 24524 80.91.229.3 (22 Jul 2016 11:20:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Jul 2016 11:20:27 +0000 (UTC) Cc: jwiegley@gmail.com, monnier@iro.umontreal.ca, 23999@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 22 13:20:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQYV4-00077E-UF for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jul 2016 13:20:15 +0200 Original-Received: from localhost ([::1]:46532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQYV4-0004P3-0d for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jul 2016 07:20:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQYUx-0004Mb-Gc for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 07:20:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQYUt-0005la-1f for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 07:20:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQYUs-0005lT-UN for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 07:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bQYUs-00079S-HJ for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 07:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Jul 2016 11:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23999 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23999-submit@debbugs.gnu.org id=B23999.146918637027448 (code B ref 23999); Fri, 22 Jul 2016 11:20:02 +0000 Original-Received: (at 23999) by debbugs.gnu.org; 22 Jul 2016 11:19:30 +0000 Original-Received: from localhost ([127.0.0.1]:60831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQYUM-00078e-3k for submit@debbugs.gnu.org; Fri, 22 Jul 2016 07:19:30 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:54596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQYUK-00078P-2I for 23999@debbugs.gnu.org; Fri, 22 Jul 2016 07:19:28 -0400 Original-Received: from rosalinde ([89.245.112.242]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M4Gup-1b8tD41pjP-00rlYB; Fri, 22 Jul 2016 13:19:17 +0200 In-Reply-To: <834m7ixbm2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 22 Jul 2016 12:31:33 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (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p2L1+qJF9DFlCir8G3KFTjqcZAgy0v 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:121410 Archived-At: On Fri, 22 Jul 2016 12:31:33 +0300 Eli Zaretskii 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)))