From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: [RFC PATCH] Changes to pop-up source buffers Date: Tue, 21 Jan 2020 04:10:20 +0000 Message-ID: <875zh55u1f.fsf@kyleam.com> References: <878sm4nn67.fsf@kyleam.com> <87a76jmksn.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58022) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itksV-0005bt-7h for emacs-orgmode@gnu.org; Mon, 20 Jan 2020 23:11:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itksT-0004c0-R7 for emacs-orgmode@gnu.org; Mon, 20 Jan 2020 23:10:58 -0500 Received: from pb-smtp21.pobox.com ([173.228.157.53]:52908) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1itkry-0004GJ-RT for emacs-orgmode@gnu.org; Mon, 20 Jan 2020 23:10:57 -0500 In-Reply-To: <87a76jmksn.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Jack Kamm , emacs-orgmode@gnu.org Jack Kamm writes: > My main motivation was to use my own display-buffer configuration to > show the source buffer. So I've rewritten the patch to be smaller and > more conservative, just adding a "plain" option to org-src-window-setup, > and not changing the implementation of any existing options. I think > this is less likely to disrupt existing workflows or introduce > accidental bugs. > > What do you think of using this smaller patch instead? The more restricted patch is fine by me. I suppose that to some degree [*] the main benefit of this patch is that it offers an option that calls quit-restore-window. For example, without this patch, you can already configure things with display-buffer-alist when org-src-window-setup is set to `current-window'. Say with (add-to-list 'display-buffer-alist '("^\\*Org Src" . (display-buffer-at-bottom))) On exit, though, the window that was popped up remains. And that makes me think that the current options that go through a simple display-buffer-based call (current-window and other-window) would benefit from calling quit-restore-window like your `plain` option does. If you agree, perhaps it's worth adding another patch on top that does that. [*] "to some degree" because the option added by your patch has the advantage that it'd work with display-buffer-base-action too. Plus, I think it's good to have a dedicated option that points to display-buffer-alist/display-buffer-base-action. > As an aside, in case we do decide to re-implement some of the display > options, now or in future, I did have a slight discrepancy from the > behavior you describe for split-window-right: > >> Quickly testing, this has a slight change in behavior. If there is >> already a window below the current Org buffer window, the new source >> window will be popped up below the _other_ window rather than the Org >> buffer. I think this could be fixed (and the code in general >> simplified) by using display-buffer-below-selected. > > On my own system, the window pops up below the existing Org buffer, even > if I have several existing horizontal splits. I'm not sure why. Hmm, weird. I tried again (Emacs 26.3, vanilla config) and still see the behavior I reported. Oh well. > Subject: [PATCH] org-src: Add option 'plain to org-src-window-setup > > * lisp/org-src.el (org-src-window-setup): Add option 'plain for > org-src-window-setup, that uses vanilla display-buffer to show the > source window. My only minor nitpick is that, in the places you write =E2=80=9C'plain=E2= =80=9D, it be more common to drop the leading quote, as `plain' and ~plain~ already suggest a symbol. (No need to reroll for that if no one else requests changes; I'll touch it up when applying.) I'll wait another day or so for others to comment before applying. Thanks.