GNU bug report logs - #31325
27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame

Previous Next

Package: emacs;

Reported by: John Shahid <jvshahid <at> gmail.com>

Date: Tue, 1 May 2018 00:49:02 UTC

Severity: wishlist

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Shahid <jvshahid <at> gmail.com>
Cc: 31325 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: 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 <at> gmail.com>
> Date: Thu, 28 Jun 2018 13:27:34 +0000
> Cc: 31325 <at> 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?




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

Previous Next


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