From: Sean Whitton Date: Thu, 12 Jun 2025 09:18:54 +0000 (+0100) Subject: Replace vc-async-checkin-backends with a backend properties function X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b848788a4807a02ce7727974720194d896404149;p=emacs.git Replace vc-async-checkin-backends with a backend properties function * lisp/vc/vc-git.el (vc-git-async-checkins): * lisp/vc/vc-hg.el (vc-hg-async-checkins): * lisp/vc/vc.el (vc-default-async-checkins): New functions. (vc-checkin): Use them. (vc-async-checkin-backends): Delete. (cherry picked from commit 932e413f8afb290fa38476b0f8a78c4073240ff5) --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index cc1e8a7f885..cb461efa763 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1141,6 +1141,8 @@ It is based on `log-edit-mode', and has Git-specific extensions." (file-local-name ,temp))) (delete-file ,temp)))) +(defalias 'vc-git-async-checkins #'always) + (defun vc-git-checkin (files comment &optional _rev) (let* ((parent (current-buffer)) (file1 (or (car files) default-directory)) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 31506ee6493..ff761f82535 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1183,6 +1183,8 @@ It is based on `log-edit-mode', and has Hg-specific extensions.") (autoload 'vc-wait-for-process-before-save "vc-dispatcher") +(defalias 'vc-hg-async-checkins #'always) + (defun vc-hg-checkin (files comment &optional _rev) "Hg-specific version of `vc-backend-checkin'. REV is ignored." diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 4e74b25ad07..504bc8b39f5 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -116,6 +116,11 @@ ;; Takes no arguments. Backends that return non-nil can update ;; buffers on `vc-retrieve-tag' based on user input. In this case ;; user will be prompted to update buffers on `vc-retrieve-tag'. +;; +;; - async-checkins +;; +;; Takes no arguments. Backends that return non-nil can (and do) +;; perform async checkins when `vc-async-checkin' is non-nil. ;; STATE-QUERYING FUNCTIONS ;; @@ -1031,9 +1036,6 @@ Not supported by all backends." :safe #'booleanp :version "31.1") -(defvar vc-async-checkin-backends '(Git Hg) - "Backends which support `vc-async-checkin'.") - (defmacro vc--with-backend-in-rootdir (desc &rest body) (declare (indent 1) (debug (sexp body))) ;; Intentionally capture `backend' and `rootdir': @@ -1907,6 +1909,8 @@ Type \\[vc-next-action] to check in changes.") (substitute-command-keys "Please explain why you stole the lock. Type \\`C-c C-c' when done")))) +(defalias 'vc-default-async-checkins #'ignore) + (defun vc-checkin (files backend &optional comment initial-contents rev patch-string register) "Check in FILES. @@ -1925,7 +1929,7 @@ registered the checkin will abort. Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'." (run-hooks 'vc-before-checkin-hook) (let ((do-async (and vc-async-checkin - (memq backend vc-async-checkin-backends)))) + (vc-call-backend backend 'async-checkins)))) (vc-start-logentry files comment initial-contents "Enter a change comment."