From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: [PATCH] Preserve buffer point in windows by default (Bug#4041). Date: Thu, 26 May 2016 22:06:29 -0400 Message-ID: <20160527020629.GA5979@holos.localdomain> References: <20160519185838.GA16418@holos.localdomain> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1464314814 28794 80.91.229.3 (27 May 2016 02:06:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 May 2016 02:06:54 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 27 04:06:45 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b67Aj-0006j8-B9 for ged-emacs-devel@m.gmane.org; Fri, 27 May 2016 04:06:45 +0200 Original-Received: from localhost ([::1]:41323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b67Ai-00005R-Cl for ged-emacs-devel@m.gmane.org; Thu, 26 May 2016 22:06:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b67Ac-0008Ud-Fs for emacs-devel@gnu.org; Thu, 26 May 2016 22:06:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b67AX-0001gF-Al for emacs-devel@gnu.org; Thu, 26 May 2016 22:06:37 -0400 Original-Received: from mail-yw0-x244.google.com ([2607:f8b0:4002:c05::244]:34734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b67AX-0001fz-55 for emacs-devel@gnu.org; Thu, 26 May 2016 22:06:33 -0400 Original-Received: by mail-yw0-x244.google.com with SMTP id j74so4618231ywg.1 for ; Thu, 26 May 2016 19:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=9kMiBzwN4bWvPCFk1WN+YGp4/swEoKPNmds82ZvfR/Q=; b=k52sELFo4FUcCnyW1YNJ1nCZkVQuzQwZ3WP1LWfYlKxp8MP/j6c0lywedTNVvKRInc gvennQfbBRLQBfX+JHeNBeawccuLD7gOP66I+oIuuqAX1kWAN37YWeSapAXzJaZOyh9O yDRPsmJm7+/n/3dpQlIw7gvI2euO5f5otzhipIHFnYS1gl4e2uYwrD5eWgFWUgqoZBFr 6kkLB/3OYpSniNsvTFbZfOA1mhowp0vBl7BusR0E0kOzKmiK6+1vdeuMBLA430lxdmnv 5q7yZPfB3z067FCP87dy0KneiKKmMJgcxCnzuI3qJSMQmBstI886KgfJvMQdltIPSWN1 uePQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9kMiBzwN4bWvPCFk1WN+YGp4/swEoKPNmds82ZvfR/Q=; b=QnlIh5FQH+3FJ4ZlY5x86osHfmNXOgPCZb4/e7GkwyFyFKTBJ5t+yo4aFGhAAP6r3o CI0rYP6U91+KTARDBz4kagHjeEmOkNpwPGiOXtZJ/w7/YxA4Qvkht+YrntAylxSn2VtH Pgbliw4+inA/wzzMuVSFOFMs14y57tVk6bblfNv6nEljftWg4bOP6OHIVTJv52SSACUx QYUWTf4DRPUR0sHE5KTv6XfVlK2g2lisFJmn0BegHnyshxStXwPS/b7gyNva2C8Z23MK 9CPnWVbU0d2hB6pDHQ3272tZu5D/KhyNmiXtF0SXkMHuEV6MoM+5REHVGe8lTlh2QE/K s3og== X-Gm-Message-State: ALyK8tLlRFMS+2QAjHQg2M/Hdk9sy3ob2eOBE/8FJDJUNFd/r9lzBEH5mJWNOR9FqyDZRGy1 X-Received: by 10.129.80.134 with SMTP id e128mr7014203ywb.14.1464314790593; Thu, 26 May 2016 19:06:30 -0700 (PDT) Original-Received: from holos.localdomain (pool-96-227-83-242.phlapa.fios.verizon.net. [96.227.83.242]) by smtp.gmail.com with ESMTPSA id q126sm4162575ywb.23.2016.05.26.19.06.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2016 19:06:29 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 15B50696E6; Thu, 26 May 2016 22:06:29 -0400 (EDT) Content-Disposition: inline In-Reply-To: <20160519185838.GA16418@holos.localdomain> User-Agent: Mutt/1.6.1+5 (b74dfb9fa901) (2016-04-27) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::244 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204064 Archived-At: * 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