Björn Kettunen <[email protected]> writes:

>>> Thanks for the reproducer. Especially the make repro target. One note
>>> for it it didn't open a unless I removed the & on the repro target.
>>
>> Could you elaborate?
>
> I called make repro in Emacs. If there's the & add the end of the make
> target to send the process into the background then that Emacs doesn't
> open a frame.

I see. It is intended to be called from outside Emacs, in terminal.
It is the first time I am seeing someone doing it via something like M-x
compile.

>>> +  (if (equal org-log-note-previous-frame (selected-frame))
>>> +      (set-window-configuration org-log-note-previous-window-configuration)
>>> +    (set-window-configuration org-log-note-window-configuration)
>>> +    (raise-frame org-log-note-previous-frame)
>>> +    (set-window-configuration org-log-note-previous-window-configuration))
>>
>> I am wondering if we could instead use quit-restore window parameter to
>> handle all this. The code above appears to re-implement the quitting logic.
>
> How so? I'm not sure I fully understand. Reading the manual on quitting
> windows doesn't mention anything on window configuration. The logic is
> quite complex to be honest. I also don't see any mention about raising frames.

I think it simply boils down to
(quit-window 'kill) instead of kill-buffer, which should take care about
restoring the window configuration.

I have to say that I do agree that quit-restore staff is complex, and I may be 
wrong.
But the situation we are discussing sounds similar to what quit/restore
feature is designed to handle.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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>

Reply via email to