[PATCH] emacs: show: stop display of appliaction/* parts
Tomi Ollila
tomi.ollila at iki.fi
Sun Jan 8 05:09:45 PST 2017
On Sat, Jan 07 2017, Mark Walters <markwalters1009 at gmail.com> wrote:
> Gnus seems to display application/zip and application/tar by
> default. This doesn't seem desirable so we override it.
>
> We only override ifthe user has not customized
> mm-inline-override-types themselves.
> ---
I suggest 2 things:
1) fix typos ;)
2) do it like this:
+ (if (equal mm-inline-override-types
+ (car (get 'mm-inline-override-types 'standard-value)))
Tomas: you can also pick the full function definition from notmuch-show.el
and write it to ~/.emacs.d/notmuch-config.el -- if you do this you
have to remember to remove it whenever you're upgrading to notmuch 0.24(?)
Tomi
> This was mentioned on irc today and this might be a reasonable way of
> doing this.
>
> It does mean that if a user adds, for example, image/* to
> mm-inline-override-types then application/* will be displayed again.
>
> It also makes it slightly awkward to allow all types (eg setting
> mm-inline-override-types to non/existent would do).
>
> Also I feel there ought to be a better way to tell if a variable has
> been customized (or otherwise set), but I didn't find one.
>
> Best wishes
>
> Mark
>
>
> emacs/notmuch-show.el | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 364004b..42734ac 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1227,7 +1227,15 @@ matched."
> (interactive "sNotmuch show: \nP")
> (let ((buffer-name (generate-new-buffer-name
> (or buffer-name
> - (concat "*notmuch-" thread-id "*")))))
> + (concat "*notmuch-" thread-id "*"))))
> + ;; We override mm-inline-override-types to stop appliacation/*
> + ;; parts from being displayed unless the user has customized
> + ;; it themselves.
> + (mm-inline-override-types
> + (if (equal (list mm-inline-override-types)
> + (get 'mm-inline-override-types 'standard-value))
> + (cons "application/*" mm-inline-override-types)
> + mm-inline-override-types)))
> (switch-to-buffer (get-buffer-create buffer-name))
> ;; No need to track undo information for this buffer.
> (setq buffer-undo-list t)
> --
> 2.1.4
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
More information about the notmuch
mailing list