From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#66464: Vc mode-line Date: Thu, 09 Nov 2023 18:41:22 +0200 Organization: LINKOV.NET Message-ID: <86ttpu98wd.fsf@mail.linkov.net> References: <86a5spm8be.fsf@mail.linkov.net> <86v8antf36.fsf@mail.linkov.net> 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="19925"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) To: 66464@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 09 17:44:51 2023 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 1r189D-00051a-Bd for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Nov 2023 17:44:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r188r-0000ze-IB; Thu, 09 Nov 2023 11:44:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r188o-0000yT-S6 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 11:44:26 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r188l-0000u4-B4 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 11:44:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r189O-00057r-48 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 11:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Nov 2023 16:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66464 X-GNU-PR-Package: emacs Original-Received: via spool by 66464-submit@debbugs.gnu.org id=B66464.169954828619660 (code B ref 66464); Thu, 09 Nov 2023 16:45:02 +0000 Original-Received: (at 66464) by debbugs.gnu.org; 9 Nov 2023 16:44:46 +0000 Original-Received: from localhost ([127.0.0.1]:48632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1897-000571-Mp for submit@debbugs.gnu.org; Thu, 09 Nov 2023 11:44:45 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:59581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1895-00056h-Mm; Thu, 09 Nov 2023 11:44:44 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 1B9DE4000E; Thu, 9 Nov 2023 16:43:56 +0000 (UTC) In-Reply-To: <86v8antf36.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 31 Oct 2023 09:40:13 +0200") X-GND-Sasl: juri@linkov.net 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274058 Archived-At: --=-=-= Content-Type: text/plain reopen 66464 thanks >> In order to prepare for making the vc mode-line more customizable, >> here is refactoring that helps to avoid code duplication in >> vc-hg-mode-line-string, and at the same time makes >> vc-git-mode-line-string less hackish while keeping it short. > > After more thinking I see no way to join project and vc > indicators on the mode line, so I'm closing this feature request. It would be a pity not to add this handy feature. So here is a small patch that joins the project name and vc status on the mode line: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-display-status-with-project.patch diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index c16fb63b2ff..63d7036f299 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -153,7 +153,9 @@ vc-follow-symlinks (defcustom vc-display-status t "If non-nil, display revision number and lock status in mode line. Otherwise, not displayed." - :type 'boolean + :type '(choice (const :tag "Show project name and status" with-project) + (const :tag "Show backend and status" t) + (const :tag "Show only backend name" nil)) :group 'vc) @@ -683,7 +685,9 @@ vc-mode-line (ml-echo (get-text-property 0 'help-echo ml-string))) (setq vc-mode (concat - " " + (unless (and (eq vc-display-status 'with-project) + (bound-and-true-p project-mode-line)) + " ") (propertize ml-string 'mouse-face 'mode-line-highlight diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 707fc7cfc07..0313f6ec827 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -423,7 +423,10 @@ vc-git-mode-line-string (rev (vc-working-revision file 'Git)) (disp-rev (or (vc-git--symbolic-ref file) (and rev (substring rev 0 7)))) - (state-string (concat backend-name indicator disp-rev))) + (state-string (concat (unless (and (eq vc-display-status 'with-project) + (bound-and-true-p project-mode-line)) + backend-name) + indicator disp-rev))) (propertize state-string 'face face 'help-echo (concat state-echo " under the " backend-name " version control system" --=-=-=--