[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Drew Adams
Subject: bug#25777: 25.1; [PATCH] `rectangle--pos-cols' should not move point
Date: Mon, 27 Feb 2017 11:21:34 -0800 (PST)

> > 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.

OK, clearly I'm not getting through to you.  The bug will remain, and
I'll wrap my calls to `rectangle--pos-cols' in `save-excursion'.

For the record:

1. I do not call `apply-on-rectangle'.

2. The purpose of `rectangle--pos-cols', just as was the purpose
of the previous (Emacs 24.5) code, is to return the rectangle
columns.  Nothing more.  Its purpose is not to move point and
leave it in some other place that is not a rectangle corner.

3. `rectangle--pos-cols' is a general function.  It should not
be considered internal.  It is useful generally - I have
reused it, as one example.  (I have not used `apply-on-rectangle'.)

Is there a reason to have `rectangle--pos-cols' move point,
instead of use `save-excursion'?  You've given none.  Do you
argue that performance matters here?  What's the argument in
favor of not having this code be as clean as it was in Emacs
24.5?  Why favor this regression?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]