From fd9975057691ac8f0f43ae6d66cd333e7dbfcd16 Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Fri, 22 Jul 2016 14:30:33 +1700 Subject: [PATCH] [PATCH 2/2] emacs: express notmuch-search-line-faces in terms of two new faces: notmuch-search-flagged-face and notmuch-search-unread-face. --- 81/fa09b6d580148ba33cffc177d5cef23407c536 | 167 ++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 81/fa09b6d580148ba33cffc177d5cef23407c536 diff --git a/81/fa09b6d580148ba33cffc177d5cef23407c536 b/81/fa09b6d580148ba33cffc177d5cef23407c536 new file mode 100644 index 000000000..4df997b37 --- /dev/null +++ b/81/fa09b6d580148ba33cffc177d5cef23407c536 @@ -0,0 +1,167 @@ +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 CA01D6DE02DB + for ; Thu, 21 Jul 2016 14:31:26 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.935 +X-Spam-Level: +X-Spam-Status: No, score=-0.935 tagged_above=-999 required=5 tests=[AWL=0.087, + 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 JnRJuX7qrHq0 for ; + Thu, 21 Jul 2016 14:31:19 -0700 (PDT) +Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com + [209.85.192.175]) + by arlo.cworth.org (Postfix) with ESMTPS id ED8876DE0361 + for ; Thu, 21 Jul 2016 14:30:51 -0700 (PDT) +Received: by mail-pf0-f175.google.com with SMTP id y134so34055412pfg.0 + for ; Thu, 21 Jul 2016 14:30:51 -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:in-reply-to:references; + bh=C+PNQx3HLycQNruRrGQLPmThPD4j2GUyx4CIhHu0rmM=; + b=Sucx91TNoju5bgcb2TlE62INnUIXF/gImo08r7FpW2iyMJh7WZa/8ICAuPGKOHukpx + I8GPb0yrzBvr6WiOlAz6OBii+xQf3aeN3sPxfrFIJs6rF2mbokP6HomiP2OGDF05K/JU + f2roc8aJJQ0sYQUif6/UvLuO3+CTPImOAbcxAS9m6DhkCp6P1ff0KBkd29TJy1ijIrtl + nKZscEY4ebGZLO87KEOR7TkbhgZPizn/+2RTcKnKfKHGDxpgkzBSWVBkqOlFXo8glztB + fN7OIlEzdGlqJPDqMm6sIRfGfmaSwSXwKPV7x7adWlNYGrZZfVKqkQWW42IzusEal+zG lOZA== +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:in-reply-to + :references; + bh=C+PNQx3HLycQNruRrGQLPmThPD4j2GUyx4CIhHu0rmM=; + b=IvlcF56MoyivAk6c2rL0dYykVUDuOSWmcZZDlLBJdeb17XOemSNNqtMZfahhbk4i+w + 3pdxXH8etOdTW+tLFXzaZBPPSnS5wwP+mo7umHIBHxwSuNgZSqpRjkXxn0DanFKG5I6w + dQ8ikKXOxD3FDSx9dGjwxDH0DZ0Fz1JC9SnaXnQIpw6CG7h62uZL8F0FnMY5v7Fsb9Y2 + 2T9GPLIqa+IWsFOzZbpy6hFAQ0ENUvzfRWnQnfsDyoNG2RB5ERqiEnDtAB4BlXRb6nIp + seZSu/b0xzQJL0Z+8N/Vi96KmoNRn6ErWBgl6S933MonU267Cv4G6ldOysVGDTWe/u3C + WUBg== +X-Gm-Message-State: + AEkoouu/+jptLSg3IunmT1pTc4v4ljdpttgAP2lGh7xiWDCAIsPoxQ+ibHi+1kFEiz4X4rQ+ +X-Received: by 10.98.213.130 with SMTP id d124mr596780pfg.118.1469136651164; + Thu, 21 Jul 2016 14:30:51 -0700 (PDT) +Received: from marmstrong-linux.kir.corp.google.com ([172.31.9.105]) + by smtp.gmail.com with ESMTPSA id ra13sm14496645pac.29.2016.07.21.14.30.48 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); + Thu, 21 Jul 2016 14:30:50 -0700 (PDT) +From: Matt Armstrong +To: notmuch@notmuchmail.org +Subject: [PATCH 2/2] emacs: express notmuch-search-line-faces in terms of two + new faces: notmuch-search-flagged-face and notmuch-search-unread-face. +Date: Thu, 21 Jul 2016 14:30:33 -0700 +Message-Id: <1469136633-19235-3-git-send-email-marmstrong@google.com> +X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 +In-Reply-To: <1469136633-19235-1-git-send-email-marmstrong@google.com> +References: <1469136633-19235-1-git-send-email-marmstrong@google.com> +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: Thu, 21 Jul 2016 21:31:26 -0000 + +This makes it easier to find the relevant face by customizing +notmuch-faces. I plan to do the same to the other alists of faces +found elsewhere. +--- + NEWS | 7 +++++++ + emacs/notmuch.el | 39 ++++++++++++++++++++++++++++++++------- + 2 files changed, 39 insertions(+), 7 deletions(-) + +diff --git a/NEWS b/NEWS +index ab661d4..49f8bb5 100644 +--- a/NEWS ++++ b/NEWS +@@ -37,6 +37,13 @@ Respect charset of MIME parts when reading them + + Fix previous assumption that everyone uses UTF-8. + ++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. ++ + Notmuch 0.22 (2016-04-26) + ========================= + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 8acdef3..43d56f7 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -311,6 +311,26 @@ there will be called at other points of notmuch execution." + :group 'notmuch-search + :group 'notmuch-faces) + ++(defface notmuch-search-flagged-face ++ '((t ++ (:weight bold))) ++ "Face used in search mode face for flagged threads. ++ ++This face is the default value for the \"flagged\" tag in ++`notmuch-search-line-faces`." ++ :group 'notmuch-search ++ :group 'notmuch-faces) ++ ++(defface notmuch-search-unread-face ++ '((t ++ (:foreground "blue"))) ++ "Face used in search mode for unread threads. ++ ++This face is the default value for the \"unread\" tag in ++`notmuch-search-line-faces`." ++ :group 'notmuch-search ++ :group 'notmuch-faces) ++ + (defun notmuch-search-mode () + "Major mode displaying results of a notmuch search. + +@@ -654,9 +674,12 @@ of the result." + (goto-char (point-min)) + (forward-line (1- notmuch-search-target-line))))))))) + +-(defcustom notmuch-search-line-faces '(("unread" :weight bold) +- ("flagged" :foreground "blue")) +- "Tag/face mapping for line highlighting in notmuch-search. ++(defcustom notmuch-search-line-faces ++ '(("unread" 'notmuch-search-unread-face) ++ ("flagged" 'notmuch-search-flagged-face)) ++ "Alist of tags to faces for line highlighting in notmuch-search. ++Each element looks like (TAG . FACE). ++A thread with TAG will have FACE applied. + + Here is an example of how to color search results based on tags. + (the following text would be placed in your ~/.emacs file): +@@ -665,10 +688,12 @@ Here is an example of how to color search results based on tags. + (\"deleted\" . (:foreground \"red\" + :background \"blue\")))) + +-The attributes defined for matching tags are merged, with earlier +-attributes overriding later. A message having both \"deleted\" +-and \"unread\" tags with the above settings would have a green +-foreground and blue background." ++The FACE must be a face name (a symbol or string), a property ++list of face attributes, or a list of these. The faces for ++matching tags are merged, with earlier attributes overriding ++later. A message having both \"deleted\" and \"unread\" tags with ++the above settings would have a green foreground and blue ++background." + :type '(alist :key-type (string) :value-type (custom-face-edit)) + :group 'notmuch-search + :group 'notmuch-faces) +-- +2.8.0.rc3.226.g39d4020 + -- 2.26.2