From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org, amdragon@mit.edu
Subject: [Patch v4 4/8] emacs: tag: add customize for deleted/added tag formats
Date: Sat, 22 Mar 2014 11:51:08 +0000 [thread overview]
Message-ID: <1395489072-19001-5-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <1395489072-19001-1-git-send-email-markwalters1009@gmail.com>
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 | 46 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
index a4dea39..3ae5e62 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))
@@ -87,6 +87,50 @@ (defcustom notmuch-tag-formats
with images."
:group 'notmuch-search
:group 'notmuch-show
+ :group 'notmuch-faces
+ :type 'notmuch-tag-format-type)
+
+(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)))))
+ "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; that is `tag'
+passed to the function is the tag with all these previous
+formattings applied. The formatted can access the original
+unformatted tag as `bare-tag'.
+
+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
+ :group 'notmuch-faces
+ :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.
+
+To disable special formatting of added tags, set this variable to
+nil.
+
+See `notmuch-tag-formats' for full documentation."
+ :group 'notmuch-show
+ :group 'notmuch-faces
:type 'notmuch-tag-format-type)
(defun notmuch-tag-format-image-data (tag data)
--
1.7.10.4
next prev parent reply other threads:[~2014-03-22 11:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-22 11:51 [Patch v4 0/8] emacs: show tag changes in buffer Mark Walters
2014-03-22 11:51 ` [Patch v4 1/8] emacs: Combine notmuch-combine-face-text-property{, -string} Mark Walters
2014-03-22 11:51 ` [Patch v4 2/8] Make keys of notmuch-tag-formats regexps and use caching Mark Walters
2014-03-22 11:51 ` [Patch v4 3/8] emacs: tag split customise option for format-tags into a widget Mark Walters
2014-03-22 11:51 ` Mark Walters [this message]
2014-03-22 11:51 ` [Patch v4 5/8] emacs: show: mark tags changed since buffer loaded Mark Walters
2014-03-22 11:51 ` [Patch v4 6/8] emacs: show: use orig-tags for tag display Mark Walters
2014-03-22 11:51 ` [Patch v4 7/8] emacs: search: use orig-tags in search Mark Walters
2014-03-22 11:51 ` [Patch v4 8/8] emacs: tree: " Mark Walters
2014-03-22 14:50 ` [Patch v4 0/8] emacs: show tag changes in buffer Austin Clements
2014-03-22 17:35 ` Jani Nikula
2014-03-25 0:10 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395489072-19001-5-git-send-email-markwalters1009@gmail.com \
--to=markwalters1009@gmail.com \
--cc=amdragon@mit.edu \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).