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#46358: 28.0.50; [PATCH] Add vc-dir faces; also apply them to vc-git Date: Tue, 09 Feb 2021 07:01:00 +0200 Message-ID: <87h7mlu96b.fsf@protesilaos.com> References: <87czxc5cku.fsf@protesilaos.com> <83tuqnnc3s.fsf@gnu.org> <87pn1b4zxp.fsf@protesilaos.com> <87zh0eo6uk.fsf@protesilaos.com> <8f588591-bef5-3e8e-816e-d9ae3658eca1@yandex.ru> 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="39790"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46358@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 09 06:02:16 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 1l9LAF-000AEM-Fd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 06:02:15 +0100 Original-Received: from localhost ([::1]:52580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9LAD-0007mH-Tz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Feb 2021 00:02:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9LA2-0007m8-3V for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 00:02:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9LA1-00063L-Sf for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 00:02:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l9LA1-0004jy-Q1 for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 00:02: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: Tue, 09 Feb 2021 05:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46358 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 46358-submit@debbugs.gnu.org id=B46358.161284687518165 (code B ref 46358); Tue, 09 Feb 2021 05:02:01 +0000 Original-Received: (at 46358) by debbugs.gnu.org; 9 Feb 2021 05:01:15 +0000 Original-Received: from localhost ([127.0.0.1]:52361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9L9G-0004iv-Qg for submit@debbugs.gnu.org; Tue, 09 Feb 2021 00:01:15 -0500 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:44077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9L9D-0004ie-1C for 46358@debbugs.gnu.org; Tue, 09 Feb 2021 00:01:13 -0500 X-Originating-IP: 94.46.225.161 Original-Received: from kronos (unknown [94.46.225.161]) (Authenticated sender: public@protesilaos.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 8424FE0004; Tue, 9 Feb 2021 05:01:03 +0000 (UTC) In-Reply-To: <8f588591-bef5-3e8e-816e-d9ae3658eca1@yandex.ru> (Dmitry Gutov's message of "Tue, 9 Feb 2021 01:33:44 +0200") 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:199653 Archived-At: --=-=-= Content-Type: text/plain On 2021-02-09, 01:33 +0200, Dmitry Gutov wrote: > On 08.02.2021 18:35, Protesilaos Stavrou wrote: >> On 2021-02-08, 17:54 +0200, Dmitry Gutov wrote: >>> Some questions: >>> >>> - vc-dir-ignored face doesn't seem to be used the 'ignored' entries in >>> the list. Wasn't that its main point? >> Can you please specify which are those? >> I only applied the 'vc-dir-ignored' face to the empty Git stash and >> only >> did so because there was a "FIXME" for it. Otherwise, yes, the new face >> should be used wherever it makes sense. > > The 'ignored' files in the vc-dir tree. > > To see one, edit some file that has a matching entry in .gitignore (such > as ChangeLog in a Emacs repo checkout). You should see it in VC-Dir > buffer now, with status 'ignored'. Please see the attached patch (unless you want me to open a new bug report). This should now account for the ignored state. It also edits a face that I had missed earlier, as was discussed herein. >> As for its default value, I was not sure what those other states were, >> so I just used 'vc-dir-header-value', thinking that this is a neutral >> value. > > All possible states are listed in the docstring for 'vc-state'. > > About half of them (almost) are pretty rare, though. > >> Should the default look like "edited" as well? Or does it have some >> other meaning? If the latter, then maybe we must have extra face? > > I don't have a strong opinion on this right now. But we should be > consistent between the 'default' version and the backend-specific > versions of the method. > > Having a face per status might be too much both for the user and the > theme authors, though (who will have to pick appropriate colors). > > So I would keep the number of faces at 4: up-to-date, warning, ignored > and edited. I also think that 4 faces should suffice. Having checked the doc string of 'vc-state' this is how I feel they should be organised. | status | face ("?" means suggestion) | |------------------+-----------------------------| | up-to-date | vc-dir-status-up-to-date | | edited | vc-dir-status-edited | | USER | vc-dir-status-warning? | | needs-update | vc-dir-status-warning? | | unlocked-changes | vc-dir-status-warning? | | added | vc-dir-status-edited | | removed | vc-dir-status-edited | | conflict | vc-dir-status-warning | | missing | vc-dir-status-warning | | ignored | vc-dir-ignored | | unregistered | vc-dir-status-edited | With regard to 'vc-dir-ignored', do you think we should rename it to 'vc-dir-status-ignored' for the sake of consistency? I wrote it that way to denote that it is more generic than those that apply to files, but I am okay either way. -- Protesilaos Stavrou protesilaos.com --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Refine-use-of-new-vc-dir-faces.patch >From 887b3333d09a93446dd7bd478e4e877df2884bd7 Mon Sep 17 00:00:00 2001 Message-Id: <887b3333d09a93446dd7bd478e4e877df2884bd7.1612846159.git.info@protesilaos.com> From: Protesilaos Stavrou Date: Tue, 9 Feb 2021 06:49:05 +0200 Subject: [PATCH] Refine use of new vc-dir faces * lisp/vc/vc-dir.el (vc-default-dir-printer): Apply check for the "ignored" status and make 'vc-dir-status-edited' the default face. * lisp/vc/vc-git.el (vc-git-dir-printer): Use the same conditions for the Git backend. This follows from the discussion in bug#46358. --- lisp/vc/vc-dir.el | 4 ++-- lisp/vc/vc-git.el | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 14c81578b7..6aebd1b2e0 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1456,8 +1456,8 @@ vc-default-dir-printer (format "%-20s" state) 'face (cond ((eq state 'up-to-date) 'vc-dir-status-up-to-date) ((memq state '(missing conflict)) 'vc-dir-status-warning) - ((eq state 'edited) 'font-lock-constant-face) - (t 'vc-dir-header-value)) + ((eq state 'ignored) 'vc-dir-ignored) + (t 'vc-dir-status-edited)) 'mouse-face 'highlight 'keymap vc-dir-status-mouse-map) " " diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index e7306386fe..18c5432ad9 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -479,7 +479,8 @@ vc-git-dir-printer (propertize (format "%-12s" state) 'face (cond ((eq state 'up-to-date) 'vc-dir-status-up-to-date) - ((eq state '(missing conflict)) 'vc-dir-status-warning) + ((memq state '(missing conflict)) 'vc-dir-status-warning) + ((eq state 'ignored) 'vc-dir-ignored) (t 'vc-dir-status-edited)) 'mouse-face 'highlight 'keymap vc-dir-status-mouse-map) -- 2.30.0 --=-=-=--