From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 0B5FF6DE02CD for ; Sun, 8 Jan 2017 09:44:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.512 X-Spam-Level: X-Spam-Status: No, score=0.512 tagged_above=-999 required=5 tests=[AWL=-0.140, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0EOGsaEcgqkF for ; Sun, 8 Jan 2017 09:44:49 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 5B58E6DE01CE for ; Sun, 8 Jan 2017 09:44:49 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id A8F22100090 for ; Sun, 8 Jan 2017 19:44:36 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: show: stop display of appliaction/* parts In-Reply-To: References: <1483824305-5755-1-git-send-email-markwalters1009@gmail.com> User-Agent: Notmuch/0.23.3+85~g2b85e66 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sun, 08 Jan 2017 17:44:51 -0000 On Sun, Jan 08 2017, Tomi Ollila wrote: > On Sat, Jan 07 2017, Mark Walters 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))) I tried to test the above in emacs *scratch* buffer, but cannot get either of the formats work when variable is non-nil. example tries (defcustom a '(a b) "a") (defcustom b (list "a" "b") "b") (defcustom c (cons 1 nil) "c") then (equal a (car (get 'a 'standard-value))) C-j nil (equal (list a) (get 'a 'standard-value)) C-j nil same with b & c with (defcustom n nil "n") the above work According to defcustom documentation the expression of STANDARD is also stored -- when evaluating (get 'var 'standard-value) the output looks like it: for example (get 'c 'standard-value) ((cons 1 nil)) If the same happens when using the patch, then we need to look alternative -- there might be something good, as customize knows when variable is modified... Tomi > > 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@notmuchmail.org >> https://notmuchmail.org/mailman/listinfo/notmuch > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch