GNU bug report logs - #25777
25.1; [PATCH] `rectangle--pos-cols' should not move point

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 17 Feb 2017 17:52:01 UTC

Severity: wishlist

Tags: fixed

Found in version 25.1

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 25777 <at> debbugs.gnu.org
Subject: Re: bug#25777: 25.1;
 [PATCH] `rectangle--pos-cols' should not move point
Date: Mon, 27 Feb 2017 13:50:02 -0500
On Mon, Feb 27, 2017 at 12:51 PM, Drew Adams <drew.adams <at> oracle.com> wrote:
> Just as, for Emacs 24.5, I reused some code from rect.el to
> do what I need to get the rectangle columns, so I reused
> the corresponding code from Emacs 25.
>
> Look at function `apply-on-rectangle'.  In Emacs 25 it calls
> `rectangle--pos-cols' to get the rectangle columns - and so
> do I.  In Emacs 24.5 it also does just what I do (I stole
> the code) to obtain those columns.

In both 24.5 and 25.1, apply-on-rectangle wraps its body in
save-excursion, and in both versions the body contains no nested
save-excursions. So it looks to me like the regression is in your code
which decides not to call save-excursion when running on Emacs 25.

   (if modelinepos-rect-p
        (if (fboundp 'rectangle--pos-cols) ; Emacs 25+
            (let ((rpc  (rectangle--pos-cols (region-beginning) (region-end))))
              (abs (- (car rpc) (cdr rpc))))
          (let ((start  (region-beginning))
                (end    (region-end))
                startcol endcol)
            (save-excursion ...




This bug report was last modified 6 years and 25 days ago.

Previous Next


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