08.09.2020 15:03, Diego Zamboni wrote:

Doom Emacs has an 'org-capture' script that uses emacsclient to externally invoke a new frame with 'org-capture' in it. Maybe this could be a good starting point?

https://github.com/hlissner/doom-emacs/blob/develop/bin/org-capture

Thank you for the link. I have found it interesting due to I am unaware what is considered as best practices in relation to invoking of emacsclient.

Though I am a bit lazy to try doom-emacs just now. Does the script works correctly if emacs server is already running but with no frames at the moment of script execution?

A couple of things I have noticed in the script:
- Systemd service file in emacs stops server without redefining of kill-emacs-hook. - Despite it was not exactly the same problem, cleanup in shell script after completion of a child process was discussed in [1]. Some subtle aspects are better highlighted in the non-top rated answer. I suspect, in the case of emacs races might happen in different places.

[1] https://unix.stackexchange.com/a/444676 "Forward SIGTERM to child in Bash"


Reply via email to