From 1a1f93eaf81f640c31e66fc243ffab1c04fa9a87 Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Mon, 15 Aug 2016 15:17:42 +1700 Subject: [PATCH] [PATCH] emacs: make the remaining faces configurable. --- c4/b96327256571099367b431a8da2e534dec14fb | 172 ++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 c4/b96327256571099367b431a8da2e534dec14fb diff --git a/c4/b96327256571099367b431a8da2e534dec14fb b/c4/b96327256571099367b431a8da2e534dec14fb new file mode 100644 index 000000000..290e185f3 --- /dev/null +++ b/c4/b96327256571099367b431a8da2e534dec14fb @@ -0,0 +1,172 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 5E9F96DE76E6 + for ; Sun, 14 Aug 2016 15:41:28 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.925 +X-Spam-Level: +X-Spam-Status: No, score=-0.925 tagged_above=-999 required=5 tests=[AWL=0.097, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.211, SPF_PASS=-0.001, + T_RP_MATCHES_RCVD=-0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id jhDSW5u-ZJs3 for ; + Sun, 14 Aug 2016 15:41:19 -0700 (PDT) +Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com + [209.85.192.181]) + by arlo.cworth.org (Postfix) with ESMTPS id 3A6E16DE89A0 + for ; Sun, 14 Aug 2016 15:17:50 -0700 (PDT) +Received: by mail-pf0-f181.google.com with SMTP id y134so11665500pfg.0 + for ; Sun, 14 Aug 2016 15:17:50 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; + s=20120113; h=from:to:cc:subject:date:message-id; + bh=d3m6bSNvBaaC7UIdSYsFnkRrX8YwzdOJBbcL/wEu7Cs=; + b=B6O09nn4VowMoCmC95VvMf/xieQ4YOa+Z9F1hAu7bAK2qC/XXO1tQJpwvOLRR/1yz+ + GzArbPcxjlRmpIc8yIXYgqyAvOpxjE4FrjUDXEDUl4fipIR01cToFDb47b5y+r9kQxIc + PnJvgBoWZf4NI71b3EXVllvQB696K1kAT01ztuEp3cmIy3QKnBWgX1R7GyYPhjqRke7t + JS1jPKO6unioKxf6lfl62p1tj+N+fcsxIZJ+HkfNxd85gptDREJB/wdPHjb7o0PRRoHI + tqGMzzdoz112+V4bxbq/wwm3/QvT9RS1AS/10kA1UltJsWWr5bnE8IB7PdQVBauxAc9R BpjA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=d3m6bSNvBaaC7UIdSYsFnkRrX8YwzdOJBbcL/wEu7Cs=; + b=FUN8dczE88gFJ9zT7+L9EUbBPgzJbYKwmMTtF/ThwiqJJDGst2JjFZ+mk0/JC3s0Gv + HTLC8ZKXaHawhvtL3aqQuWzGDX05jO12No41GPTrB2JqBfyyVuPlBbTuEZmMyZaBsCbd + qlhvmruRXER5M0IPkptjyHZAcjS3POqikxS+yME+IxT6IPidCEw7c+FXKaktSmPS6YPS + NMaBOClgS6roienGGdKPkh311/vTR6LEZoEMMzWFCkTbufs5bIMSWqp9ZmlWYqoL/shA + 0R24Hn93S83s5j0akpbmxc380p9CpeDkcwUBqJ9g4woe6Lfk/1YAUuQPoNMeGsRBvc/0 + bgOg== +X-Gm-Message-State: + AEkoouvle1cgAB6v0AXo9Hfdg98DltkYTRiOq/KRNBzVRCc00QUbEX6NGTQbexJ1NRRiCp5r +X-Received: by 10.98.51.131 with SMTP id z125mr48550084pfz.109.1471213068252; + Sun, 14 Aug 2016 15:17:48 -0700 (PDT) +Received: from marmstrong-linux.kir.corp.google.com ([100.119.200.73]) + by smtp.gmail.com with ESMTPSA id r2sm27996878pal.14.2016.08.14.15.17.46 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); + Sun, 14 Aug 2016 15:17:47 -0700 (PDT) +From: Matt Armstrong +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: make the remaining faces configurable. +Date: Sun, 14 Aug 2016 15:17:42 -0700 +Message-Id: <1471213062-13610-1-git-send-email-marmstrong@google.com> +X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 14 Aug 2016 22:41:28 -0000 + +I believe this moves all "anonymous" face specifications in notmuch +code into a configurable defface. +--- + NEWS | 8 ++++---- + emacs/notmuch-tag.el | 45 ++++++++++++++++++++++++++++++++++----------- + 2 files changed, 38 insertions(+), 15 deletions(-) + +diff --git a/NEWS b/NEWS +index 3a9c8d3..2ff78e9 100644 +--- a/NEWS ++++ b/NEWS +@@ -6,10 +6,10 @@ Emacs + + Face customization is easier + +- New faces `notmuch-search-flagged-face` and +- `notmuch-search-unread-face` are used by default by +- `notmuch-search-line-faces`. Customize `notmuch-faces` to modify +- them. ++ New faces `notmuch-tag-unread`, `notmuch-tag-flagged`, ++ `notmuch-tag-deleted`, `notmuch-tag-added`, ++ `notmuch-search-flagged-face` and `notmuch-search-unread-face` are ++ now used by default. Customize `notmuch-faces` to modify them. + + Ruby Bindings + ------------- +diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el +index a3f0c52..ec3c964 100644 +--- a/emacs/notmuch-tag.el ++++ b/emacs/notmuch-tag.el +@@ -56,9 +56,23 @@ + (string :tag "Custom"))) + (sexp :tag "Custom"))))) + ++(defface notmuch-tag-unread ++ '((t :foreground "red")) ++ "Default face used for the unread tag. ++ ++Used in the default value of `notmuch-tag-formats`." ++ :group 'notmuch-faces) ++ ++(defface notmuch-tag-flagged ++ '((t :foreground "blue")) ++ "Face used for the flagged tag. ++ ++Used in the default value of `notmuch-tag-formats`." ++ :group 'notmuch-faces) ++ + (defcustom notmuch-tag-formats +- '(("unread" (propertize tag 'face '(:foreground "red"))) +- ("flagged" (propertize tag 'face '(:foreground "blue")) ++ '(("unread" (propertize tag 'face 'notmuch-tag-unread)) ++ ("flagged" (propertize tag 'face 'notmuch-tag-flagged) + (notmuch-tag-format-image-data tag (notmuch-tag-star-icon)))) + "Custom formats for individual tags. + +@@ -90,15 +104,17 @@ with images." + :group 'notmuch-faces + :type 'notmuch-tag-format-type) + ++(defface notmuch-tag-deleted ++ '((((class color) (supports :strike-through)) :strike-through "red") ++ (t :inverse-video t)) ++ "Face used to display deleted tags. ++ ++Used in the default value of `notmuch-tag-deleted-formats`." ++ :group 'notmuch-faces) ++ + (defcustom notmuch-tag-deleted-formats +- '(("unread" (notmuch-apply-face bare-tag +- (if (display-supports-face-attributes-p '(:strike-through "red")) +- '(:strike-through "red") +- '(:inverse-video t)))) +- (".*" (notmuch-apply-face tag +- (if (display-supports-face-attributes-p '(:strike-through "red")) +- '(:strike-through "red") +- '(:inverse-video t))))) ++ '(("unread" (notmuch-apply-face bare-tag `notmuch-tag-deleted)) ++ (".*" (notmuch-apply-face tag `notmuch-tag-deleted))) + "Custom formats for tags when deleted. + + For deleted tags the formats in `notmuch-tag-formats` are applied +@@ -118,8 +134,15 @@ See `notmuch-tag-formats' for full documentation." + :group 'notmuch-faces + :type 'notmuch-tag-format-type) + ++(defface notmuch-tag-added ++ '((t :underline "green")) ++ "Default face used for added tags. ++ ++Used in the default value for `notmuch-tag-added-formats`." ++ :group 'notmuch-faces) ++ + (defcustom notmuch-tag-added-formats +- '((".*" (notmuch-apply-face tag '(:underline "green")))) ++ '((".*" (notmuch-apply-face tag 'notmuch-tag-added))) + "Custom formats for tags when added. + + For added tags the formats in `notmuch-tag-formats` are applied +-- +2.8.0.rc3.226.g39d4020 + -- 2.26.2