From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=C3=93scar?= Fuentes Newsgroups: gmane.emacs.bugs Subject: bug#19043: 25.0.50; [PATCH]: faces for VC modeline state indicator Date: Thu, 13 Nov 2014 17:39:16 +0100 Message-ID: <87fvdnt5qj.fsf@telefonica.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1415896834 16625 80.91.229.3 (13 Nov 2014 16:40:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2014 16:40:34 +0000 (UTC) To: 19043@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 13 17:40:27 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XoxRV-00033n-Ut for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Nov 2014 17:40:22 +0100 Original-Received: from localhost ([::1]:60959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoxRV-000370-Ih for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Nov 2014 11:40:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoxRK-000367-Ju for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:40:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoxRD-0002nu-8d for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:40:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoxRD-0002nm-5b for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XoxRC-0001Zp-Rg for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C3=93scar?= Fuentes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Nov 2014 16:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19043 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14158967846027 (code B ref -1); Thu, 13 Nov 2014 16:40:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Nov 2014 16:39:44 +0000 Original-Received: from localhost ([127.0.0.1]:59572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XoxQt-0001Z8-Sj for submit@debbugs.gnu.org; Thu, 13 Nov 2014 11:39:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54028) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XoxQq-0001Yy-Ka for submit@debbugs.gnu.org; Thu, 13 Nov 2014 11:39:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoxQj-0002g7-5c for submit@debbugs.gnu.org; Thu, 13 Nov 2014 11:39:40 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoxQj-0002g2-2q for submit@debbugs.gnu.org; Thu, 13 Nov 2014 11:39:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoxQc-0002nq-Pe for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:39:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoxQW-0002bf-E9 for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:39:26 -0500 Original-Received: from smtp22.acens.net ([86.109.99.146]:65298 helo=smtp.movistar.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoxQW-0002as-4S for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2014 11:39:20 -0500 X-CTCH-RefID: str=0001.0A0B0208.5464DEB5.0224, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-Spam: Unknown Original-Received: from qcore (80.26.206.186) by smtp.movistar.es (8.6.122.03) (authenticated as 981711563$telefonica.net) id 545397C00075340E for bug-gnu-emacs@gnu.org; Thu, 13 Nov 2014 16:39:17 +0000 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95928 --=-=-= Content-Type: text/plain 2014-11-13 Oscar Fuentes Add faces for the VC modeline state indicator. * lisp/vc/vc-hooks.el: (vc-state-faces, vc-state-base-face) (vc-up-to-date-state, vc-needs-update-state) (vc-locked-state, vc-locally-added-state) (vc-conflict-state, vc-removed-state) (vc-missing-state, vc-edited-state): New faces. (vc-default-mode-line-string): Use them --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=vc-faces-upstream.patch diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index df660d1..6359e19 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -32,6 +32,69 @@ (eval-when-compile (require 'cl-lib)) +;; Faces + +(defgroup vc-state-faces nil + "Faces used in the mode line by the VC state indicator." + :group 'vc-faces + :group 'mode-line + :version "25.1") + +(defface vc-state-base-face + '((default :inherit mode-line)) + "Base face for VC state indicator." + :group 'vc-faces + :group 'mode-line + :version "25.1") + +(defface vc-up-to-date-state + '((default :inherit vc-state-base-face)) + "Face for VC modeline state when the file is up to date." + :version "25.1" + :group 'vc-faces) + +(defface vc-needs-update-state + '((default :inherit vc-state-base-face)) + "Face for VC modeline state when the file needs update." + :version "25.1" + :group 'vc-faces) + +(defface vc-locked-state + '((default :inherit vc-state-base-face)) + "Face for VC modeline state when the file locked." + :version "25.1" + :group 'vc-faces) + +(defface vc-locally-added-state + '((default :inherit vc-state-base-face)) + "Face for VC modeline state when the file is locally added." + :version "25.1" + :group 'vc-faces) + +(defface vc-conflict-state + '((default :inherit vc-state-base-face)) + "Face for VC modeline state when the file contains merge conflicts." + :version "25.1" + :group 'vc-faces) + +(defface vc-removed-state + '((default :inherit vc-state-base-face)) + "Face for VC modeline state when the file was removed from the VC system." + :version "25.1" + :group 'vc-faces) + +(defface vc-missing-state + '((default :inherit vc-state-base-face)) + "Face for VC modeline state when the file is missing from the file system." + :version "25.1" + :group 'vc-faces) + +(defface vc-edited-state + '((default :inherit vc-state-base-face)) + "Face for VC modeline state when the file is up to date." + :version "25.1" + :group 'vc-faces) + ;; Customization Variables (the rest is in vc.el) (defcustom vc-ignore-dir-regexp @@ -800,33 +863,42 @@ This function assumes that the file is registered." (let* ((backend-name (symbol-name backend)) (state (vc-state file backend)) (state-echo nil) + (face nil) (rev (vc-working-revision file backend))) (propertize (cond ((or (eq state 'up-to-date) (eq state 'needs-update)) (setq state-echo "Up to date file") + (setq face 'vc-up-to-date-state) (concat backend-name "-" rev)) ((stringp state) (setq state-echo (concat "File locked by" state)) + (setq face 'vc-locked-state) (concat backend-name ":" state ":" rev)) ((eq state 'added) (setq state-echo "Locally added file") + (setq face 'vc-locally-added-state) (concat backend-name "@" rev)) ((eq state 'conflict) (setq state-echo "File contains conflicts after the last merge") + (setq face 'vc-conflict-state) (concat backend-name "!" rev)) ((eq state 'removed) (setq state-echo "File removed from the VC system") + (setq face 'vc-removed-state) (concat backend-name "!" rev)) ((eq state 'missing) (setq state-echo "File tracked by the VC system, but missing from the file system") + (setq face 'vc-missing-state) (concat backend-name "?" rev)) (t ;; Not just for the 'edited state, but also a fallback ;; for all other states. Think about different symbols ;; for 'needs-update and 'needs-merge. (setq state-echo "Locally modified file") + (setq face 'vc-edited-state) (concat backend-name ":" rev))) + 'face face 'help-echo (concat state-echo " under the " backend-name " version control system")))) --=-=-=--