From: Mark Walters Date: Wed, 12 Mar 2014 04:09:53 +0000 (+0000) Subject: [Patch v3 4/8] emacs: tag: add customize for deleted/added tag formats X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=53fd34404877dfccc130c99539ce6234f53bd411;p=notmuch-archives.git [Patch v3 4/8] emacs: tag: add customize for deleted/added tag formats --- diff --git a/97/372af1ef3bcf3c5e5f7448f7bcdca04c509fa3 b/97/372af1ef3bcf3c5e5f7448f7bcdca04c509fa3 new file mode 100644 index 000000000..bda6b7dd5 --- /dev/null +++ b/97/372af1ef3bcf3c5e5f7448f7bcdca04c509fa3 @@ -0,0 +1,138 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 7105F429E31 + for ; Tue, 11 Mar 2014 21:10:21 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id ip9Wt6qLqMnH for ; + Tue, 11 Mar 2014 21:10:17 -0700 (PDT) +Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com + [209.85.212.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 3E3D4431FC3 + for ; Tue, 11 Mar 2014 21:10:09 -0700 (PDT) +Received: by mail-wi0-f180.google.com with SMTP id hm4so1804048wib.13 + for ; Tue, 11 Mar 2014 21:10:08 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=q90YJ2N4M9H+SP7Z0Qm2ZJwSyfQEVI+JjvJY+qwEGks=; + b=Va2U6Tqc/jymVfl4dLPpY0GrUVyQrb15oZQefJE4EJ+SeG4il9kUTDpSFJPH38vCiB + 0QF4DQ2CAVThaKS4yST2iFsOSLRFe+1GojvcdyyBka3VeuzWuE4rRRKeXsfkjwhQoaFX + ecrP30yOrsihLT5wyDMQlggOSmTR0bb4n23tENpchwnNqvtuoHbqG959Q8PmoRgEfMxB + owD+nCjTtGZfqE34UQ3gVOgNWkKFA1I4hObUceHebfrodIqOr651j+BWJyj2uMKYp6VC + S5NqltgBqGXZMtUtaF6aV2CuF5/NNfcuTG3i0sx3jNtWek4YvdmkUqoV+zcBegUQMOxz + L1hw== +X-Received: by 10.180.13.197 with SMTP id j5mr5738697wic.14.1394597408115; + Tue, 11 Mar 2014 21:10:08 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id + qg3sm12258254wic.10.2014.03.11.21.10.07 for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Tue, 11 Mar 2014 21:10:07 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org, + amdragon@mit.edu +Subject: [Patch v3 4/8] emacs: tag: add customize for deleted/added tag + formats +Date: Wed, 12 Mar 2014 04:09:53 +0000 +Message-Id: <1394597397-8486-5-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1394597397-8486-1-git-send-email-markwalters1009@gmail.com> +References: <1394597397-8486-1-git-send-email-markwalters1009@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Wed, 12 Mar 2014 04:10:21 -0000 + +Add customize options for deleted/added tag formats. These are not +used yet but will be later in the series. + +We switch to using `notmuch-apply-face' rather than `propertize' in +the defcustom for faces so that the faces for deleted/added tags add +to the default face attributes for the tag. + +We special case deleting the unread tag as that tag is a strong visual +cue and we don't need that cue when we are just saying it used to be +unread. Thus, we revert to the normal tag face with strikethough for +deleted unread tags. +--- + emacs/notmuch-tag.el | 37 ++++++++++++++++++++++++++++++++++++- + 1 files changed, 36 insertions(+), 1 deletions(-) + +diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el +index a4dea39..4698856 100644 +--- a/emacs/notmuch-tag.el ++++ b/emacs/notmuch-tag.el +@@ -39,7 +39,7 @@ (define-widget 'notmuch-tag-format-type 'lazy + (string :tag "Display as") + (list :tag "Face" :extra-offset -4 + (const :format "" :inline t +- (propertize tag 'face)) ++ (notmuch-apply-face tag)) + (list :format "%v" + (const :format "" quote) + custom-face-edit)) +@@ -89,6 +89,41 @@ (defcustom notmuch-tag-formats + :group 'notmuch-show + :type 'notmuch-tag-format-type) + ++(defcustom notmuch-tag-deleted-formats ++ '(("unread" (notmuch-apply-face "unread" ++ (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))))) ++ "Custom formats for tags when deleted. ++ ++For deleted tags the formats in `notmuch-tag-formats` are applied ++first and then these formats are applied on top. ++ ++By default this shows deleted tags with strike-through in red, ++unless strike-through is not available (e.g., emacs is running in ++a terminal) in which case it uses inverse video. To hide deleted ++tags completely set this to ++ '((\".*\" nil)) ++ ++See `notmuch-tag-formats' for full documentation." ++ :group 'notmuch-show ++ :type 'notmuch-tag-format-type) ++ ++(defcustom notmuch-tag-added-formats ++ '((".*" (notmuch-apply-face tag '(:underline "green")))) ++ "Custom formats for tags when added. ++ ++For added tags the formats in `notmuch-tag-formats` are applied ++first and then these formats are applied on top. ++ ++See `notmuch-tag-formats' for full documentation." ++ :group 'notmuch-show ++ :type 'notmuch-tag-format-type) ++ + (defun notmuch-tag-format-image-data (tag data) + "Replace TAG with image DATA, if available. + +-- +1.7.9.1 +