emacs-everywhere
emacs-everywhere copied to clipboard
Potential infinite recursion when calling `emacs-everywhere-finish`
I have noticed that the emacs-everywhere-finish function contains a call to server-buffer-done
, which is added to server-done-hook
. However, server-buffer-done
executes (run-hooks 'server-done-hook)
before performing the actual killing. While I'm not very familiar with Emacs Lisp, I'm not sure if there's a mechanism to prevent infinite recursion, and if there isn't this could potentially cause issues.
Here are some potential solutions:
-
Since
C-c C-c
is usually used to finish editing emacs-everywhere buffers explicitly (as it is bound toemacs-everywhere-finish-or-ctrl-c-ctrl-c
), it may not be necessary to addemacs-everywhere-finish
toserver-done-hook
. -
Considering that some users might prefer to use
C-x #
instead ofC-c C-c
, and the content of emacs-everywhere buffers usually doesn't need to be saved (as it would already be copied to the clipboard), it might be a good idea to replaceserver-buffer-done
withserver-kill-buffer
, which checks for potential infinite recursion.