all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Howard <christopher@librehacker.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: shell-command-sentinel hook?
Date: Mon, 4 Mar 2024 09:00:11 -0900	[thread overview]
Message-ID: <ZeYMKxOddjQRX8WJ@theoden> (raw)

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

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



             reply	other threads:[~2024-03-04 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 18:00 Christopher Howard [this message]
2024-03-04 20:08 ` shell-command-sentinel hook? Eli Zaretskii
2024-03-04 20:35   ` Christopher Howard
2024-03-06  4:30     ` Suhail Singh
2024-03-06 16:39       ` Christopher Howard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZeYMKxOddjQRX8WJ@theoden \
    --to=christopher@librehacker.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.