From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20206: 25.0.50; [PATCH] keep diff-mode's window visible when we visit sources from diff-mode Date: Mon, 13 Apr 2015 17:34:03 +0300 Message-ID: <83y4lwcd2c.fsf@gnu.org> References: "cone.1428897239.195461.31778.1004@monster.email-scan.com" <552BB316.1000204@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1428935729 1463 80.91.229.3 (13 Apr 2015 14:35:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Apr 2015 14:35:29 +0000 (UTC) Cc: mrsam@courier-mta.com, 20206@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 13 16:35:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1YhfSG-0006AO-N0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Apr 2015 16:35:16 +0200 Original-Received: from localhost ([::1]:52172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhfSF-0007r2-KJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Apr 2015 10:35:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhfS6-0007o7-Jq for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2015 10:35:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhfS2-0001sF-Hc for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2015 10:35:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhfS2-0001rn-Eg for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2015 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YhfS2-0004Ao-06 for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2015 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Apr 2015 14:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20206 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 20206-submit@debbugs.gnu.org id=B20206.142893564415971 (code B ref 20206); Mon, 13 Apr 2015 14:35:01 +0000 Original-Received: (at 20206) by debbugs.gnu.org; 13 Apr 2015 14:34:04 +0000 Original-Received: from localhost ([127.0.0.1]:55111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YhfR6-00049W-1y for submit@debbugs.gnu.org; Mon, 13 Apr 2015 10:34:04 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:39578) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YhfR3-000490-9C for 20206@debbugs.gnu.org; Mon, 13 Apr 2015 10:34:02 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NMR00D001M3XH00@a-mtaout20.012.net.il> for 20206@debbugs.gnu.org; Mon, 13 Apr 2015 17:33:54 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NMR00DLV1SHY200@a-mtaout20.012.net.il>; Mon, 13 Apr 2015 17:33:54 +0300 (IDT) In-reply-to: <552BB316.1000204@gmx.at> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101479 Archived-At: > Date: Mon, 13 Apr 2015 14:14:14 +0200 > From: martin rudalics > Cc: help-gnu-emacs@gnu.org > > > The change in behavior is when there are already two buffers being shown, with different files. So, with two files, a and b: > > > > > > $ emacs -Q a b > > > > I get just "b" displayed. > > > > ^X^B^Xo, cursor down, Enter. > > > > I get the "b" file in the top window, "a" file in the bottom window, with the cursor in the "a" file's window. > > > > > > ^X^B > > > > The buffer window now replaces the "a" file, where the cursor was, and the cursor now winds up in the buffer list window. That's the different behavior than what I'm used to. > > > > > > Now, if instead of doing ^X^B at this point, I press ^Xo, moving the cursor back to the "b" file's window, then ^X^B still opens the list buffer in the "a" file's window (also). > > > > > > So, maybe the change in behavior is that list-buffers' window is "sticky", and it tries to open the buffer window in the same window it was previously shown in, apparently. If that window is showing another file buffer, even if the cursor is still in that file buffer the buffer list window still gets opened there, replacing the buffer the cursor was in. > > > > > > So, depending on window history, ^X^B ends up either opening the buffer list window in some other window, than the one the cursor is currently in, or the same window where the cursor is. I'm pretty sure that in earlier versions of emacs, ^X^B never opened the list buffer in the same window the cursor was, at the time the list-buffers command was executed. > > > > > > And that's where my muscle memory is failing me now. I'm used to having multiple windows open; and with the cursor in one of them, ^X^B opening the buffer in some other window, and then typing ^Xo to jump into the buffer list window. Now, depending on where the buffer-list window was previously shown, it will now open in the same window with the cursor, and I realize belatedly, after I already jumped somewhere else with ^Xo. > > Your explanation is correct. The behavior is intended as a feature but > inherently breaks the behavior of `pop-to-buffer', especially when used > interactively. I intend to fix this soonish for Emacs 25 and also post > a simple workaround you can use for Emacs 24.4. I think the following piece of magic will do what Sam wanted: (setq display-buffer-alist '(("\\*Buffer List\\*" . (display-buffer-pop-up-window '((inhibit-same-window . t)))))) If this is desired for all buffers, the regexp should be changed to something that matches any buffer name.