branch: elpa/aidermacs commit 3f366d166e8f131a237d83d62a60f67f466cd046 Merge: 54e7712f4e 6cef2b5861 Author: Matthew Zeng <matthew...@posteo.net> Commit: GitHub <nore...@github.com>
Merge pull request #69 from rjekker/before-run-backend-hook add hook to run before running backend --- aidermacs-backends.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aidermacs-backends.el b/aidermacs-backends.el index 2556c6e256..1ae21d19ef 100644 --- a/aidermacs-backends.el +++ b/aidermacs-backends.el @@ -54,6 +54,10 @@ Each entry is a cons cell (timestamp . output-text).") (defvar-local aidermacs--current-output "" "Accumulator for current output being captured as a string.") +(defcustom aidermacs-before-run-backend-hook nil + "Hook run before the aidermacs backend is startd." + :type 'hook) + (defun aidermacs-get-output-history (&optional limit) "Get the output history, optionally limited to LIMIT entries. LIMIT is the maximum number of entries to return. @@ -210,6 +214,7 @@ If there's a callback function, call it with the output." PROGRAM is the aidermacs executable path. ARGS are command line arguments. BUFFER-NAME is the name for the aidermacs buffer." (message "Running %s with %s" program args) + (run-hooks 'aidermacs-before-run-backend-hook) (cond ((eq aidermacs-backend 'vterm) (aidermacs-run-vterm program args buffer-name))