]> git.eshelyaron.com Git - emacs.git/commitdiff
New hook 'vc-retrieve-tag-hook' (Bug#32754)
authorCharles A. Roelli <charles@aurox.ch>
Mon, 8 Oct 2018 19:49:41 +0000 (21:49 +0200)
committerCharles A. Roelli <charles@aurox.ch>
Mon, 8 Oct 2018 19:49:41 +0000 (21:49 +0200)
* etc/NEWS: Mention the new variable.

* lisp/vc/vc.el (vc-retrieve-tag-hook): New hook.
(vc-retrieve-tag): Run the new hook and update its
documentation string.

etc/NEWS
lisp/vc/vc.el

index 020450c95705684d130fc5b4196948d83dbdbc97..ee74e86f40faae0b6cb414cba55b7c20ef926bb5 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -329,6 +329,8 @@ git-grep when 'vc-git-grep' is used.
 When some files are marked, only those are stashed.
 When no files are marked, all modified files are stashed, as before.
 
+*** The new hook 'vc-retrieve-tag-hook' runs after retrieving a tag.
+
 ** diff-mode
 *** Hunks are now automatically refined by default.
 To disable it, set the new defcustom 'diff-font-lock-refine' to nil.
index 6962664d59f905bfbb70dda685049708dd4d0d0d..7707999636a9793f15d5572a9e1d7b34bac1a388 100644 (file)
@@ -834,6 +834,13 @@ See `run-hooks'."
   :type 'hook
   :group 'vc)
 
+;;;###autoload
+(defcustom vc-retrieve-tag-hook nil
+  "Normal hook (list of functions) run after retrieving a tag."
+  :type 'hook
+  :group 'vc
+  :version "27.1")
+
 (defcustom vc-revert-show-diff t
   "If non-nil, `vc-revert' shows a `vc-diff' buffer before querying."
   :type 'boolean
@@ -2153,7 +2160,8 @@ otherwise use the repository root of the current buffer.
 If NAME is empty, it refers to the latest revisions of the current branch.
 If locking is used for the files in DIR, then there must not be any
 locked files at or below DIR (but if NAME is empty, locked files are
-allowed and simply skipped)."
+allowed and simply skipped).
+This function runs the hook `vc-retrieve-tag-hook' when finished."
   (interactive
    (let* ((granularity
            (vc-call-backend (vc-responsible-backend default-directory)
@@ -2180,6 +2188,7 @@ allowed and simply skipped)."
     (vc-call-backend (vc-responsible-backend dir)
                     'retrieve-tag dir name update)
     (vc-resynch-buffer dir t t t)
+    (run-hooks 'vc-retrieve-tag-hook)
     (message "%s" (concat msg "done"))))