[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Preserve buffer point in windows by default (Bug#4041).
From: |
Mark Oteiza |
Subject: |
[PATCH] Preserve buffer point in windows by default (Bug#4041). |
Date: |
Thu, 26 May 2016 22:06:29 -0400 |
User-agent: |
Mutt/1.6.1+5 (b74dfb9fa901) (2016-04-27) |
* 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
address@hidden 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