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 #20 received at 25777 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: npostavs <at> users.sourceforge.net
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 09:51:30 -0800 (PST)
> > I checked the code of `rectangle--pos-cols' and saw that
> > it now does `goto-char' (and it did not do so before
> > Emacs 25.1).
> 
> I'm confused as to what you mean by this, since `rectangle--pos-cols'
> did not exist before 25.1.

Sorry, my bad about that expression.  I meant to say that
_there is no such problem in Emacs 24.5_.  In Emacs 24.5,
following the recipe DTRT: the C-p moves point up one line.
Emacs 24.5, like 25.1, has rectangle support.

Nothing changes in that regard for my code: I take advantage
of exactly the same functionality offered by rect.el as before.
What has changed is how rect.el obtains and returns the columns
delimiting the current region rectangle.  I changed my code
accordingly.

Perhaps I'm not being sufficiently clear about this regression.

I think it's great that a function such as `rectangle--pos-cols'
was added.  (But it has no business being considered "internal".)

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.

Do you really think that a function whose only purpose is
to let you know what the rectangle columns are should move
point and leave it in a position that is not one of the
rectangle corners?

If so, then you will say that all callers of this function
should wrap with `save-excursion' if they don't want point
moved.  I think that's the job of a function whose only
purpose is to return those columns.




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.