Hello,

Again, I apologize for sending this email to you twice Ihor. I keep forgetting to hit reply-all. Anyway...

Thank you for your clarification. Just a minor point: my concern is that org-capture is not adhering to general display-buffer settings rather than specifically display-buffer-alist. In my case display-buffer-alist is nil when I run emacs -q, but according to section 29.13.1 of the Elisp manual, if display-buffer-alist is nil, then display-buffer should consult the display-buffer-base-action user option to decide where to display a buffer. 

In my setup, when I run emacs -q display-buffer-base-action has the following value

((display-buffer--maybe-same-window 
  display-buffer-reuse-window 
  display-buffer--maybe-pop-up-frame-or-window 
  display-buffer-in-previous-window 
  display-buffer-use-some-window 
  display-buffer-pop-up-frame)).

So the steps to reproduce the behavior I'm encountering are as follows
1. Run emacs -q
2. C-x 3 C-x 3 to split the frame into three windows.
3. M-x org-capture [RET] t 

At this point, only two windows are displayed, rather than the three that were originally open. I'm not entirely familiar with what all the display-functions in display-buffer-base-action do, but I don't believe any of them should result in windows being deleted. This suggests that org-capture may not be respecting that setting. 

I also tried doing the following two alternative sets of steps, both leading to the same behavior

TEST 1:
1. Run emacs -q
2. M-x ielm
3. In ielm, run (setq display-buffer-base-action '((display-buffer-same-window))) 
4. C-x 3 C-x 3 to split the frame into three windows
5. M-x org-capture [RET] t

------------------------------------------------------------------------------------------------------------

TEST 2:
1. Run emacs -q
2. M-x ielm
3. In ielm, run (add-to-list 'display-buffer-alist '("\\*CAPTURE*" (display-buffer-same-window)))
4. C-x 3 C-x 3 to split the frame into three windows
5. M-x org-capture [RET] t

In both cases, after running org-capture, all other windows are deleted except one, regardless of the settings in display-buffer-base-action or display-buffer-alist. This leads me to believe that org-capture may not be respecting those settings, particularly if delete-other-windows is being called, as appears to be the case in org-capture-place-template.

Please let me know if I can provide any additional details or further clarification.

Best regards,
Amol Vaidya



On Sun, Sep 22, 2024 at 3:20 AM Ihor Radchenko <yantar92@posteo.net> wrote:
Amol Vaidya <amolvaidya06@gmail.com> writes:

> (Apologies for replying to this twice Ihor, forgot to reply-all last time.)
>
> The linked video was from an emacs -q, so I have made no modifications to
> display-buffer-alist, and my understanding is that emacs -q is equivalent
> to an empty init file. If that's not correct, I'm not sure what kind of
> reproducer I need to be providing.

Yes, you are correct. emacs -q is an equivalent to the empty init file.
And what you get with emacs -q is also expected - the default window placement.

There is no bug in what you have shown - Org mode uses its defaults (we
need to have some).

> I am using Emacs 29.4. I am using org 9.7.11. I don't know what the
> protocol for submitting long code excerpts is to this mailing list, so I
> apologize if this is not the preferred method, but the output of
> org-submit-bug-report is given below. If there is other information I
> should provide, please let me know.

I am trying to figure out your report that Org mode does not respect
`display-buffer-alist'. Org mode, since Org 9.7, should respect user
customization in `display-buffer-alist'.

What I want from you is sufficient information for me to replicate the
problem you are seeing on my computer. Without such information, I
simply cannot diagnose the problem.

The usual way to produce such information is providing detailed steps,
starting from emacs -Q, that demonstrate the problem.

In your case, it is probably something like
1. emacs -Q
2. Evaluate (setq display-buffer-alist ...)
3. Run M-x org-capture ...
4. Observe display-buffer-alist not being respected

See also https://orgmode.org/manual/Feedback.html

May you please provide such information for me?

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>