From 8945cf63f2fc16881b95ed5be209885b73b9449f Mon Sep 17 00:00:00 2001 Message-Id: <8945cf63f2fc16881b95ed5be209885b73b9449f.1613112064.git.info@protesilaos.com> From: Protesilaos Stavrou Date: Fri, 12 Feb 2021 08:40:33 +0200 Subject: [PATCH] Add shared keymap to Git VC dir "Branch" header * lisp/vc/vc-git.el (vc-git-branch-shared-map): Define new keymap. (vc-git-dir-extra-headers): Propertize header with new keymap. --- lisp/vc/vc-git.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 25ae26d746..030af2a379 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -656,6 +656,13 @@ vc-git-dir-status-files :files files :update-function update-function))) +(defvar vc-git-branch-shared-map + (let ((map (make-sparse-keymap))) + (define-key map "c" 'vc-create-tag) + (define-key map "l" 'vc-print-branch-log) + (define-key map "t" 'vc-retrieve-tag) + map)) + (defvar vc-git-stash-shared-map (let ((map (make-sparse-keymap))) (define-key map "S" 'vc-git-stash-snapshot) @@ -814,7 +821,8 @@ vc-git-dir-extra-headers (concat (propertize "Branch : " 'face 'vc-dir-header) (propertize branch - 'face 'vc-dir-header-value) + 'face 'vc-dir-header-value + 'keymap vc-git-branch-shared-map) (when remote-url (concat "\n" -- 2.30.0