aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-04-05 10:58:35 +0800
committerSean Whitton2025-05-09 10:52:06 +0100
commit3739b86f5af654ec0ae3e47a3662e19ea79d2b3c (patch)
tree1e7ae024715a865edd758c3f0a5343e65b3724d5
parent004187350238a05a5c7f818c9feb648c792fe9db (diff)
downloademacs-3739b86f5af654ec0ae3e47a3662e19ea79d2b3c.tar.gz
emacs-3739b86f5af654ec0ae3e47a3662e19ea79d2b3c.zip
vc-exec-after: New PROC argument
* lisp/vc/vc-dispatcher.el (vc-exec-after): New PROC argument. * lisp/vc/vc-hg.el (vc-exec-after): Update declaration.
-rw-r--r--lisp/vc/vc-dispatcher.el17
-rw-r--r--lisp/vc/vc-hg.el2
2 files changed, 11 insertions, 8 deletions
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index 0a733336edd..a454a0bfc78 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -256,15 +256,18 @@ Another is that undo information is not kept."
256 'help-echo 256 'help-echo
257 "A command is in progress in this buffer")))) 257 "A command is in progress in this buffer"))))
258 258
259(defun vc-exec-after (code &optional success) 259(defun vc-exec-after (code &optional success proc)
260 "Eval CODE when the current buffer's process is done. 260 "Execute CODE when PROC, or the current buffer's process, is done.
261If the current buffer has no process, just evaluate CODE.
262Else, add CODE to the process' sentinel.
263CODE should be a function of no arguments. 261CODE should be a function of no arguments.
264 262
265If SUCCESS, it should be a process object. Only run CODE if the 263The optional PROC argument specifies the process Emacs should wait for
266SUCCESS process has a zero exit code." 264before executing CODE. It defaults to the current buffer's process.
267 (let ((proc (get-buffer-process (current-buffer)))) 265If PROC is nil and the current buffer has no process, just evaluate
266CODE. Otherwise, add CODE to the process's sentinel.
267
268If SUCCESS, it should be a process object.
269Only run CODE if the SUCCESS process has a zero exit code."
270 (let ((proc (or proc (get-buffer-process (current-buffer)))))
268 (cond 271 (cond
269 ;; If there's no background process, just execute the code. 272 ;; If there's no background process, just execute the code.
270 ;; We used to explicitly call delete-process on exited processes, 273 ;; We used to explicitly call delete-process on exited processes,
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index b7200da0914..a18c463c848 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -1381,7 +1381,7 @@ REV is the revision to check out into WORKFILE."
1381 1381
1382;; Follows vc-hg-command (or vc-do-async-command), which uses vc-do-command 1382;; Follows vc-hg-command (or vc-do-async-command), which uses vc-do-command
1383;; from vc-dispatcher. 1383;; from vc-dispatcher.
1384(declare-function vc-exec-after "vc-dispatcher" (code &optional success)) 1384(declare-function vc-exec-after "vc-dispatcher" (code &optional success proc))
1385;; Follows vc-exec-after. 1385;; Follows vc-exec-after.
1386(declare-function vc-set-async-update "vc-dispatcher" (process-buffer)) 1386(declare-function vc-set-async-update "vc-dispatcher" (process-buffer))
1387 1387