From: Mark Oteiza <mvoteiza@udel.edu>
To: emacs-devel@gnu.org
Subject: [PATCH] Preserve buffer point in windows by default (Bug#4041).
Date: Thu, 26 May 2016 22:06:29 -0400 [thread overview]
Message-ID: <20160527020629.GA5979@holos.localdomain> (raw)
In-Reply-To: <20160519185838.GA16418@holos.localdomain>
* 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
next prev parent reply other threads:[~2016-05-27 2:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2016-05-27 6:44 ` [PATCH] Preserve buffer point in windows by default (Bug#4041) Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160527020629.GA5979@holos.localdomain \
--to=mvoteiza@udel.edu \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).