summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Oteiza <mvoteiza@udel.edu>2016-05-26 21:47:18 -0400
committerMark Oteiza <mvoteiza@udel.edu>2016-05-27 07:04:58 -0400
commitee297210cffb9e8d05912686a39fa158414ba050 (patch)
tree7ac61fd596bb6eabcb9ca136945862bab075a2cd
parentf865e2f1e8878f7992d61a39bceb369c28a77706 (diff)
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 9a09b35371..015c557ef6 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -2171,8 +2171,9 @@ This option does not affect non-interactive calls of
@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} tries to preserve
+@code{window-point}. 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 d1eadd56a2..56f0ef8de2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -176,6 +176,9 @@ where you can cancel them with the 'c' command.
** The new function 'read-multiple-choice' prompts for multiple-choice
questions, with a handy way to display help texts.
++++
+** 'switch-to-buffer-preserve-window-point' now defaults to t.
+
* Editing Changes in Emacs 25.2
diff --git a/lisp/window.el b/lisp/window.el
index bd5275bffc..f699e21fd3 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7147,7 +7147,7 @@ buffer with the name BUFFER-OR-NAME and return that buffer."
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