unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: show: stop display of appliaction/* parts
@ 2017-01-07 21:25 Mark Walters
  2017-01-07 23:12 ` Tomas Nordin
  2017-01-08 13:09 ` Tomi Ollila
  0 siblings, 2 replies; 13+ messages in thread
From: Mark Walters @ 2017-01-07 21:25 UTC (permalink / raw)
  To: notmuch

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.
---

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] emacs: show: stop display of appliaction/* parts
  2017-01-07 21:25 [PATCH] emacs: show: stop display of appliaction/* parts Mark Walters
@ 2017-01-07 23:12 ` Tomas Nordin
  2017-01-08 12:22   ` David Bremner
  2017-01-08 13:09 ` Tomi Ollila
  1 sibling, 1 reply; 13+ messages in thread
From: Tomas Nordin @ 2017-01-07 23:12 UTC (permalink / raw)
  To: Mark Walters, notmuch

Good evening

> 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

I applied this to a local copy of notmuch-show.el (notmuch is installed
on debian via apt here) and then eval-defun:ed the function. After that
no inline default display. Seems to work nicely. notmuch version 0.23.1.

By chance it can be easily answered, if I want to use the latest notmuch
installed from source, does it seem like a suitable procedure to do
this;

sudo apt-get remove notmuch
... do the source install and re-run notmuch new. It will probably work
smoothly with the setup I have?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] emacs: show: stop display of appliaction/* parts
  2017-01-07 23:12 ` Tomas Nordin
@ 2017-01-08 12:22   ` David Bremner
  0 siblings, 0 replies; 13+ messages in thread
From: David Bremner @ 2017-01-08 12:22 UTC (permalink / raw)
  To: Tomas Nordin, Mark Walters, notmuch

Tomas Nordin <tomasn@posteo.net> writes:

>
> sudo apt-get remove notmuch
> ... do the source install and re-run notmuch new. It will probably work
> smoothly with the setup I have?

We generally support upgrades but not downgrades. So you can move from
your existing setup to git master, but not necessarily back. You may
also face certain breaking changes in the emacs interface before the
next release.  We try to minimize those, but the nature of emacs means
we can't predict all the ways people have customized their environment.

And of course you're running unreleased software, so you can expect
somewhat less sympathy if things break. That said, most of the
developers run git master happily.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] emacs: show: stop display of appliaction/* parts
  2017-01-07 21:25 [PATCH] emacs: show: stop display of appliaction/* parts Mark Walters
  2017-01-07 23:12 ` Tomas Nordin
@ 2017-01-08 13:09 ` Tomi Ollila
  2017-01-08 17:44   ` Tomi Ollila
  1 sibling, 1 reply; 13+ messages in thread
From: Tomi Ollila @ 2017-01-08 13:09 UTC (permalink / raw)
  To: notmuch

On Sat, Jan 07 2017, Mark Walters <markwalters1009@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@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] emacs: show: stop display of appliaction/* parts
  2017-01-08 13:09 ` Tomi Ollila
@ 2017-01-08 17:44   ` Tomi Ollila
  2017-01-08 19:52     ` Tomas Nordin
  0 siblings, 1 reply; 13+ messages in thread
From: Tomi Ollila @ 2017-01-08 17:44 UTC (permalink / raw)
  To: notmuch

On Sun, Jan 08 2017, Tomi Ollila <tomi.ollila@iki.fi> wrote:

> On Sat, Jan 07 2017, Mark Walters <markwalters1009@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)))

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] emacs: show: stop display of appliaction/* parts
  2017-01-08 17:44   ` Tomi Ollila
@ 2017-01-08 19:52     ` Tomas Nordin
  2017-01-08 21:49       ` Tomi Ollila
  0 siblings, 1 reply; 13+ messages in thread
From: Tomas Nordin @ 2017-01-08 19:52 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Hello Tomi

Tomi Ollila <tomi.ollila@iki.fi> writes:
> 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...

I played on a bit with your scratch...

(defcustom a '(a b) "a")
(defcustom b (list "a" "b") "b")
(defcustom c (cons 1 nil) "c")
(defcustom T 10 "T")

a -> (a b)
b -> ("a" "b")
c -> (1)
T -> 10

;;; look at one of the plists
(symbol-plist 'a) -> (standard-value ((quote (a b))) custom-requests nil variable-documentation "a")

(get 'a 'standard-value) -> ((quote (a b)))
(car (get 'a 'standard-value)) -> (quote (a b))
(eval (car (get 'a 'standard-value))) -> (a b)

(get 'b 'standard-value) -> ((list "a" "b"))
(car (get 'b 'standard-value)) -> (list "a" "b")
(eval (car (get 'b 'standard-value))) -> ("a" "b")

(get 'c 'standard-value) -> ((cons 1 nil))
(car (get 'c 'standard-value)) -> (cons 1 nil)
(eval (car (get 'c 'standard-value))) -> (1)

(get 'T 'standard-value) -> (10)
(car (get 'T 'standard-value)) -> 10
(eval (car (get 'T 'standard-value))) -> 10

(equal a (eval (car (get 'a 'standard-value)))) -> t
(equal b (eval (car (get 'b 'standard-value)))) -> t
(equal c (eval (car (get 'c 'standard-value)))) -> t
(equal T (eval (car (get 'T 'standard-value)))) -> t

Could it be that the car need to be evaled before compared to the value
of the variable? It looks like it with those experiments.

The docs also say something in those lines:

   Internally, ‘defcustom’ uses the symbol property ‘standard-value’ to
record the expression for the standard value, ‘saved-value’ to record
the value saved by the user with the customization buffer, and
‘customized-value’ to record the value set by the user with the
customization buffer, but not saved.  *Note Symbol Properties::.  These
properties are lists, the car of which is an expression that evaluates
to the value.

... thinking about the last sentence. But it seems strange if there is
not a more convenient function to do this.

What do you think?

Best regards
--
Tomas

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] emacs: show: stop display of appliaction/* parts
  2017-01-08 19:52     ` Tomas Nordin
@ 2017-01-08 21:49       ` Tomi Ollila
  2017-01-28  9:47         ` [PATCH v2] emacs: show: stop display of application/* parts Mark Walters
  0 siblings, 1 reply; 13+ messages in thread
From: Tomi Ollila @ 2017-01-08 21:49 UTC (permalink / raw)
  To: Tomas Nordin, notmuch

On Sun, Jan 08 2017, Tomas Nordin <tomasn@posteo.net> wrote:

> Hello Tomi
>
>
> I played on a bit with your scratch...
>
> (defcustom a '(a b) "a")
> (defcustom b (list "a" "b") "b")
> (defcustom c (cons 1 nil) "c")
> (defcustom T 10 "T")
>
> a -> (a b)
> b -> ("a" "b")
> c -> (1)
> T -> 10
>
> ;;; look at one of the plists
> (symbol-plist 'a) -> (standard-value ((quote (a b))) custom-requests nil variable-documentation "a")
>
> (get 'a 'standard-value) -> ((quote (a b)))
> (car (get 'a 'standard-value)) -> (quote (a b))
> (eval (car (get 'a 'standard-value))) -> (a b)
>
> (get 'b 'standard-value) -> ((list "a" "b"))
> (car (get 'b 'standard-value)) -> (list "a" "b")
> (eval (car (get 'b 'standard-value))) -> ("a" "b")
>
> (get 'c 'standard-value) -> ((cons 1 nil))
> (car (get 'c 'standard-value)) -> (cons 1 nil)
> (eval (car (get 'c 'standard-value))) -> (1)
>
> (get 'T 'standard-value) -> (10)
> (car (get 'T 'standard-value)) -> 10
> (eval (car (get 'T 'standard-value))) -> 10
>
> (equal a (eval (car (get 'a 'standard-value)))) -> t
> (equal b (eval (car (get 'b 'standard-value)))) -> t
> (equal c (eval (car (get 'c 'standard-value)))) -> t
> (equal T (eval (car (get 'T 'standard-value)))) -> t
>
> Could it be that the car need to be evaled before compared to the value
> of the variable? It looks like it with those experiments.
>
> The docs also say something in those lines:
>
>    Internally, ‘defcustom’ uses the symbol property ‘standard-value’ to
> record the expression for the standard value, ‘saved-value’ to record
> the value saved by the user with the customization buffer, and
> ‘customized-value’ to record the value set by the user with the
> customization buffer, but not saved.  *Note Symbol Properties::.  These
> properties are lists, the car of which is an expression that evaluates
> to the value.
>
> ... thinking about the last sentence. But it seems strange if there is
> not a more convenient function to do this.
>
> What do you think?

I looked a bit into custom.el, and it was doing exactly that
(i.e. (eval (car (get symbol 'standard-value)))
like everywhere...

Nice play,

Tomi

>
> Best regards
> --
> Tomas

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2] emacs: show: stop display of application/* parts
  2017-01-08 21:49       ` Tomi Ollila
@ 2017-01-28  9:47         ` Mark Walters
  2017-02-12 22:53           ` Tomas Nordin
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Walters @ 2017-01-28  9:47 UTC (permalink / raw)
  To: notmuch

Gnus seems to display application/zip and application/tar by
default. This doesn't seem desirable so we override it.

We only override if the user has not customized
mm-inline-override-types themselves.
---

I think this fixes all the bugs (and typos). Thanks to Tomas and Tomi
for finding and verifying the correct way to get the default value of
a defcustom variable.

It's only lightly tested but seems to work.

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..c670160 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 application/*
+	;; parts from being displayed unless the user has customized
+	;; it themselves.
+	(mm-inline-override-types
+	 (if (equal mm-inline-override-types
+		    (eval (car (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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] emacs: show: stop display of application/* parts
  2017-01-28  9:47         ` [PATCH v2] emacs: show: stop display of application/* parts Mark Walters
@ 2017-02-12 22:53           ` Tomas Nordin
  2017-02-13 14:33             ` David Bremner
  0 siblings, 1 reply; 13+ messages in thread
From: Tomas Nordin @ 2017-02-12 22:53 UTC (permalink / raw)
  To: Mark Walters, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> Gnus seems to display application/zip and application/tar by
> default. This doesn't seem desirable so we override it.
>
> We only override if the user has not customized
> mm-inline-override-types themselves.

But what will we do if the user has not customized it because she
/wants/ to display all possible things inline. I have not seen that this
patch is merged into master, and probably, when I have learned about
this variable, I think maybe it's better not to do it in the notmuch
code.

I wrote this on on the wiki (on my machine). Is it maybe an option to
have it written down there so it is spoken out, and can be linked to at
next complaint. What do you think, should I push it?

I inserted this as a new level 2 heading under the

    Controlling external handlers for attachements

heading. Is that bad? Maybe it breaks links...

1 file changed, 19 insertions(+)
emacstips.mdwn | 19 +++++++++++++++++++

modified   emacstips.mdwn
@@ -26,6 +26,25 @@ adding a .mailcap file in your home directory. Here is an example:
     application/pdf; /usr/bin/mupdf %s; test=test "$DISPLAY" != ""; description=Portable Document Format; nametemplate=%s.pdf
     application/x-pdf; /usr/bin/mupdf %s; test=test "$DISPLAY" != ""; description=Portable Document Format; nametemplate=%s.pdf
 
+## Overriding inline display of certain attachments
+
+If you are annoyed by notmuch showing large attachments like zip files
+with images, you can override the behavior by setting the
+mm-inline-override-types variable like this:
+
+    (setq mm-inline-override-types
+        (cons "application/zip" mm-inline-override-types))
+
+This will prevent the default display of the mime types specified. If
+you would like to make sure that *no* application-ish attachments
+tries to be displayed, then set the variable like this:
+
+    (setq mm-inline-override-types
+        (cons "application/*" mm-inline-override-types))
+
+Do this in any file that loads when emacs load, like in your `.emacs`
+or `.notmuch` file. Also note that this is an emacs user option.
+
 ## Overwriting the sender address
 
 If you want to always use the same sender address, then the following

Happy mailing
--
Tomas

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] emacs: show: stop display of application/* parts
  2017-02-12 22:53           ` Tomas Nordin
@ 2017-02-13 14:33             ` David Bremner
  2017-02-27  8:31               ` Mark Walters
  0 siblings, 1 reply; 13+ messages in thread
From: David Bremner @ 2017-02-13 14:33 UTC (permalink / raw)
  To: Tomas Nordin, Mark Walters, notmuch

Tomas Nordin <tomasn@posteo.net> writes:

> Mark Walters <markwalters1009@gmail.com> writes:
>
>> Gnus seems to display application/zip and application/tar by
>> default. This doesn't seem desirable so we override it.
>>
>> We only override if the user has not customized
>> mm-inline-override-types themselves.
>
> But what will we do if the user has not customized it because she
> /wants/ to display all possible things inline. I have not seen that this
> patch is merged into master, and probably, when I have learned about
> this variable, I think maybe it's better not to do it in the notmuch
> code.

The problem is that the gnus default is somehow unsafe, and causes bad
behaviour for people receiving large attachments.

d

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] emacs: show: stop display of application/* parts
  2017-02-13 14:33             ` David Bremner
@ 2017-02-27  8:31               ` Mark Walters
  2017-02-27  9:00                 ` Tomi Ollila
  2017-02-27 20:36                 ` Tomas Nordin
  0 siblings, 2 replies; 13+ messages in thread
From: Mark Walters @ 2017-02-27  8:31 UTC (permalink / raw)
  To: David Bremner, Tomas Nordin, notmuch


Hi

>> But what will we do if the user has not customized it because she
>> /wants/ to display all possible things inline. I have not seen that this
>> patch is merged into master, and probably, when I have learned about
>> this variable, I think maybe it's better not to do it in the notmuch
>> code.

Well they can set mm-inline-override-types to
"non-existent/type". Rather a kludge I agree.

> The problem is that the gnus default is somehow unsafe, and causes bad
> behaviour for people receiving large attachments.

I agree with this and do think we should block this by default. In
particular, gnus/mm stuff doesn't even check for the existence of unzip
before running it on zip attachments so on my machines which don't have
unzip I get a bodypart insertion error.

One alternative would be to add a variable
notmuch-mm-inline-override-types which would combine or replace
mm-inline-override-types for notmuch's use. A defcustom would be
clutter, but a variable would mean anyone with unusual requirements
could just setq it.

What does anyone think?

Best wishes

Mark

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] emacs: show: stop display of application/* parts
  2017-02-27  8:31               ` Mark Walters
@ 2017-02-27  9:00                 ` Tomi Ollila
  2017-02-27 20:36                 ` Tomas Nordin
  1 sibling, 0 replies; 13+ messages in thread
From: Tomi Ollila @ 2017-02-27  9:00 UTC (permalink / raw)
  To: Mark Walters, David Bremner, Tomas Nordin, notmuch

On Mon, Feb 27 2017, Mark Walters <markwalters1009@gmail.com> wrote:

> Hi
>
>>> But what will we do if the user has not customized it because she
>>> /wants/ to display all possible things inline. I have not seen that this
>>> patch is merged into master, and probably, when I have learned about
>>> this variable, I think maybe it's better not to do it in the notmuch
>>> code.
>
> Well they can set mm-inline-override-types to
> "non-existent/type". Rather a kludge I agree.
>
>> The problem is that the gnus default is somehow unsafe, and causes bad
>> behaviour for people receiving large attachments.
>
> I agree with this and do think we should block this by default. In
> particular, gnus/mm stuff doesn't even check for the existence of unzip
> before running it on zip attachments so on my machines which don't have
> unzip I get a bodypart insertion error.
>
> One alternative would be to add a variable
> notmuch-mm-inline-override-types which would combine or replace
> mm-inline-override-types for notmuch's use. A defcustom would be
> clutter, but a variable would mean anyone with unusual requirements
> could just setq it.
>
> What does anyone think?

patch is pushed, and that is good (i did not read the above content, so if
I am not answering the right guestion, then ignore this ;)

>
> Best wishes
>
> Mark
>
>
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] emacs: show: stop display of application/* parts
  2017-02-27  8:31               ` Mark Walters
  2017-02-27  9:00                 ` Tomi Ollila
@ 2017-02-27 20:36                 ` Tomas Nordin
  1 sibling, 0 replies; 13+ messages in thread
From: Tomas Nordin @ 2017-02-27 20:36 UTC (permalink / raw)
  To: Mark Walters, David Bremner, notmuch

Mark Walters <markwalters1009@gmail.com> writes:

> Hi
>
>>> But what will we do if the user has not customized it because she
>>> /wants/ to display all possible things inline. I have not seen that this
>>> patch is merged into master, and probably, when I have learned about
>>> this variable, I think maybe it's better not to do it in the notmuch
>>> code.
>
> Well they can set mm-inline-override-types to
> "non-existent/type". Rather a kludge I agree.
>
>> The problem is that the gnus default is somehow unsafe, and causes bad
>> behaviour for people receiving large attachments.
>
> I agree with this and do think we should block this by default. In
> particular, gnus/mm stuff doesn't even check for the existence of unzip
> before running it on zip attachments so on my machines which don't have
> unzip I get a bodypart insertion error.
>
> One alternative would be to add a variable
> notmuch-mm-inline-override-types which would combine or replace

This is exactly what I have been wanting to suggest, but

> mm-inline-override-types for notmuch's use. A defcustom would be
> clutter, but a variable would mean anyone with unusual requirements

I /do/ think it could be a defcustom to make it clear what notmuch is
intentionally doing. It could be set to have "application/*" in it by
default and then be unconditionally added to mm-inline-override-types in
the notmuch-show defun (like patched now, only more properly
user-defined with a safe default). If the user want to display whatever,
she will set it to nil.

Maybe it could even be called notmuch-show-mm-inline-override-types and
sort under the custom Notmuch Show group.

> could just setq it.
>
> What does anyone think?
>
> Best wishes
>
> Mark
>
>
>

-- 
Tomas Nordin | (The computing freedom explorer)
GPG Key: AB09AF78

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-02-27 20:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-07 21:25 [PATCH] emacs: show: stop display of appliaction/* parts Mark Walters
2017-01-07 23:12 ` Tomas Nordin
2017-01-08 12:22   ` David Bremner
2017-01-08 13:09 ` Tomi Ollila
2017-01-08 17:44   ` Tomi Ollila
2017-01-08 19:52     ` Tomas Nordin
2017-01-08 21:49       ` Tomi Ollila
2017-01-28  9:47         ` [PATCH v2] emacs: show: stop display of application/* parts Mark Walters
2017-02-12 22:53           ` Tomas Nordin
2017-02-13 14:33             ` David Bremner
2017-02-27  8:31               ` Mark Walters
2017-02-27  9:00                 ` Tomi Ollila
2017-02-27 20:36                 ` Tomas Nordin

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).