From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83lgawmwup.fsf@gnu.org> References: <87po2gkxpi.fsf@gmail.com> <87sh57yrax.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1530351851 6300 195.159.176.226 (30 Jun 2018 09:44:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Jun 2018 09:44:11 +0000 (UTC) Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca To: John Shahid Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 30 11:44:07 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZCQJ-0001Z4-1L for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jun 2018 11:44:07 +0200 Original-Received: from localhost ([::1]:46270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZCSQ-0007cs-AA for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jun 2018 05:46:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZCSF-0007cj-27 for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 05:46:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZCSA-00069F-3D for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 05:46:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60696) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZCS9-00068m-VT for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 05:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fZCS9-00016X-Ka for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2018 05:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Jun 2018 09:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31325 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31325-submit@debbugs.gnu.org id=B31325.15303519234198 (code B ref 31325); Sat, 30 Jun 2018 09:46:01 +0000 Original-Received: (at 31325) by debbugs.gnu.org; 30 Jun 2018 09:45:23 +0000 Original-Received: from localhost ([127.0.0.1]:40360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZCRV-00015c-31 for submit@debbugs.gnu.org; Sat, 30 Jun 2018 05:45:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fZCRT-00015Q-MQ for 31325@debbugs.gnu.org; Sat, 30 Jun 2018 05:45:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZCRJ-0004oX-I3 for 31325@debbugs.gnu.org; Sat, 30 Jun 2018 05:45:14 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZCRJ-0004o5-Ed; Sat, 30 Jun 2018 05:45:09 -0400 Original-Received: from [176.228.60.248] (port=1365 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fZCRI-0001Gw-RX; Sat, 30 Jun 2018 05:45:09 -0400 In-reply-to: <87sh57yrax.fsf@gmail.com> (message from John Shahid on Thu, 28 Jun 2018 13:27:34 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148003 Archived-At: > From: John Shahid > 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?