From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 18 19:50:24 2018 Received: (at submit) by debbugs.gnu.org; 19 Nov 2018 00:50:24 +0000 Received: from localhost ([127.0.0.1]:59516 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOXlg-0002Bq-3o for submit@debbugs.gnu.org; Sun, 18 Nov 2018 19:50:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOWuJ-0000sc-F5 for submit@debbugs.gnu.org; Sun, 18 Nov 2018 18:55:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOWuD-00050o-Bz for submit@debbugs.gnu.org; Sun, 18 Nov 2018 18:55:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,TVD_SPACE_RATIO autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54770) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gOWuD-00050h-97 for submit@debbugs.gnu.org; Sun, 18 Nov 2018 18:55:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOWuB-0001fu-TB for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 18:55:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOWuB-00050I-6g for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 18:55:07 -0500 Received: from mail-it1-x12c.google.com ([2607:f8b0:4864:20::12c]:34087) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gOWuB-0004yd-0q for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 18:55:07 -0500 Received: by mail-it1-x12c.google.com with SMTP id x124so5961380itd.1 for ; Sun, 18 Nov 2018 15:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Ro+lV+ndx4Ycil4QvLFyBSN+OqVgrG1DwyEgnSMhu7k=; b=Dsahm7kgyY0vj8ltqAO//Ln78U3IMcIH+pWEXs185DadSfrZPhRElUFeHwmN9hytWT xzEikeaPNRQAqUj5154Np1Qh8oxk0K/wEKA+YefJ2HX9YUI1SZ5/2yZ8E1mpHpXj0Jkn yYat9FBKRbzzUNgoK4VViFv9bagZT4OOVIMTxmaHmS14cjdMp4pTMdlIxF9F57uWY2ME aEPp4uzEJ2wQTAkLAqnueKXNplCj+QLwYIVSkadARPK0QQbBOQrUODIxkPGZTO9YFP+K Z/Rq4dFTY3SQhZEswmqshlb/2gTG+xw7ct9iUnRKvzrVLt179VWrjjqjGXahV0+eMQ8v naXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Ro+lV+ndx4Ycil4QvLFyBSN+OqVgrG1DwyEgnSMhu7k=; b=gTi+CpAJgewVQ9fqdBRzEloxqT+ggnyfYv3A0pfxRcb/Gnhbl+GAuTjxQy0uMjQzPJ AlkImLDhhundEmpaabgiIR6DIuKrVX66KMcvVrRskQ3zVvDKq5Tl3I+19oKUVx5hnyUp AB87mEgV0W+VfyH7d8ZKPQQV1oMY9i2Crtl0Uo4UMBN++rjpjeq2z1N+iLe0vfTxD3H1 ZGcwZnVBa5QhNvlttS5pUm7Dj3qO67Tb4Oypr+Sl4IoOBTNaxVhdydqBpqPQ8fXQnvAN imTx2NUBt5WNAUfDO9O3DbN/CL/8mkWaJbMKz7+SDERc4Xb2pSAUEp5kihT+q/py3HNt dZfQ== X-Gm-Message-State: AGRZ1gJ6M3W+c77tY3Hn1+Qyr2rVc/u8cBiiQdYnEFRLjrENXDbAmDB7 Pjyi/2/rQPJkH5aAvsVSLk9mx9Nersun2nxsvOkI6N6t X-Google-Smtp-Source: AFSGD/WfkZu15Q1tz8eP4Z+0vOCZgLPJvv/99YO2lJd7qUW7+81WCDzkg5TiNbE+tAz7P+EAy4kexK9pC+OR8KW/a2M= X-Received: by 2002:a24:a20e:: with SMTP id j14mr6632478itf.14.1542585305367; Sun, 18 Nov 2018 15:55:05 -0800 (PST) MIME-Version: 1.0 From: Steve Schooler Date: Sun, 18 Nov 2018 15:54:54 -0800 Message-ID: Subject: pop-to-buffer-same-window in emacs 26-1 To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000298aab057af921de" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 18 Nov 2018 19:50:22 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --000000000000298aab057af921de Content-Type: text/plain; charset="UTF-8" Please see https://emacs.stackexchange.com/questions/46072/emacs-26-1-problems-find-file-and-neotree --000000000000298aab057af921de Content-Type: text/html; charset="UTF-8" --000000000000298aab057af921de-- From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 19 10:59:18 2018 Received: (at 33424) by debbugs.gnu.org; 19 Nov 2018 15:59:18 +0000 Received: from localhost ([127.0.0.1]:32856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOlxF-00037f-PI for submit@debbugs.gnu.org; Mon, 19 Nov 2018 10:59:18 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOlxE-00037S-1t for 33424@debbugs.gnu.org; Mon, 19 Nov 2018 10:59:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOlx5-0007So-NK for 33424@debbugs.gnu.org; Mon, 19 Nov 2018 10:59:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOlwv-0007PC-Bc; Mon, 19 Nov 2018 10:58:57 -0500 Received: from [176.228.60.248] (port=3938 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gOlwv-0003VX-01; Mon, 19 Nov 2018 10:58:57 -0500 Date: Mon, 19 Nov 2018 17:59:02 +0200 Message-Id: <83wop9rrcp.fsf@gnu.org> From: Eli Zaretskii To: Steve Schooler In-reply-to: (message from Steve Schooler on Sun, 18 Nov 2018 15:54:54 -0800) Subject: Re: bug#33424: pop-to-buffer-same-window in emacs 26-1 References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33424 Cc: 33424@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) tags 33424 notabug thanks > From: Steve Schooler > Date: Sun, 18 Nov 2018 15:54:54 -0800 > > Please see https://emacs.stackexchange.com/questions/46072/emacs-26-1-problems-find-file-and-neotree Thanks, but please in the future describe the issue in detail here. I will copy the relevant parts of the above URL: > The Problems: > > I just did a full re-install to Fedora 29, which included the dnf install emacs command. This installed emacs 26-1; formerly I was using emacs 25.2. Formerly, my emacs initialization concluded with : > > (neotree-dir "/home/steve/") > ; > (eww-open-file "~/emacs/neotree/EmacsWiki: Neo Tree.html") > (find-file "~/notes/notes_todo.txt") > (find-file "~/emacs/mywork/notes_todo.txt") > (find-file "~/emacs/mywork/elisp_notes_todo.txt") > (find-file "~/notes/notes_movies_to_download.txt") > (find-file "~/notes/notes_watched_tv.txt") > (find-file "~/math/misc/complex_analysis_01.tex") > > In emacs 25.2, this worked fine, with the neotree attached to the frame. In emacs 26-1, the frame is split horizontally into two windows, with the last file opened in the bottom window. Further, when I navigate to the frame's bottom window, and then execute C-x 1 (delete-other-windows), the neotree is also deleted. In emacs 25.2, the neotree would not be deleted here. > > Also, sometimes when I open a file, it splits the frame into two windows rather than simply switching to the new file's buffer. I haven't been able to track down the pattern behind this behavior, so I can't be more precise here. > > My kludgy temporary initialization workaround: > > (eww-open-file "~/emacs/neotree/EmacsWiki: Neo Tree.html") > (find-file "~/notes/notes_todo.txt") > (find-file "~/emacs/mywork/notes_todo.txt") > (find-file "~/emacs/mywork/elisp_notes_todo.txt") > (find-file "~/notes/notes_movies_to_download.txt") > (find-file "~/notes/notes_watched_tv.txt") > (find-file "~/math/misc/complex_analysis_01.tex") > ; > (delete-other-windows) > ; > (neotree-dir "/home/steve/") > > This resolves initialization but does not resolve the subsequent undesired splitting of a frame into windows. Also, it does not resolve preserving neotree when I delete a window from a split frame. > > My Research > > In emacs 25.2, the relevant code was : > > (defun find-file (filename &optional wildcards) > "..." > (interactive > (find-file-read-args "Find file: " > (confirm-nonexistent-file-or-buffer))) > (let ((value (find-file-noselect filename nil nil wildcards))) > (if (listp value) > (mapcar 'switch-to-buffer (nreverse value)) > ;;else : this comment added by me > (switch-to-buffer value)))) > > In emacs 26.1, the relevant code is : > > (defun find-file (filename &optional wildcards) > "..." > (interactive > (find-file-read-args "Find file: " > (confirm-nonexistent-file-or-buffer))) > (let ((value (find-file-noselect filename nil nil wildcards))) > (if (listp value) > (mapcar 'pop-to-buffer-same-window (nreverse value)) > ;;else : this comment added by me > (pop-to-buffer-same-window value)))) > > Either: > 1. I have misunderstood the purpose of (pop-to-buffer-same-window) or > 2. (pop-to-buffer-same-window) is not working as intended. AFAICT, pop-to-buffer-same-window is working as intended. It tries to display the file in the window from which find-file was invoked, but your original code, which called neotree-dir before loading the files, caused find-file to be invoked from the neotree window (to which neotree-dir switches), and that window is dedicated to its buffer. So pop-to-buffer-same-window cannot reuse that window for another buffer, and it therefore uses a different window (in this case, creating a new one). Your workaround is actually what I would recommend as _the_ solution: call neotree-dir after loading all of the files (there's no need for deleting the other windows, at least not in my testing). That will invoke find-file from a non-dedicated window, and will work as you expect. IOW, your original code relied on undocumented behavior of find-file when invoked from a window that is dedicated to its buffer. That undocumented behavior was changed to another undocumented behavior, the only documented aspect of which is that find-file uses some other window in this case; it is unspecified which window exactly. Also, I cannot reproduce this part: > Further, when I navigate to the frame's bottom window, and then execute C-x 1 (delete-other-windows), the neotree is also deleted. In my testing, the neotree window is not deleted by "C-x 1", as I'd expect, because it has its no-delete-other-windows parameter set to a non-nil value. Maybe your neotree installation is outdated? (I tried the latest version.) Or maybe some other local customizations cause this? Bottom line, I see no bugs here. It is all intended and correct behavior. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 20 10:48:07 2018 Received: (at 33424-done) by debbugs.gnu.org; 20 Nov 2018 15:48:07 +0000 Received: from localhost ([127.0.0.1]:35253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gP8Fz-0002fs-Kd for submit@debbugs.gnu.org; Tue, 20 Nov 2018 10:48:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gP8Fz-0002fX-0g for 33424-done@debbugs.gnu.org; Tue, 20 Nov 2018 10:48:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gP8Fo-0005JV-6k for 33424-done@debbugs.gnu.org; Tue, 20 Nov 2018 10:48:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gP8Fm-0005Hw-6k; Tue, 20 Nov 2018 10:47:54 -0500 Received: from [176.228.60.248] (port=3116 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gP8Fj-00021D-QC; Tue, 20 Nov 2018 10:47:53 -0500 Date: Tue, 20 Nov 2018 17:47:59 +0200 Message-Id: <831s7fkaxc.fsf@gnu.org> From: Eli Zaretskii To: Steve Schooler In-reply-to: (message from Steve Schooler on Mon, 19 Nov 2018 13:18:53 -0800) Subject: Re: bug#33424: pop-to-buffer-same-window in emacs 26-1 References: <83wop9rrcp.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 33424-done Cc: 33424-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) [Please use "Reply to All" to reply to these messages, otherwise you are only replying to myself.] > From: Steve Schooler > Date: Mon, 19 Nov 2018 13:18:53 -0800 > > Thank you very much for the thorough analysis. I just installed the latest version of neotree, and the behavior > of emacs 26-1 is just as you described. This covers most but (perhaps) not all of the bug-issue that I > suspected. > > I thought that I had also noticed unusual behavior, where (sometimes) opening a file would result in splitting > the current frame into 2 windows, rather than dedicating the entire frame to the new file. Unfortunately, I could > not detect a pattern to this, so I can not report a reproducible situation, EXCEPT FOR ONE THING. > > Suppose that you re-create the situation where at the end of your emacs initialization, you use the find-file > command to load a few files, then use the neotree command. You would then be simulating the tail end of my > initialization. > > Suppose that immediately after emacs comes up, you take the menu option to display the > list of (some of ) the buffers. If you then mouse-select one of these buffers, the frame will split into two > windows. I suspect that this is BECAUSE the pop-to-buffer-same-window function is REGARDING THE > FRAME AS BELONGING TO NEOTREE. > > This is just a heads-up. You might reasonably construe this to NOT BE A BUG. If so, then I think the > bug-ticket can be closed. However, this may serve as a warning that in some situations, > pop-to-buffer-same-window will behave unusually, based on who pop-to-buffer-same-window believes is the > "owner" of the frame. If you invoke find-file from the menu bar with the neotree's directory in the selected window, you will always see this behavior, because find-file is unable to reuse the selected window, due to its being dedicated to the neotree buffer. I'm therefore closing the bug. From unknown Fri Jun 20 07:22:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 19 Dec 2018 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator