aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Oteiza2016-05-26 21:47:18 -0400
committerMark Oteiza2016-05-27 07:04:58 -0400
commitee297210cffb9e8d05912686a39fa158414ba050 (patch)
tree7ac61fd596bb6eabcb9ca136945862bab075a2cd
parentf865e2f1e8878f7992d61a39bceb369c28a77706 (diff)
downloademacs-ee297210cffb9e8d05912686a39fa158414ba050.tar.gz
emacs-ee297210cffb9e8d05912686a39fa158414ba050.zip
Preserve buffer point in windows by default (Bug#4041).
* doc/lispref/windows.texi: Mention new default. * etc/NEWS: Mention new default. * lisp/window.el (switch-to-buffer-preserve-window-point): Default to t.
-rw-r--r--doc/lispref/windows.texi5
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/window.el2
3 files changed, 7 insertions, 3 deletions
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 9a09b35371d..015c557ef6d 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -2171,8 +2171,9 @@ This option does not affect non-interactive calls of
2171@code{switch-to-buffer}. 2171@code{switch-to-buffer}.
2172@end defopt 2172@end defopt
2173 2173
2174By default, @code{switch-to-buffer} shows the buffer at its position of 2174By default, @code{switch-to-buffer} tries to preserve
2175@code{point}. This behavior can be tuned using the following option. 2175@code{window-point}. This behavior can be tuned using the following
2176option.
2176 2177
2177@defopt switch-to-buffer-preserve-window-point 2178@defopt switch-to-buffer-preserve-window-point
2178If this variable is @code{nil}, @code{switch-to-buffer} displays the 2179If this variable is @code{nil}, @code{switch-to-buffer} displays the
diff --git a/etc/NEWS b/etc/NEWS
index d1eadd56a21..56f0ef8de24 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -176,6 +176,9 @@ where you can cancel them with the 'c' command.
176** The new function 'read-multiple-choice' prompts for multiple-choice 176** The new function 'read-multiple-choice' prompts for multiple-choice
177questions, with a handy way to display help texts. 177questions, with a handy way to display help texts.
178 178
179+++
180** 'switch-to-buffer-preserve-window-point' now defaults to t.
181
179 182
180* Editing Changes in Emacs 25.2 183* Editing Changes in Emacs 25.2
181 184
diff --git a/lisp/window.el b/lisp/window.el
index bd5275bffc9..f699e21fd31 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7147,7 +7147,7 @@ buffer with the name BUFFER-OR-NAME and return that buffer."
7147 buffer)) 7147 buffer))
7148 (other-buffer))) 7148 (other-buffer)))
7149 7149
7150(defcustom switch-to-buffer-preserve-window-point nil 7150(defcustom switch-to-buffer-preserve-window-point t
7151 "If non-nil, `switch-to-buffer' tries to preserve `window-point'. 7151 "If non-nil, `switch-to-buffer' tries to preserve `window-point'.
7152If this is nil, `switch-to-buffer' displays the buffer at that 7152If this is nil, `switch-to-buffer' displays the buffer at that
7153buffer's `point'. If this is `already-displayed', it tries to 7153buffer's `point'. If this is `already-displayed', it tries to