On 13.11.21 14:15, Max Nikulin wrote:
On 10/11/2021 14:50, Jan Seeger wrote:
I'm trying to make multi-frame emacsing nicer, and I encountered what I
consider a bug with the `org-no-popups` macro in `org-macs.el`.
`org-no-popups` tries to surpress the creation of new frames via setting
`pop-up-frames` and `display-buffer-alist` to nil temporarily. This does
not take `display-buffer-fallback-action` into account, which is the
preferred way of making Emacs pop up new frames (or not, as the case may
be). When the fallback variable is set, code run inside `org-no-popups`
still creates new popups, which causes functions such as
`org-insert-link` to fail, or at least act *very* confusingly.
The preferred way of overriding the behavior of `display-buffer` for
localized Emacs code seems to be the variable
`display-buffer-overriding-action`.
Changing the definition of `org-no-popups` to
```
(defmacro org-no-popups (&rest body)
"Suppress popup windows and evaluate BODY."
`(let ((display-buffer-overriding-action
'(display-buffer-pop-up-window)))
,@body))
```
correctly makes org pop up windows instead of frames.
There were enough threads concerning displaying of buffers in Org, e.g.
https://list.orgmode.org/87mtnovv7f....@alphapapa.net
https://list.orgmode.org/87zgrgke4b....@ucl.ac.uk
Some users prefers multiple frames, others multiple windows in a full-screen
frame. Could you, please, briefly describe what kind of behavior you are truing
to achieve?
Overriding `display-buffer-alist' was certainly a mistake, users should be able
to customize window creation. My impression is that `org-no-popups' is used in
different scenarios that should have different default behavior.
Some Org buffers, in my opinion, should behave similarly to completion list. On
the other hand `minibuffer-completion-help' does not use
`display-buffer-overrining-action'. I do not like that this variable has higher
priority than `display-buffer-alist'. Action argument of `display-buffer' is
more appropriate since it keeps ability to customize placement of buffers with
particular names through `display-buffer-alist'.
Thank you for suggesting `display-buffer-pop-up-window', current way of suppressing
pop-up frames is unreliable. I am considering another option: '(nil (inhibit-switch-frame
. t)) and I am unsure which variant is better. Actually I can not say that I really
understand supposed ways to use `display-buffer' and related functions. My original
expectation was that emacs should have a high level function for buffers similar to
"*Completions*".