From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: VC registered, but ignored Date: Thu, 31 Aug 2023 18:24:40 +0300 Message-ID: <83pm33ck07.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6288"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 31 17:26:00 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qbjYW-0001P0-22 for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Aug 2023 17:26:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbjXk-0001Zu-2l; Thu, 31 Aug 2023 11:25:13 -0400 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 1qbjXc-0001YZ-L9 for emacs-devel@gnu.org; Thu, 31 Aug 2023 11:25:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbjXa-0000i5-My; Thu, 31 Aug 2023 11:25:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=NaptbgiaoQNCTvAomUW9BJNaa0bOiOmzzkzpZjsR47o=; b=aJ+F2tH7mF2ImD yn3avzmIuVQ7Yd8i9DTXIPBE78z8BHUG5mb3MBYkwhgQd4GTQVH6PTNvLpWU7WF6S9lJ3B8hj4wcq HC+21Fo5X8xPxpo9omJX4QdikUtpVnSDkdiTTDSzg0nPf2cfG0qdy78RkJ0lGm1Oz5/7Bi8bBcf93 LvdgXUpQsV2+4W4GNXZJp8tqcpywIR7vCwNhrQk5r+X8Smng4DOiuH783nOw+IkbKxCd6JfHa+Ihf SztUj+sCEvO+etY0Gh4qABUmhnNolvtK0/N9at65MhafB6k6aLAKCXfKucbZW4fdJ7J+gFS6jYISB FUL7PeU9KqT7eTZwUwYg==; X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309673 Archived-At: In a repository where *.txt files are ignored, I added to VC a file with the .txt extension, and was surprised to see the ':' indicator on the mode line although the file was up-to-date. Moreover, the tooltip said the file was "locally modified". That had me puzzled for a few minutes, until I saw the code in vc-hooks.el. So WDYT about the change below? diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index e75165e..a4de0a6 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -87,6 +87,11 @@ vc-edited-state "Face for VC modeline state when the file is edited." :version "25.1") +(defface vc-ignored-state + '((default :inherit vc-state-base)) + "Face for VC modeline state when the file is registered, but ignored." + :version "30.1") + ;; Customization Variables (the rest is in vc.el) (defcustom vc-ignore-dir-regexp @@ -743,6 +748,10 @@ vc-default-mode-line-string (setq state-echo "File tracked by the VC system, but missing from the file system") (setq face 'vc-missing-state) (concat backend-name "?" rev)) + ((eq state 'ignored) + (setq state-echo "File tracked by the VC system, but ignored") + (setq face 'vc-ignored-state) + (concat backend-name "!" rev)) (t ;; Not just for the 'edited state, but also a fallback ;; for all other states. Think about different symbols