summaryrefslogtreecommitdiff
path: root/lisp/vc/vc-annotate.el
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2023-12-14 11:31:27 -0800
committerJim Porter <jporterbugs@gmail.com>2023-12-27 14:22:18 -0800
commitea4cbb3aae3c7f72ef04337bc2db7292909ca9a1 (patch)
tree9fed8a224f144f742bfb36df82a10e6f5a1a7fe5 /lisp/vc/vc-annotate.el
parent9e0eeb2d49ccd443bb667be9231fe932be67bb10 (diff)
downloademacs-ea4cbb3aae3c7f72ef04337bc2db7292909ca9a1.tar.gz
emacs-ea4cbb3aae3c7f72ef04337bc2db7292909ca9a1.tar.bz2
emacs-ea4cbb3aae3c7f72ef04337bc2db7292909ca9a1.zip
Abbreviate the VC revision in vc-annotate's buffer name
* lisp/vc/vc-hooks.el (vc-use-short-revision): New variable. (vc-short-revision): New function. * lisp/vc/vc-annotate.el (vc-annotate-use-short-revision): New option... (vc-annotate): ... use it. * lisp/vc/vc-git.el (vc-git--rev-parse): Consult 'vc-use-short-revision'. * etc/NEWS: Announce this change (bug#67062).
Diffstat (limited to 'lisp/vc/vc-annotate.el')
-rw-r--r--lisp/vc/vc-annotate.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index de6c3adbbdb..cfca7cbfac0 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -162,6 +162,11 @@ List of factors, used to expand/compress the time scale. See `vc-annotate'."
:type '(repeat number)
:group 'vc)
+(defcustom vc-annotate-use-short-revision t
+ "If non-nil, \\[vc-annotate] will use short revisions in its buffer name."
+ :type 'boolean
+ :group 'vc)
+
(defvar-keymap vc-annotate-mode-map
:doc "Local keymap used for VC-Annotate mode."
"a" #'vc-annotate-revision-previous-to-line
@@ -397,7 +402,10 @@ should be applied to the background or to the foreground."
(save-current-buffer
(vc-ensure-vc-buffer)
(list buffer-file-name
- (let ((def (vc-working-revision buffer-file-name)))
+ (let ((def (funcall (if vc-annotate-use-short-revision
+ #'vc-short-revision
+ #'vc-working-revision)
+ buffer-file-name)))
(if (null current-prefix-arg) def
(vc-read-revision
(format-prompt "Annotate from revision" def)