[PATCH 1/2] emacs: support defining a list of alternative parts to show

David Edmondson dme at dme.org
Wed Feb 8 09:05:39 PST 2012


On Wed,  8 Feb 2012 16:55:15 +0000, Jani Nikula <jani at nikula.org> wrote:
> Make notmuch-show-all-multipart/alternative-parts accept a list of
> multipart/alternative types to show in addition to the preferred
> types. This allows the user to force display some alternative part
> types while normally showing just the preferred ones.
> 
> Signed-off-by: Jani Nikula <jani at nikula.org>
> ---
>  emacs/notmuch-show.el |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index faa9f9b..1340380 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -97,7 +97,9 @@ any given message."
>  ;; Mostly useful for debugging.
>  (defcustom notmuch-show-all-multipart/alternative-parts t
>    "Should all parts of multipart/alternative parts be shown?"
> -  :type 'boolean
> +  :type '(choice (const :tag "Show all" t)
> +		 (const :tag "Show preferred" nil)
> +		 (repeat :tag "Show preferred and custom" string))
>    :group 'notmuch-show)

It would be convenient if this was a list of regexps.

>  (defcustom notmuch-show-indent-messages-width 1
> @@ -513,7 +515,9 @@ current buffer, if possible."
>      ;; should be chosen if there are more than one that match?
>      (mapc (lambda (inner-part)
>  	    (let ((inner-type (plist-get inner-part :content-type)))
> -	      (if (or notmuch-show-all-multipart/alternative-parts
> +	      (if (or (equal notmuch-show-all-multipart/alternative-parts t)
> +		      (member inner-type
> +			      notmuch-show-all-multipart/alternative-parts)
>  		      (string= chosen-type inner-type))
>  		  (notmuch-show-insert-bodypart msg inner-part depth)
>  		(notmuch-show-insert-part-header (plist-get inner-part :id) inner-type inner-type nil " (not shown)"))))
> -- 
> 1.7.1
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120208/8a4c31b5/attachment.pgp>


More information about the notmuch mailing list