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

Expose environment function should_quit #18

Open
hpdeifel opened this issue Jul 25, 2019 · 0 comments
Open

Expose environment function should_quit #18

hpdeifel opened this issue Jul 25, 2019 · 0 comments

Comments

@hpdeifel
Copy link

This is useful to check if the user pressed C-g during a long running computation. From the documentation:

If your module includes potentially long-running code, it is a good
idea to check from time to time in that code whether the user wants to
quit, e.g., by typing ‘C-g’ (*note Quitting::). The following function,
which is available since Emacs 26.1, is provided for that purpose.

-- Function: bool should_quit (emacs_env *ENV)
This function returns ‘true’ if the user wants to quit. In that
case, we recommend that your module function aborts any on-going
processing and returns as soon as possible.

Notice that this is only available since Emacs 26.1, so some runtime check for the Emacs version would probably be needed.

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

No branches or pull requests

2 participants