unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: John Shahid <jvshahid@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 31325@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame
Date: Tue, 03 Jul 2018 16:38:32 +0000	[thread overview]
Message-ID: <87k1qcxojb.fsf@gmail.com> (raw)
In-Reply-To: <87lgatxtip.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]


John Shahid <jvshahid@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: John Shahid <jvshahid@gmail.com>
>>> Cc: rudalics@gmx.at, 31325@debbugs.gnu.org, monnier@iro.umontreal.ca
>>> Date: Sun, 01 Jul 2018 18:58:09 +0000
>>>
>>> >From 3ac3d2d5f60593776563e27d4b406b2776de9b96 Mon Sep 17 00:00:00 2001
>>> From: John Shahid <jvshahid@gmail.com>
>>> Date: Sun, 1 Jul 2018 14:48:24 -0400
>>> Subject: [PATCH] Keep `recenter' behavior backward compatible when called
>>>  interactively
>>>
>>> * 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.

I rebased and attached a new patch since there were some changes to the
manual on master.


[-- Attachment #2: 0001-Keep-interactive-uses-of-recenter-backward-compatibl.patch --]
[-- Type: text/x-diff, Size: 2896 bytes --]

From 88c07293e82e2bcd9dbfc09a87e4d45f3e56676c Mon Sep 17 00:00:00 2001
From: John Shahid <jvshahid@gmail.com>
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 ae6837b444..3eaa15a603 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -4156,7 +4156,8 @@ Textual Scrolling
 non-@code{nil}, this function may redraw the frame, according to the
 value of @code{recenter-redisplay}.  Thus, omitting the second
 argument can be used to countermand the effect of
-@code{recenter-redisplay} being non-@code{nil}.
+@code{recenter-redisplay} being non-@code{nil}.  Interactive calls
+pass non-‘nil’ for @var{redisplay}.
 
 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)
 }
 
 
-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 (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.  Interactively, REDISPLAY is always non-nil.
 
 Just C-u as prefix means put point in the center of the window
 and redisplay normally--don't erase and redraw the frame.  */)
-- 
2.18.0


  parent reply	other threads:[~2018-07-03 16:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01  0:48 bug#31325: 27.0.50; PROPOSAL: introduce a new function to recenter without redisplaying the frame John Shahid
2018-05-08  1:37 ` Stefan Monnier
2018-06-28 13:27   ` John Shahid
2018-06-30  9:45     ` Eli Zaretskii
2018-06-30 20:20       ` John Shahid
2018-07-01  9:05         ` martin rudalics
2018-07-01 13:17           ` John Shahid
2018-07-01 16:22             ` Eli Zaretskii
2018-07-01 16:54               ` John Shahid
2018-07-01 17:03                 ` Eli Zaretskii
2018-07-01 17:14                   ` Eli Zaretskii
2018-07-01 17:25                     ` John Shahid
2018-07-01 20:17                       ` Drew Adams
2018-07-01 20:56                         ` John Shahid
2018-07-01 23:04                           ` Drew Adams
2018-07-02  2:27                             ` John Shahid
2018-07-02 15:18                               ` Eli Zaretskii
2018-07-01 17:18                   ` John Shahid
2018-07-01 18:05                     ` Eli Zaretskii
2018-07-01 18:58                       ` John Shahid
2018-07-02 15:22                         ` Eli Zaretskii
2018-07-02 20:38                           ` John Shahid
2018-07-03  8:49                             ` Robert Pluim
2018-07-03 16:38                             ` John Shahid [this message]
2018-07-07  9:09                               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1qcxojb.fsf@gmail.com \
    --to=jvshahid@gmail.com \
    --cc=31325@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).