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 figure it would be best to store two window configuration, one for
> before and one for after moving to the note target.
>
> When the starting frame when pressing C-c C-z is the same as the one the
> note is taken in then the previous window configuration is restore,
> nothing else happens.
>
> If the starting and the note frame is different then the configuration
> from just before opening the note window is saved, i.e. from the frame
> the target org file is in and then the previous frame is activated with
> that previous's frame window configuration restored.
>
> I'm not sure if the starting frames window configuration has to be
> restored if it's not the org-note frame.
> ...
> +  (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.

Also, in the code above, I am not sure about setting
org-log-note-window-configuration. Does it try to handle a situation
when note buffer is raised in an existing, but different frame? My
imagination is that notes buffer is created in a new frame, but then the
expected behavior is killing the frame.

-- 
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