From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Protesilaos Stavrou Newsgroups: gmane.emacs.bugs Subject: bug#46459: 28.0.50; Shared keymap for Git VC dir "Branch" header? Date: Fri, 12 Feb 2021 08:54:13 +0200 Message-ID: <87a6s94vze.fsf@protesilaos.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34386"; mail-complaints-to="usenet@ciao.gmane.io" To: 46459@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 12 07:56:20 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lASNI-0008qU-IG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Feb 2021 07:56:20 +0100 Original-Received: from localhost ([::1]:52654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lASNH-0000vw-Kv for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Feb 2021 01:56:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lASM2-000063-8l for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2021 01:55:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48247) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lASM2-0007Nk-1K for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2021 01:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lASM1-0003nj-Vm for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2021 01:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Protesilaos Stavrou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Feb 2021 06:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46459 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161311286714559 (code B ref -1); Fri, 12 Feb 2021 06:55:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Feb 2021 06:54:27 +0000 Original-Received: from localhost ([127.0.0.1]:59790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lASLS-0003mg-M8 for submit@debbugs.gnu.org; Fri, 12 Feb 2021 01:54:26 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:52190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lASLO-0003mU-HJ for submit@debbugs.gnu.org; Fri, 12 Feb 2021 01:54:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lASLO-0008Qx-8U for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2021 01:54:22 -0500 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:16871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lASLM-00073D-9D for bug-gnu-emacs@gnu.org; Fri, 12 Feb 2021 01:54:22 -0500 X-Originating-IP: 94.46.225.161 Original-Received: from kronos (unknown [94.46.225.161]) (Authenticated sender: public@protesilaos.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A5744240004 for ; Fri, 12 Feb 2021 06:54:16 +0000 (UTC) Received-SPF: none client-ip=217.70.183.193; envelope-from=info@protesilaos.com; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199841 Archived-At: --=-=-= Content-Type: text/plain Dear maintainers, In vc-git.el the header for vc-dir stashes is propertized with its own keymap. This means that while point is over the value of the "Stash:" header, the specified keymap comes into effect, instead of the main one for vc-dir. The latter takes effect when point is anywhere but that header's value. Should this principle be applied to the value of the "Branch" header as well? The attached patch is a proof-of-concept to that end. If you believe this is worth doing, what else do you think should go into such a patch from a usability standpoint? All the best, Protesilaos -- Protesilaos Stavrou protesilaos.com --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-shared-keymap-to-Git-VC-dir-Branch-header.patch >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 --=-=-=--