[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter witho
From: |
Eli Zaretskii |
Subject: |
bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame |
Date: |
Sat, 30 Jun 2018 12:45:18 +0300 |
> From: John Shahid <jvshahid@gmail.com>
> Date: Thu, 28 Jun 2018 13:27:34 +0000
> Cc: 31325@debbugs.gnu.org
>
> >> 1. introduce a new lisp function for recentering and discourage the use
> >> of `recenter' from lisp (i.e. declaring it `interactive-only'), or
> >> 2. add a new `recenter-and-redisplay' and bound it to C-l
> >> Also, Stefan's suggestion/possible solution:
> >> 3. adding an argument to `recenter' to control the redisplay behavior
> >
> > Either of those is OK. The benefit of the 3rd is that it would likely
> > "magically fix" 99% of the existing uses (I'm thinking of adding an
> > optional argument which we could call `and-redisplay` which when non-nil
> > tells recenter to do a redisplay, so all existing Elisp calls would be
> > implicitly modified not to cause a redisplay).
>
> I ended up going with option 3. I also used `redisplay` instead of
> `and-redisplay`. I felt the `and` is redundant, not sure how strongly
> you feel about the name.
Thanks, but please also include a NEWS entry announcing the change,
and a suitable change for the ELisp manual.
And I have a few comments:
> - (register Lisp_Object arg)
> + (register Lisp_Object arg, register Lisp_Object redisplay)
I believe nowadays we remove the 'register' qualifiers whenever we
change code that uses them.
> {
> struct window *w = XWINDOW (selected_window);
> struct buffer *buf = XBUFFER (w->contents);
> @@ -5933,8 +5934,9 @@ and redisplay normally--don't erase and redraw the
> frame. */)
>
> if (NILP (arg))
> {
> - if (!NILP (Vrecenter_redisplay)
> - && (!EQ (Vrecenter_redisplay, Qtty)
> + if (!NILP (redisplay)
> + && !NILP (Vrecenter_redisplay)
> + && (!EQ (redisplay, Qtty)
^^^^^^^^^
This should have been Vrecenter_redisplay, right?