]> git.eshelyaron.com Git - emacs.git/commit
Resolve FIXME regarding running vc-checkin-hook
authorSean Whitton <spwhitton@spwhitton.name>
Mon, 7 Jul 2025 14:44:34 +0000 (15:44 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 07:48:40 +0000 (09:48 +0200)
commitf1124256ecd858897235cb1de0ca901a9b604690
treead9d682f2102f41063231703e0d4ae3e6bb9501a
parent33eb8323b5dae576c80d9a2139e5c3bd07515078
Resolve FIXME regarding running vc-checkin-hook

Running vc-checkin-hook needs to be delayed in the case of an
async checkin.  As a quick fix we had been relying on the
backend checkin functions to run the hook in the async case.
This restores handling running the hook in generic code even for
the async case.

* lisp/vc/vc.el (vc-checkin): Always pass vc-checkin-hook to
vc-start-logentry.  Return the result of calling the backend
'checkin-patch' or 'checkin' function to vc-finish-logentry.
* lisp/vc/vc-dispatcher.el (vc-finish-logentry): If the log
operation returns a cons of the form (async . #<process ...>),
use vc-exec-after to delay vc-resynch-buffer and hooks until the
async process completes.  Approach suggested by Dmitry Gutov.
* lisp/vc/vc-git.el (vc-git-checkin):
* lisp/vc/vc-hg.el (vc-hg-checkin): For an async checkin, return
a cons (async . #<process ...>) containing the async checkin
process.  No longer run vc-checkin-hook.

* lisp/vc/vc.el (with-vc-properties): Return the result of
evaluating FORM.
* lisp/vc/vc-dispatcher.el (vc-exec-after): Change to PROC's
buffer before calling vc-set-mode-line-busy-indicator.

(cherry picked from commit 6c0c985cee4e1ce4798a4ab192e8ca36013e7fa1)
lisp/vc/vc-dispatcher.el
lisp/vc/vc-git.el
lisp/vc/vc-hg.el
lisp/vc/vc.el