[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 8de5444df2 2/2: New hooks that run after opening a fi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 8de5444df2 2/2: New hooks that run after opening a file externally |
Date: |
Thu, 17 Nov 2022 23:59:12 -0500 (EST) |
branch: elpa/helm
commit 8de5444df2bafd1b3a91acd0e00cf1e0ee81682b
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
New hooks that run after opening a file externally
and when process finish.
---
helm-external.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/helm-external.el b/helm-external.el
index b7808361c2..13b29c11a2 100644
--- a/helm-external.el
+++ b/helm-external.el
@@ -53,6 +53,11 @@ Windows users should set that to \"explorer.exe\"."
:group 'helm-external
:type 'string)
+(defvar helm-open-file-externally-after-hook nil
+ "Hook that run after opening a file with external program.")
+
+(defvar helm-open-file-externally-after-finish-hook nil
+ "Hook that run after external program finish.")
;;; Internals
(defvar helm-external-command-history nil)
@@ -136,6 +141,7 @@ When argument DETACHED is non nil, detach process from
Emacs."
(when (and (string= event "finished\n")
helm-raise-command
(not (helm-get-pid-from-process-name proc-name)))
+ (run-hooks 'helm-open-file-externally-after-finish-hook)
(shell-command (format helm-raise-command "emacs")))
(message "%s process...Finished." process))))
;; Move command on top list.
@@ -205,6 +211,7 @@ to use."
(customize-save-variable 'helm-external-programs-associations
helm-external-programs-associations)))
(helm-run-or-raise program files)
+ (run-hooks 'helm-open-file-externally-after-hook)
(setq helm-external-command-history
(cl-loop for i in helm-external-command-history
when (executable-find i) collect i))))