diff options
| author | Mark Oteiza | 2016-05-26 21:47:18 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2016-05-27 07:04:58 -0400 |
| commit | ee297210cffb9e8d05912686a39fa158414ba050 (patch) | |
| tree | 7ac61fd596bb6eabcb9ca136945862bab075a2cd | |
| parent | f865e2f1e8878f7992d61a39bceb369c28a77706 (diff) | |
| download | emacs-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.texi | 5 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/window.el | 2 |
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 | ||
| 2174 | By default, @code{switch-to-buffer} shows the buffer at its position of | 2174 | By 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 |
| 2176 | option. | ||
| 2176 | 2177 | ||
| 2177 | @defopt switch-to-buffer-preserve-window-point | 2178 | @defopt switch-to-buffer-preserve-window-point |
| 2178 | If this variable is @code{nil}, @code{switch-to-buffer} displays the | 2179 | If this variable is @code{nil}, @code{switch-to-buffer} displays the |
| @@ -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 |
| 177 | questions, with a handy way to display help texts. | 177 | questions, 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'. |
| 7152 | If this is nil, `switch-to-buffer' displays the buffer at that | 7152 | If this is nil, `switch-to-buffer' displays the buffer at that |
| 7153 | buffer's `point'. If this is `already-displayed', it tries to | 7153 | buffer's `point'. If this is `already-displayed', it tries to |