From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Howard Newsgroups: gmane.emacs.devel Subject: shell-command-sentinel hook? Date: Mon, 4 Mar 2024 09:00:11 -0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12952"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 04 19:01:25 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rhCcv-0003F7-Qe for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Mar 2024 19:01:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhCc9-0007BX-6K; Mon, 04 Mar 2024 13:00:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhCc6-0007Ah-8I for emacs-devel@gnu.org; Mon, 04 Mar 2024 13:00:34 -0500 Original-Received: from mx.kolabnow.com ([212.103.80.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhCc4-0005lp-CA for emacs-devel@gnu.org; Mon, 04 Mar 2024 13:00:33 -0500 Original-Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 25C412096F19 for ; Mon, 4 Mar 2024 19:00:20 +0100 (CET) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-disposition:content-type :content-type:mime-version:message-id:subject:subject:from:from :date:date:received:received:received; s=dkim20160331; t= 1709575216; x=1711389617; bh=e/OyC2DwL9YmBEl5oh8Loe2LOL3ygvzYVRx UTty7ur8=; b=wBbxoPCxyXv9sLRzsNZSq7+pviMqqC7rfUh+Oe2n9fAYKEosQrP YgnnzpYlN5F9HLA6UQ5nnyDWdSXtctQf8HIUplbpM27vZE0FNFGWssAKkfMU66nw FtKtqmePS6VRKDQ4w3q9FgnsCcrQ/OOBtcjUTv8m0lr/KzxUqXM+qSN9qAQoNVAq 4R/qmQYc50/iVKZCH7Vy1vTtKPSFZS5socTGvL0te0HOZ91zKp61zUBBQAVA2Cne V7e0N1oxGV7w0/1cg8J7E7OBUj+vXMnGx8Fzed+yGGtHMX3nvD+KQHybsDA2uTQJ O8prnnB5MfRzf7Kaa4BsnGC3eMt21qeWACoXeySf0VPIcerevir+Vh7wDnSlzR+M AgQkOzk2sOgLcgCh+bLQR2s1YXojuuJvsT26z8sN/5pAwFzkkECGu7cK71wZRPgi ezuLklCVf49FsgFta9b2LDZS+z/ddndEUlnhSrtseAX1Bv5ppfsfi02V3bgvMo/3 F7NwdNDtAczm4tkn4CDNDKXbTHOiiyNx42kEjj/ty7jV9C1e X-Virus-Scanned: amavis at mykolab.com Original-Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id whoCns-iCldF for ; Mon, 4 Mar 2024 19:00:16 +0100 (CET) Original-Received: from int-mx011.mykolab.com (unknown [10.9.13.11]) by mx.kolabnow.com (Postfix) with ESMTPS id A7B9A20AB2FA for ; Mon, 4 Mar 2024 19:00:16 +0100 (CET) Original-Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx011.mykolab.com (Postfix) with ESMTPS id 2350D30C184B for ; Mon, 4 Mar 2024 19:00:16 +0100 (CET) Content-Disposition: inline Autocrypt: addr=christopher@librehacker.com; prefer-encrypt=mutual; keydata= mDMEZEqk5BYJKwYBBAHaRw8BAQdAE/Dh4NUrMO5mxlZwV1H0X6DKaISWC/G5ws7voqpK6Xa0MEN ocmlzdG9waGVyIEhvd2FyZCA8Y2hyaXN0b3BoZXJAbGlicmVoYWNrZXIuY29tPoiQBBMWCAA4Fi EEMeL/OZnSMyOqPiAnGsX8bo2P8gwFAmRKpOQCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AAC gkQGsX8bo2P8gxyYgEA/ioHjyd0Bm3+YyW/vOLJZkDg1xx//zN9803Oayahz/gBAKwtHu69sqFZ /upw6mmyeP7ZndriTijMBZwfzcqDQWIMuDgEZEqk5RIKKwYBBAGXVQEFAQEHQO2aMfukvGwfyK7 f6DUkayD6h+RO+n6LGg0c0StFhF1CAwEIB4h4BBgWCAAgFiEEMeL/OZnSMyOqPiAnGsX8bo2P8g wFAmRKpOUCGwwACgkQGsX8bo2P8gxD6AEAncJh7NhGGBlNG43b5rMeeyrYVewJirj4hk2qk1iL3 KgA/301OIl9HuuM1hBLPOSTftjwKJUWDbzBFqbyGUFWaCUB Received-SPF: none client-ip=212.103.80.155; envelope-from=christopher@librehacker.com; helo=mx.kolabnow.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316807 Archived-At: 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 讘专讗砖讬转 讘专讗 讗诇讛讬诐 讗转 讛砖诪讬诐 讜讗转 讛讗专抓