summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2021-01-14 22:09:39 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2021-01-14 22:09:39 +0100
commit899e968ac9d2e5154ee7b8952398337b4b8009c7 (patch)
treeaebab693500ba8c2f9844268030b8dcb4e6a89be
parent605e9ed5b8c79cefbe4882504339a5ba1330e842 (diff)
downloaddotfiles-899e968ac9d2e5154ee7b8952398337b4b8009c7.tar.xz
Teach my/describe-revision to work with VC
This works with C-x v {l,h,g}.
-rw-r--r--.emacs7
1 files changed, 5 insertions, 2 deletions
diff --git a/.emacs b/.emacs
index 742f9f1..c1ad7a5 100644
--- a/.emacs
+++ b/.emacs
@@ -268,9 +268,12 @@
(defun my/revision-at-point ()
(cond
- ;; TODO: add vc support.
((derived-mode-p 'magit-mode)
- (magit-branch-or-commit-at-point))))
+ (magit-branch-or-commit-at-point))
+ ((derived-mode-p 'vc-git-log-view-mode)
+ (log-view-current-tag))
+ ((derived-mode-p 'vc-annotate-mode)
+ (car (vc-annotate-extract-revision-at-line)))))
(defun my/describe-revision (rev)
"Format a Git revision in a format suitable for changelogs."