Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential infinite recursion when calling emacs-everywhere-finish #70

Open
hanwenguo opened this issue Mar 25, 2023 · 1 comment
Open

Comments

@hanwenguo
Copy link
Contributor

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.

@hanwenguo
Copy link
Contributor Author

hanwenguo commented Mar 25, 2023

Here are some potential solutions:

  1. Since C-c C-c is usually used to finish editing emacs-everywhere buffers explicitly (as it is bound to emacs-everywhere-finish-or-ctrl-c-ctrl-c), it may not be necessary to add emacs-everywhere-finish to server-done-hook.

  2. Considering that some users might prefer to use C-x # instead of C-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 replace server-buffer-done with server-kill-buffer, which checks for potential infinite recursion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant