unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* shell-command-sentinel hook?
@ 2024-03-04 18:00 Christopher Howard
  2024-03-04 20:08 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Howard @ 2024-03-04 18:00 UTC (permalink / raw)
  To: Emacs Devel

Hi, I was just wondering if it would be difficult/problematic to patch simple.el to provide some kind of hook so that, when async shell commands complete, users can run arbitrary elisp? I imagine this would get inserted at the end of shell-command-sentinel...?

I've been getting in the habit lately of moving my activities out of Gnome console and instead running shell commands with async-shell-command. But something I miss is that Gnome console will send a notification at the end of the command which is very visible on the desktop. This can be reproduced in Emacs by adding " && notify-send \"some message\"" onto the end of the command. This works, and could be wrapped in various ways, but it would be nice if the exit code was passed on as well to the callback. I imagine other people would come up with various other creative uses of the hook, especially if we also passed in the command string to the callback.

Am running GNU Emacs 29.1.

-- 
📛 Christopher Howard
🚀 gemini://gem.librehacker.com
🌐 http://gem.librehacker.com

בראשית ברא אלהים את השמים ואת הארץ



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-06 16:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04 18:00 shell-command-sentinel hook? Christopher Howard
2024-03-04 20:08 ` Eli Zaretskii
2024-03-04 20:35   ` Christopher Howard
2024-03-06  4:30     ` Suhail Singh
2024-03-06 16:39       ` Christopher Howard

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).