[PATCH v2 3/7] emacs: tag: add customize for deleted/added tag formats
Austin Clements
amdragon at MIT.EDU
Mon Mar 10 19:37:14 PDT 2014
On Wed, 19 Feb 2014, Mark Walters <markwalters1009 at gmail.com> wrote:
> Add customize options for deleted/added tag formats. These are not
> used yet but will be later in the series.
> ---
> emacs/notmuch-tag.el | 31 +++++++++++++++++++++++++++++++
> 1 files changed, 31 insertions(+), 0 deletions(-)
>
> diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el
> index 878aaf7..064fbdb 100644
> --- a/emacs/notmuch-tag.el
> +++ b/emacs/notmuch-tag.el
> @@ -101,6 +101,37 @@ with images."
> :group 'notmuch-show
> :type 'notmuch-tag-format-type)
>
> +(defcustom notmuch-tag-deleted-formats
> + '((".*" (propertize tag 'face
It occurs to me that `propertize' is problematic here, since it replaces
the face property of the tag wholesale. If we really want this to apply
in addition to a face added by notmuch-tag-formats, I don't think
there's any way to massage things so that `propertize' works (short of
horrible hackery). `notmuch-combine-face-text-property-string' does
exactly what we need here, but maybe needs a shorter name?
`notmuch-apply-face'? Or maybe there's some solution I'm not thinking
of?
> + (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
> + '((".*" (propertize tag 'face '(: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
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
More information about the notmuch
mailing list