Jack Kamm <jackk...@gmail.com> 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 “'plain”, 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.