* Consider turning on preserving window point
@ 2016-05-19 18:58 Mark Oteiza
2016-05-19 19:49 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Mark Oteiza @ 2016-05-19 18:58 UTC (permalink / raw)
To: emacs-devel
Hi,
This is an old bug for changes done in 23 that broke the behaviour of
keeping window point the same in buffers.
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=4041
It had been suggested to be enabled in subsequent releases, but this
never happened. AFAICT there has been virtually no mention on this list
of switch-to-buffer-preserve-window-point, and no bugs regarding it
since then. It appears to have been mentioned in Bug#16692.
In both bugs it appears apparent the desire is to make editing the same
buffer in multiple windows more useful.
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Consider turning on preserving window point
2016-05-19 18:58 Consider turning on preserving window point Mark Oteiza
@ 2016-05-19 19:49 ` Eli Zaretskii
2016-05-20 4:21 ` Tino Calancha
2016-05-27 2:06 ` [PATCH] Preserve buffer point in windows by default (Bug#4041) Mark Oteiza
2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2016-05-19 19:49 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
> Date: Thu, 19 May 2016 14:58:38 -0400
> From: Mark Oteiza <mvoteiza@udel.edu>
>
> This is an old bug for changes done in 23 that broke the behaviour of
> keeping window point the same in buffers.
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=4041
>
> It had been suggested to be enabled in subsequent releases, but this
> never happened. AFAICT there has been virtually no mention on this list
> of switch-to-buffer-preserve-window-point, and no bugs regarding it
> since then. It appears to have been mentioned in Bug#16692.
FWIW, I have switch-to-buffer-preserve-window-point set to t since
about forever.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Consider turning on preserving window point
2016-05-19 18:58 Consider turning on preserving window point Mark Oteiza
2016-05-19 19:49 ` Eli Zaretskii
@ 2016-05-20 4:21 ` Tino Calancha
2016-05-27 2:06 ` [PATCH] Preserve buffer point in windows by default (Bug#4041) Mark Oteiza
2 siblings, 0 replies; 5+ messages in thread
From: Tino Calancha @ 2016-05-20 4:21 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
> In both bugs it appears apparent the desire is to make editing the same
> buffer in multiple windows more useful.
Thank you. I didn't know about 'switch-to-buffer-preserve-window-point'.
It is useful: I have enabled it in my setup.
I agree it may be worth to enable this option by default.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Preserve buffer point in windows by default (Bug#4041).
2016-05-19 18:58 Consider turning on preserving window point Mark Oteiza
2016-05-19 19:49 ` Eli Zaretskii
2016-05-20 4:21 ` Tino Calancha
@ 2016-05-27 2:06 ` Mark Oteiza
2016-05-27 6:44 ` Eli Zaretskii
2 siblings, 1 reply; 5+ messages in thread
From: Mark Oteiza @ 2016-05-27 2:06 UTC (permalink / raw)
To: emacs-devel
* doc/lispref/windows.texi: Mention new default.
* etc/NEWS: Mention new default.
* lisp/window.el (switch-to-buffer-preserve-window-point): Default to t.
---
On 19/05/16 at 02:58pm, Mark Oteiza wrote:
> This is an old bug for changes done in 23 that broke the behaviour of
> keeping window point the same in buffers.
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=4041
>
> It had been suggested to be enabled in subsequent releases, but this
> never happened. AFAICT there has been virtually no mention on this list
> of switch-to-buffer-preserve-window-point, and no bugs regarding it
> since then. It appears to have been mentioned in Bug#16692.
>
> In both bugs it appears apparent the desire is to make editing the same
> buffer in multiple windows more useful.
doc/lispref/windows.texi | 5 +++--
etc/NEWS | 3 +++
lisp/window.el | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 9a09b35..94b4f3a 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -2171,8 +2171,9 @@ Switching Buffers
@code{switch-to-buffer}.
@end defopt
-By default, @code{switch-to-buffer} shows the buffer at its position of
-@code{point}. This behavior can be tuned using the following option.
+By default, @code{switch-to-buffer} unconditionally tries to display
+the buffer at its previous position in the selected window. This
+behavior can be tuned using the following option.
@defopt switch-to-buffer-preserve-window-point
If this variable is @code{nil}, @code{switch-to-buffer} displays the
diff --git a/etc/NEWS b/etc/NEWS
index d1eadd5..3d337df 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -680,6 +680,9 @@ name it), with the proviso that on some systems (e.g. Windows)
have the equivalent of a primary selection.
+++
+** 'switch-to-buffer-preserve-window-point' now defaults to t.
+
++++
** New option 'switch-to-buffer-in-dedicated-window' allows you to
customize how 'switch-to-buffer' proceeds interactively when the
selected window is strongly dedicated to its buffer.
diff --git a/lisp/window.el b/lisp/window.el
index bd5275b..f699e21 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7147,7 +7147,7 @@ window-normalize-buffer-to-switch-to
buffer))
(other-buffer)))
-(defcustom switch-to-buffer-preserve-window-point nil
+(defcustom switch-to-buffer-preserve-window-point t
"If non-nil, `switch-to-buffer' tries to preserve `window-point'.
If this is nil, `switch-to-buffer' displays the buffer at that
buffer's `point'. If this is `already-displayed', it tries to
--
2.8.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Preserve buffer point in windows by default (Bug#4041).
2016-05-27 2:06 ` [PATCH] Preserve buffer point in windows by default (Bug#4041) Mark Oteiza
@ 2016-05-27 6:44 ` Eli Zaretskii
0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2016-05-27 6:44 UTC (permalink / raw)
To: Mark Oteiza; +Cc: emacs-devel
> Date: Thu, 26 May 2016 22:06:29 -0400
> From: Mark Oteiza <mvoteiza@udel.edu>
>
> * doc/lispref/windows.texi: Mention new default.
> * etc/NEWS: Mention new default.
> * lisp/window.el (switch-to-buffer-preserve-window-point): Default to t.
Looks good to me, thanks. One comment:
> +By default, @code{switch-to-buffer} unconditionally tries to display
> +the buffer at its previous position in the selected window. This
> +behavior can be tuned using the following option.
> [...]
> +(defcustom switch-to-buffer-preserve-window-point t
> "If non-nil, `switch-to-buffer' tries to preserve `window-point'.
> If this is nil, `switch-to-buffer' displays the buffer at that
> buffer's `point'. If this is `already-displayed', it tries to
The "unconditionally" part in the first text and "tries to" in the
second are somewhat at odds, IMO. I think the latter text is more
accurate (because preserving window-point might not always work), so I
think we should make the manual text closer in spirit to the doc
string.
Other than that, please push to master.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-05-27 6:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-19 18:58 Consider turning on preserving window point Mark Oteiza
2016-05-19 19:49 ` Eli Zaretskii
2016-05-20 4:21 ` Tino Calancha
2016-05-27 2:06 ` [PATCH] Preserve buffer point in windows by default (Bug#4041) Mark Oteiza
2016-05-27 6:44 ` Eli Zaretskii
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).