Hi,I see no async-shell link and I propose the following one, see patch attached
To avoid any problem with copyright, yesterday I sent my copyright assignment FSF [1]
Cheers, pinmacs[1] email Subject: Pedro Vilchez Blanco; From: pinmacs; Date: 2025-05-23 19:22:02 (UTC)
From 5b365ea9d5a63c7bc9363e45feb269ff71f05e39 Mon Sep 17 00:00:00 2001 From: pinmacs <pinm...@cas.cat> Date: Fri, 23 May 2025 15:53:24 +0200 Subject: [PATCH] org-link: Add async-shell link * lisp/ol.el (org-link) renamed from org-link--open-shell to org-link--execute-shell-command added wrapper function org-link--open-shell added wrapper function org-link--open-async-shell added async-shell link --- etc/ORG-NEWS | 5 +++++ lisp/ol.el | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 62502a678..4cfd436d5 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -163,6 +163,11 @@ You can now create links to =shortdoc= documentation groups for Emacs Lisp functions (see =M-x shortdoc-display-group=). Requires Emacs 28 or newer. +*** =ol.el: New =async-shell= link type + +You can now create links to execute programs asynchronously. This +means Emacs will not freeze while waiting for the link to execute. + *** Some navigation commands can now be repeated When ~repeat-mode~ is turned on, the following navigation commands can diff --git a/lisp/ol.el b/lisp/ol.el index 5a87f6e5d..42538dc7e 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -2299,8 +2299,8 @@ string\"." (browse-url (concat scheme ":" url) arg)))) ;;;; "shell" link type -(defun org-link--open-shell (path _) - "Open a \"shell\" type link. +(defun org-link--execute-shell-command (path async) + "Open a \"shell\" or \"async-shell\" type link. PATH is the command to execute, as a string." (if (or (and (org-string-nw-p org-link-shell-skip-confirm-regexp) (string-match-p org-link-shell-skip-confirm-regexp path)) @@ -2317,7 +2317,16 @@ PATH is the command to execute, as a string." clean-buffer-list-kill-buffer-names)))) (user-error "Abort"))) +(defun org-link--open-shell (path _) + "Follow a \"shell\" link by running PATH synchronously." + (org-link--execute-shell-command path nil)) + +(defun org-link--open-async-shell (path _) + "Follow an \"async-shell\" link by running PATH asynchronously." + (org-link--execute-shell-command path t)) + (org-link-set-parameters "shell" :follow #'org-link--open-shell) +(org-link-set-parameters "async-shell" :follow #'org-link--open-async-shell) ;;; Interactive Functions -- 2.39.5
OpenPGP_0x9D64597C3A982DCA.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature