From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Shahid Newsgroups: gmane.emacs.bugs Subject: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame Date: Mon, 02 Jul 2018 20:38:38 +0000 Message-ID: <87lgatxtip.fsf@gmail.com> References: <87po2gkxpi.fsf@gmail.com> <87sh57yrax.fsf@gmail.com> <83lgawmwup.fsf@gnu.org> <878t6wxbzr.fsf@gmail.com> <5B38994B.2010605@gmx.at> <87va9zxfhe.fsf@gmail.com> <83in5zkjsk.fsf@gnu.org> <87tvpiyjz6.fsf@gmail.com> <83fu12lwh2.fsf@gnu.org> <87sh52yiwf.fsf@gmail.com> <83d0w6ltm4.fsf@gnu.org> <87po06ye9q.fsf@gmail.com> <83woudk6gr.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1530563827 402 195.159.176.226 (2 Jul 2018 20:37:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2018 20:37:07 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 22:37:02 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 1fa5ZG-0008QA-JR for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 22:37:02 +0200 Original-Received: from localhost ([::1]:35347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa5bN-0000Uq-VU for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2018 16:39:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa5bG-0000SZ-0C for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 16:39:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa5bC-00057L-Rn for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 16:39:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36078) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fa5bC-00057B-MY for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 16:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fa5bC-0007Oe-Cu for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2018 16:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Shahid Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jul 2018 20:39:02 +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.153056393228416 (code B ref 31325); Mon, 02 Jul 2018 20:39:02 +0000 Original-Received: (at 31325) by debbugs.gnu.org; 2 Jul 2018 20:38:52 +0000 Original-Received: from localhost ([127.0.0.1]:43975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa5b2-0007OG-BO for submit@debbugs.gnu.org; Mon, 02 Jul 2018 16:38:52 -0400 Original-Received: from mail-qt0-f181.google.com ([209.85.216.181]:35655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fa5b0-0007Nz-HD for 31325@debbugs.gnu.org; Mon, 02 Jul 2018 16:38:50 -0400 Original-Received: by mail-qt0-f181.google.com with SMTP id z6-v6so14971776qti.2 for <31325@debbugs.gnu.org>; Mon, 02 Jul 2018 13:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=74GaVRUF8nF9mEsbnZDKVNr1enVxZD3fAtg3uGHlWQY=; b=SCHkiBLviH53PPxAdBi6ZQYZwXJIgAVuMmNke7FeoQjp7+CDbEdxTbviuJ0M9xs8cV A+U2hKnCuK3CrtXhio1MHXqAAqJ9+j6s8XQvSh4aEpMZ1rFn+2/S6uHRHdpGySPQzoLT +QLZJD148h65um5bIePJu9Ug8i7lRgu+b5onfOy0m5ezgsVGZnAwj2Q4aUVo3MEwq+r4 d96CU5DPuDtulQC30YRot1VCUwScDoFYmSsZJDfMc7MVMCTiFBTlvkw2UG/cHIZSWEPR huQX8ZwHDJl8/jCWFDqpJeFpLvEIexu7xGNrWq0jZePm25ruWe+yWL633tcF6apEpJ5u atJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=74GaVRUF8nF9mEsbnZDKVNr1enVxZD3fAtg3uGHlWQY=; b=oOPdJrbRAvcW6LhDlQIq1B88S9Gf7wyX1HxNJfw0WV8pqSULaeZfzbrDEuwt56aVWf 4mrwXsrp6tA7rI+4ohQCgdvDgGsICeidaQqSSkU2xKudxAzXs5SKJ3Bcs9whmo6moGTs 8COqM59IuqRFpVdDQ8a31iftROO8XGakeT6IFoKXnZ2/fmnTc74bWhrQk1KI9OiCGnJY Bwsg9UA6vFLffP9k4lPspV3Rs6b1fjMUzQzEjWI7RBiY0goVdUu9hpUyFdrt2Km12SMI Gb3PoyH9tj8/bjeKfhXXCi5z2DA2O+Nl6PQ5dHcxDaUBl6Xj09gUqfvDHWeTrYLaRvzn oT8A== X-Gm-Message-State: APt69E0cWozkbBGR9exZLlN2TlyyThEKYdPJ8YlrLCELfgDTUYpg7FUd QrlImip7xjZka5dx0Kiq0hc= X-Google-Smtp-Source: AAOMgpdWoCErz3vXHzoVhii4fz7m8V00IsZ5MRwst0dS7jPt/Ugt3ZV6Xdk+gYDCZJdhaTmqS4AphA== X-Received: by 2002:a0c:873d:: with SMTP id 58-v6mr24121795qvh.199.1530563924751; Mon, 02 Jul 2018 13:38:44 -0700 (PDT) Original-Received: from 9a50e8462956 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id n20-v6sm9942839qtp.89.2018.07.02.13.38.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 13:38:43 -0700 (PDT) In-reply-to: <83woudk6gr.fsf@gnu.org> 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:148126 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: John Shahid >> Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca >> Date: Sun, 01 Jul 2018 18:58:09 +0000 >>=20 >> >From 3ac3d2d5f60593776563e27d4b406b2776de9b96 Mon Sep 17 00:00:00 2001 >> From: John Shahid >> Date: Sun, 1 Jul 2018 14:48:24 -0400 >> Subject: [PATCH] Keep `recenter' behavior backward compatible when called >> interactively >>=20 >> * window.c (recenter): Change the interactive spec to always pass a >> non-nil value to the REDISPLAY argument when called interactively. >> * window.el (recenter-top-bottom): Make sure recenter's second >> argument is non-nil everywhere. >> * windows.texi (Textual Scrolling): Edit documentation of `recenter'. > > Bug number is missing. Also, we prefer to quite in documentation (as > opposed to doc strings) 'like this', not `like this'. That is fixed in the attached patch. > >> --- a/doc/lispref/windows.texi >> +++ b/doc/lispref/windows.texi >> @@ -4154,7 +4154,8 @@ Textual Scrolling >> @code{recenter} puts the line containing point in the middle of the >> window. If @var{count} is @code{nil} and @var{redisplay} is >> non-@code{nil}, this function may redraw the frame, according to the >> -value of @code{recenter-redisplay}. >> +value of @code{recenter-redisplay}. Interactive calls pass non-=E2=80= =98nil=E2=80=99 >> +for @var{redisplay}. ^^ > > Two spaces between sentences. Sorry about that, I'm still getting used to using 2 spaces after period. How do you spot these ? Do you have some font-lock keyword to highlight them. I found checkdoc not to be very useful for checking the manual or docstrings in .c files. > >> -DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", >> +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P\np", >> doc: /* Center point in selected window and maybe redisplay fram= e. >> With a numeric prefix argument ARG, recenter putting point on screen li= ne ARG >> relative to the selected window. If ARG is negative, it counts up from= the >> @@ -5910,7 +5910,7 @@ non-nil, also erase the entire frame and redraw it= (when >> `auto-resize-tool-bars' is set to `grow-only', this resets the >> tool-bar's height to the minimum height needed); if >> `recenter-redisplay' has the special value `tty', then only tty frames >> -are redrawn. >> +are redrawn. Interactive calls pass non-nil for REDISPLAY. > > I think this text is slightly more clear: > > Interactively, REDISPLAY is always non-nil. I changed the text in the attached patch. Thanks, --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Keep-interactive-uses-of-recenter-backward-compatibl.patch Content-Transfer-Encoding: quoted-printable >From ed35d20c422adc80bfbd4090b64d9a43d099b6b9 Mon Sep 17 00:00:00 2001 From: John Shahid Date: Sun, 1 Jul 2018 14:48:24 -0400 Subject: [PATCH] Keep interactive uses of 'recenter' backward compatible (Bug#31325) * window.c (recenter): Change the interactive spec to always pass a non-nil value to the REDISPLAY argument when called interactively. * window.el (recenter-top-bottom): Make sure recenter's second argument is non-nil everywhere. * windows.texi (Textual Scrolling): Edit documentation of 'recenter'. --- doc/lispref/windows.texi | 3 ++- lisp/window.el | 2 +- src/window.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 9740bbebf2..6f1cf788a0 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -4154,7 +4154,8 @@ Textual Scrolling @code{recenter} puts the line containing point in the middle of the window. If @var{count} is @code{nil} and @var{redisplay} is non-@code{nil}, this function may redraw the frame, according to the -value of @code{recenter-redisplay}. +value of @code{recenter-redisplay}. Interactive calls pass non-=E2=80=98n= il=E2=80=99 +for @var{redisplay}. =20 When @code{recenter} is called interactively, @var{count} is the raw prefix argument. Thus, typing @kbd{C-u} as the prefix sets the diff --git a/lisp/window.el b/lisp/window.el index 6d9d8bdcd2..d56bed63da 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8767,7 +8767,7 @@ recenter-top-bottom With plain `C-u', move current line to window center." (interactive "P") (cond - (arg (recenter arg)) ; Always respect ARG. + (arg (recenter arg t)) ; Always respect ARG. (t (setq recenter-last-op (if (eq this-command last-command) diff --git a/src/window.c b/src/window.c index 20f6862e3b..047b741475 100644 --- a/src/window.c +++ b/src/window.c @@ -5896,7 +5896,7 @@ displayed_window_lines (struct window *w) } =20 =20 -DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P\np", doc: /* Center point in selected window and maybe redisplay frame. With a numeric prefix argument ARG, recenter putting point on screen line = ARG relative to the selected window. If ARG is negative, it counts up from the @@ -5908,7 +5908,7 @@ non-nil, also erase the entire frame and redraw it (w= hen `auto-resize-tool-bars' is set to `grow-only', this resets the tool-bar's height to the minimum height needed); if `recenter-redisplay' has the special value `tty', then only tty frames -are redrawn. +are redrawn. Interactively, REDISPLAY is always non-nil. =20 Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) --=20 2.18.0 --=-=-=--