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

Add variable to set process-query-on-exit-flag #189

Merged
merged 1 commit into from
Mar 23, 2024

Conversation

bcc32
Copy link
Contributor

@bcc32 bcc32 commented Mar 23, 2024

This can't reliably be done by the caller of async-start, because
make-process will create an extra process for the stderr buffer that
cannot be easily found based on the returned process from async-start.

The new variable, async-process-query-on-exit-flag, can be let-bound
to nil around a call to async-start in order to cause the parent Emacs
to silently kill the child Emacs if the user quits the parent.

This can be useful for async processes run in timers for things like
notifications, where the user doesn't really care if a running process
actually finishes, since they're killing Emacs.

@thierryvolpiatto
Copy link
Collaborator

thierryvolpiatto commented Mar 23, 2024 via email

@bcc32
Copy link
Contributor Author

bcc32 commented Mar 23, 2024

Emacs itself is a little confusing here; the basic primitive it exposes is set-process-query-on-exit-flag, but it provides :noquery in make-process to set the initial state of the flag. I sort of just arbitrarily picked a direction in this case (my initial version of this PR used set-process-query-on-exit-flag before I found out that :noquery exists), but would be happy to switch it if you think it makes more sense the other way.

@thierryvolpiatto
Copy link
Collaborator

thierryvolpiatto commented Mar 23, 2024 via email

This can't reliably be done by the caller of async-start, because
make-process will create an extra process for the stderr buffer that
cannot be easily found based on the returned process from async-start.

The new variable, async-process-noquery-on-exit, can be let-bound to
t around a call to async-start in order to cause the parent Emacs to
silently kill the child Emacs if the user quits the parent.

This can be useful for async processes run in timers for things like
notifications, where the user doesn't really care if a running process
actually finishes, since they're killing Emacs.
@bcc32 bcc32 force-pushed the process-query-on-exit-flag branch from 7c51e10 to 937e262 Compare March 23, 2024 18:27
@bcc32
Copy link
Contributor Author

bcc32 commented Mar 23, 2024

Sounds good, done!

@thierryvolpiatto thierryvolpiatto merged commit 72b70b0 into jwiegley:master Mar 23, 2024
20 of 24 checks passed
@thierryvolpiatto
Copy link
Collaborator

Great, thank you, merged!

@bcc32 bcc32 deleted the process-query-on-exit-flag branch March 23, 2024 20:24
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

Successfully merging this pull request may close these issues.

2 participants