diff options
| author | Charles A. Roelli | 2018-10-08 21:49:41 +0200 |
|---|---|---|
| committer | Charles A. Roelli | 2018-10-08 21:49:41 +0200 |
| commit | 763721613bd478396dec11c8ccf145927ae70a48 (patch) | |
| tree | 8851252dcb6ab27a0b9867909022d5b791715d56 | |
| parent | a0605d96187bc4103a982cededcd12e2628aba66 (diff) | |
| download | emacs-763721613bd478396dec11c8ccf145927ae70a48.tar.gz emacs-763721613bd478396dec11c8ccf145927ae70a48.zip | |
New hook 'vc-retrieve-tag-hook' (Bug#32754)
* 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.
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 11 |
2 files changed, 12 insertions, 1 deletions
| @@ -329,6 +329,8 @@ git-grep when 'vc-git-grep' is used. | |||
| 329 | When some files are marked, only those are stashed. | 329 | When some files are marked, only those are stashed. |
| 330 | When no files are marked, all modified files are stashed, as before. | 330 | When no files are marked, all modified files are stashed, as before. |
| 331 | 331 | ||
| 332 | *** The new hook 'vc-retrieve-tag-hook' runs after retrieving a tag. | ||
| 333 | |||
| 332 | ** diff-mode | 334 | ** diff-mode |
| 333 | *** Hunks are now automatically refined by default. | 335 | *** Hunks are now automatically refined by default. |
| 334 | To disable it, set the new defcustom 'diff-font-lock-refine' to nil. | 336 | To disable it, set the new defcustom 'diff-font-lock-refine' to nil. |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 6962664d59f..7707999636a 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -834,6 +834,13 @@ See `run-hooks'." | |||
| 834 | :type 'hook | 834 | :type 'hook |
| 835 | :group 'vc) | 835 | :group 'vc) |
| 836 | 836 | ||
| 837 | ;;;###autoload | ||
| 838 | (defcustom vc-retrieve-tag-hook nil | ||
| 839 | "Normal hook (list of functions) run after retrieving a tag." | ||
| 840 | :type 'hook | ||
| 841 | :group 'vc | ||
| 842 | :version "27.1") | ||
| 843 | |||
| 837 | (defcustom vc-revert-show-diff t | 844 | (defcustom vc-revert-show-diff t |
| 838 | "If non-nil, `vc-revert' shows a `vc-diff' buffer before querying." | 845 | "If non-nil, `vc-revert' shows a `vc-diff' buffer before querying." |
| 839 | :type 'boolean | 846 | :type 'boolean |
| @@ -2153,7 +2160,8 @@ otherwise use the repository root of the current buffer. | |||
| 2153 | If NAME is empty, it refers to the latest revisions of the current branch. | 2160 | If NAME is empty, it refers to the latest revisions of the current branch. |
| 2154 | If locking is used for the files in DIR, then there must not be any | 2161 | If locking is used for the files in DIR, then there must not be any |
| 2155 | locked files at or below DIR (but if NAME is empty, locked files are | 2162 | locked files at or below DIR (but if NAME is empty, locked files are |
| 2156 | allowed and simply skipped)." | 2163 | allowed and simply skipped). |
| 2164 | This function runs the hook `vc-retrieve-tag-hook' when finished." | ||
| 2157 | (interactive | 2165 | (interactive |
| 2158 | (let* ((granularity | 2166 | (let* ((granularity |
| 2159 | (vc-call-backend (vc-responsible-backend default-directory) | 2167 | (vc-call-backend (vc-responsible-backend default-directory) |
| @@ -2180,6 +2188,7 @@ allowed and simply skipped)." | |||
| 2180 | (vc-call-backend (vc-responsible-backend dir) | 2188 | (vc-call-backend (vc-responsible-backend dir) |
| 2181 | 'retrieve-tag dir name update) | 2189 | 'retrieve-tag dir name update) |
| 2182 | (vc-resynch-buffer dir t t t) | 2190 | (vc-resynch-buffer dir t t t) |
| 2191 | (run-hooks 'vc-retrieve-tag-hook) | ||
| 2183 | (message "%s" (concat msg "done")))) | 2192 | (message "%s" (concat msg "done")))) |
| 2184 | 2193 | ||
| 2185 | 2194 | ||