* [PATCH v2 2/2] emacs: support text/calendar mime type
2012-02-09 14:46 ` [PATCH v2 1/2] emacs: support defining a list of alternative parts to show Jani Nikula
@ 2012-02-09 14:46 ` Jani Nikula
2012-02-10 10:06 ` David Edmondson
` (3 more replies)
2012-02-10 10:05 ` [PATCH v2 1/2] emacs: support defining a list of alternative parts to show David Edmondson
2012-02-21 7:50 ` Jani Nikula
2 siblings, 4 replies; 16+ messages in thread
From: Jani Nikula @ 2012-02-09 14:46 UTC (permalink / raw)
To: notmuch
Replace text/x-vcalendar with text/calendar, while maintaining support
and backwards compatibility for text/x-vcalendar.
Code by David Edmondson <dme@dme.org>
---
emacs/notmuch-show.el | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5f643f1..33a4f18 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -711,7 +711,7 @@ current buffer, if possible."
(run-hook-with-args 'notmuch-show-insert-text/plain-hook msg depth))))
t)
-(defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type)
+(defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth declared-type)
(notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))
(insert (with-temp-buffer
(insert (notmuch-show-get-bodypart-content msg part nth))
@@ -729,6 +729,10 @@ current buffer, if possible."
result)))
t)
+;; For backwards compatibility.
+(defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type)
+ (notmuch-show-insert-part-text/calendar msg part content-type nth depth declared-type))
+
(defun notmuch-show-insert-part-application/octet-stream (msg part content-type nth depth declared-type)
;; If we can deduce a MIME type from the filename of the attachment,
;; do so and pass it on to the handler for that type.
--
1.7.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] emacs: support text/calendar mime type
2012-02-09 14:46 ` [PATCH v2 2/2] emacs: support text/calendar mime type Jani Nikula
@ 2012-02-10 10:06 ` David Edmondson
2012-02-15 15:35 ` Adam Wolfe Gordon
` (2 subsequent siblings)
3 siblings, 0 replies; 16+ messages in thread
From: David Edmondson @ 2012-02-10 10:06 UTC (permalink / raw)
To: Jani Nikula, notmuch
[-- Attachment #1: Type: text/plain, Size: 12 bytes --]
Looks good.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] emacs: support text/calendar mime type
2012-02-09 14:46 ` [PATCH v2 2/2] emacs: support text/calendar mime type Jani Nikula
2012-02-10 10:06 ` David Edmondson
@ 2012-02-15 15:35 ` Adam Wolfe Gordon
2012-02-21 7:52 ` Jani Nikula
2012-02-25 13:55 ` David Bremner
3 siblings, 0 replies; 16+ messages in thread
From: Adam Wolfe Gordon @ 2012-02-15 15:35 UTC (permalink / raw)
To: Jani Nikula; +Cc: notmuch
+1 from me. Very handy.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] emacs: support text/calendar mime type
2012-02-09 14:46 ` [PATCH v2 2/2] emacs: support text/calendar mime type Jani Nikula
2012-02-10 10:06 ` David Edmondson
2012-02-15 15:35 ` Adam Wolfe Gordon
@ 2012-02-21 7:52 ` Jani Nikula
2012-02-25 13:55 ` David Bremner
3 siblings, 0 replies; 16+ messages in thread
From: Jani Nikula @ 2012-02-21 7:52 UTC (permalink / raw)
To: notmuch, David Bremner
On Thu, 9 Feb 2012 14:46:03 +0000, Jani Nikula <jani@nikula.org> wrote:
> Replace text/x-vcalendar with text/calendar, while maintaining support
> and backwards compatibility for text/x-vcalendar.
David (B, not E), while 1/2 needs work, this 2/2 is independent and IMHO
could go in.
BR,
Jani.
>
> Code by David Edmondson <dme@dme.org>
> ---
> emacs/notmuch-show.el | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 5f643f1..33a4f18 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -711,7 +711,7 @@ current buffer, if possible."
> (run-hook-with-args 'notmuch-show-insert-text/plain-hook msg depth))))
> t)
>
> -(defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type)
> +(defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth declared-type)
> (notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))
> (insert (with-temp-buffer
> (insert (notmuch-show-get-bodypart-content msg part nth))
> @@ -729,6 +729,10 @@ current buffer, if possible."
> result)))
> t)
>
> +;; For backwards compatibility.
> +(defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type)
> + (notmuch-show-insert-part-text/calendar msg part content-type nth depth declared-type))
> +
> (defun notmuch-show-insert-part-application/octet-stream (msg part content-type nth depth declared-type)
> ;; If we can deduce a MIME type from the filename of the attachment,
> ;; do so and pass it on to the handler for that type.
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 2/2] emacs: support text/calendar mime type
2012-02-09 14:46 ` [PATCH v2 2/2] emacs: support text/calendar mime type Jani Nikula
` (2 preceding siblings ...)
2012-02-21 7:52 ` Jani Nikula
@ 2012-02-25 13:55 ` David Bremner
3 siblings, 0 replies; 16+ messages in thread
From: David Bremner @ 2012-02-25 13:55 UTC (permalink / raw)
To: Jani Nikula, notmuch
On Thu, 9 Feb 2012 14:46:03 +0000, Jani Nikula <jani@nikula.org> wrote:
> Replace text/x-vcalendar with text/calendar, while maintaining support
> and backwards compatibility for text/x-vcalendar.
pushed
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/2] emacs: support defining a list of alternative parts to show
2012-02-09 14:46 ` [PATCH v2 1/2] emacs: support defining a list of alternative parts to show Jani Nikula
2012-02-09 14:46 ` [PATCH v2 2/2] emacs: support text/calendar mime type Jani Nikula
@ 2012-02-10 10:05 ` David Edmondson
2012-02-10 10:17 ` Jani Nikula
2012-02-12 12:09 ` Jani Nikula
2012-02-21 7:50 ` Jani Nikula
2 siblings, 2 replies; 16+ messages in thread
From: David Edmondson @ 2012-02-10 10:05 UTC (permalink / raw)
To: Jani Nikula, notmuch
[-- Attachment #1: Type: text/plain, Size: 3342 bytes --]
On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <jani@nikula.org> wrote:
> Make notmuch-show-all-multipart/alternative-parts accept a list of
> regexps to match the part types to determine which parts 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@nikula.org>
> ---
> emacs/notmuch-show.el | 23 ++++++++++++++++++-----
> 1 files changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 24fde05..5f643f1 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -94,10 +94,20 @@ any given message."
> :group 'notmuch-show
> :group 'notmuch-hooks)
>
> -;; Mostly useful for debugging.
> (defcustom notmuch-show-all-multipart/alternative-parts t
> - "Should all parts of multipart/alternative parts be shown?"
> - :type 'boolean
> + "Which parts of multipart/alternative should be shown?
> +
> +This variable determines which parts of multipart/alternative
> +should be displayed. Set to t (the default) to show all
> +parts. Set to nil to only show the preferred parts. Set to a list
> +of regexps to display the preferred parts, and parts matching any
> +of the regexps, for example:
"If set to `t' (the default), all sub-parts of a
\"multipart/alternative\" part are shown. If set to `nil', only the
preferred part is shown. If set to a list of regexps, the preferred part
and all parts whose type matches one of the regexps will be shown."
> +
> + (setq notmuch-show-all-multipart/alternative-parts
> + '(\"text/.*calendar\" \"text/html\"))"
> + :type '(choice (const :tag "Show all parts" t)
> + (const :tag "Show preferred parts" nil)
> + (repeat :tag "Show preferred and parts matching regexps" string))
> :group 'notmuch-show)
>
> (defcustom notmuch-show-indent-messages-width 1
> @@ -513,8 +523,11 @@ 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
> - (string= chosen-type inner-type))
> + (if (or (equal notmuch-show-all-multipart/alternative-parts t)
> + (string= chosen-type inner-type)
> + (and
> + notmuch-show-all-multipart/alternative-parts
> + (equal (string-match-p (mapconcat (lambda (s) (format "^%s$" s)) notmuch-show-all-multipart/alternative-parts "\\|") inner-type) 0)))
This is quite messy. How about we add a general helper to "notmuch-lib.el":
(defun notmuch-string-match-list-p (regexps string)
(loop for regexp in regexps
if (string-match-p regexp string)
return t))
and then write:
(if (or (string= chosen-type inner-type)
(equal notmuch-show-all-multipart/alternative-parts t)
(notmuch-string-match-list-p notmuch-show-all-multipart/alternative-parts 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)"))))
> inner-parts)
> --
> 1.7.1
>
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/2] emacs: support defining a list of alternative parts to show
2012-02-10 10:05 ` [PATCH v2 1/2] emacs: support defining a list of alternative parts to show David Edmondson
@ 2012-02-10 10:17 ` Jani Nikula
2012-02-12 12:09 ` Jani Nikula
1 sibling, 0 replies; 16+ messages in thread
From: Jani Nikula @ 2012-02-10 10:17 UTC (permalink / raw)
To: David Edmondson, notmuch
On Fri, 10 Feb 2012 10:05:46 +0000, David Edmondson <dme@dme.org> wrote:
> On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <jani@nikula.org> wrote:
> > Make notmuch-show-all-multipart/alternative-parts accept a list of
> > regexps to match the part types to determine which parts 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@nikula.org>
> > ---
> > emacs/notmuch-show.el | 23 ++++++++++++++++++-----
> > 1 files changed, 18 insertions(+), 5 deletions(-)
> >
> > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> > index 24fde05..5f643f1 100644
> > --- a/emacs/notmuch-show.el
> > +++ b/emacs/notmuch-show.el
> > @@ -94,10 +94,20 @@ any given message."
> > :group 'notmuch-show
> > :group 'notmuch-hooks)
> >
> > -;; Mostly useful for debugging.
> > (defcustom notmuch-show-all-multipart/alternative-parts t
> > - "Should all parts of multipart/alternative parts be shown?"
> > - :type 'boolean
> > + "Which parts of multipart/alternative should be shown?
> > +
> > +This variable determines which parts of multipart/alternative
> > +should be displayed. Set to t (the default) to show all
> > +parts. Set to nil to only show the preferred parts. Set to a list
> > +of regexps to display the preferred parts, and parts matching any
> > +of the regexps, for example:
>
> "If set to `t' (the default), all sub-parts of a
> \"multipart/alternative\" part are shown. If set to `nil', only the
> preferred part is shown. If set to a list of regexps, the preferred part
> and all parts whose type matches one of the regexps will be shown."
Thank you; this is the best kind of comment on improving documentation.
>
> > +
> > + (setq notmuch-show-all-multipart/alternative-parts
> > + '(\"text/.*calendar\" \"text/html\"))"
> > + :type '(choice (const :tag "Show all parts" t)
> > + (const :tag "Show preferred parts" nil)
> > + (repeat :tag "Show preferred and parts matching regexps" string))
> > :group 'notmuch-show)
> >
> > (defcustom notmuch-show-indent-messages-width 1
> > @@ -513,8 +523,11 @@ 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
> > - (string= chosen-type inner-type))
> > + (if (or (equal notmuch-show-all-multipart/alternative-parts t)
> > + (string= chosen-type inner-type)
> > + (and
> > + notmuch-show-all-multipart/alternative-parts
> > + (equal (string-match-p (mapconcat (lambda (s) (format "^%s$" s)) notmuch-show-all-multipart/alternative-parts "\\|") inner-type) 0)))
>
> This is quite messy. How about we add a general helper to "notmuch-lib.el":
>
> (defun notmuch-string-match-list-p (regexps string)
> (loop for regexp in regexps
> if (string-match-p regexp string)
> return t))
>
> and then write:
>
> (if (or (string= chosen-type inner-type)
> (equal notmuch-show-all-multipart/alternative-parts t)
> (notmuch-string-match-list-p notmuch-show-all-multipart/alternative-parts inner-type))
> ...
>
> ?
*sigh* I was so happy to make that mapconcat work. And I guess soon I'll
have to add "code by dme" in this patch too. ;)
But you're right, it will be more readable that way. v3 in a few days.
BR,
Jani.
>
> > (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)"))))
> > inner-parts)
> > --
> > 1.7.1
> >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/2] emacs: support defining a list of alternative parts to show
2012-02-10 10:05 ` [PATCH v2 1/2] emacs: support defining a list of alternative parts to show David Edmondson
2012-02-10 10:17 ` Jani Nikula
@ 2012-02-12 12:09 ` Jani Nikula
2012-02-12 14:37 ` Tomi Ollila
1 sibling, 1 reply; 16+ messages in thread
From: Jani Nikula @ 2012-02-12 12:09 UTC (permalink / raw)
To: David Edmondson, notmuch
On Fri, 10 Feb 2012 10:05:46 +0000, David Edmondson <dme@dme.org> wrote:
> On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <jani@nikula.org> wrote:
> > Make notmuch-show-all-multipart/alternative-parts accept a list of
> > regexps to match the part types to determine which parts 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@nikula.org>
> > ---
> > emacs/notmuch-show.el | 23 ++++++++++++++++++-----
> > 1 files changed, 18 insertions(+), 5 deletions(-)
> >
> > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> > index 24fde05..5f643f1 100644
> > --- a/emacs/notmuch-show.el
> > +++ b/emacs/notmuch-show.el
> > @@ -94,10 +94,20 @@ any given message."
> > :group 'notmuch-show
> > :group 'notmuch-hooks)
> >
> > -;; Mostly useful for debugging.
> > (defcustom notmuch-show-all-multipart/alternative-parts t
> > - "Should all parts of multipart/alternative parts be shown?"
> > - :type 'boolean
> > + "Which parts of multipart/alternative should be shown?
> > +
> > +This variable determines which parts of multipart/alternative
> > +should be displayed. Set to t (the default) to show all
> > +parts. Set to nil to only show the preferred parts. Set to a list
> > +of regexps to display the preferred parts, and parts matching any
> > +of the regexps, for example:
>
> "If set to `t' (the default), all sub-parts of a
> \"multipart/alternative\" part are shown. If set to `nil', only the
> preferred part is shown. If set to a list of regexps, the preferred part
> and all parts whose type matches one of the regexps will be shown."
>
> > +
> > + (setq notmuch-show-all-multipart/alternative-parts
> > + '(\"text/.*calendar\" \"text/html\"))"
> > + :type '(choice (const :tag "Show all parts" t)
> > + (const :tag "Show preferred parts" nil)
> > + (repeat :tag "Show preferred and parts matching regexps" string))
> > :group 'notmuch-show)
> >
> > (defcustom notmuch-show-indent-messages-width 1
> > @@ -513,8 +523,11 @@ 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
> > - (string= chosen-type inner-type))
> > + (if (or (equal notmuch-show-all-multipart/alternative-parts t)
> > + (string= chosen-type inner-type)
> > + (and
> > + notmuch-show-all-multipart/alternative-parts
> > + (equal (string-match-p (mapconcat (lambda (s) (format "^%s$" s)) notmuch-show-all-multipart/alternative-parts "\\|") inner-type) 0)))
>
> This is quite messy. How about we add a general helper to "notmuch-lib.el":
>
> (defun notmuch-string-match-list-p (regexps string)
> (loop for regexp in regexps
> if (string-match-p regexp string)
> return t))
>
> and then write:
>
> (if (or (string= chosen-type inner-type)
> (equal notmuch-show-all-multipart/alternative-parts t)
> (notmuch-string-match-list-p notmuch-show-all-multipart/alternative-parts inner-type))
> ...
Hmm. I wrapped the regexps between ^ and $ to not match substrings. I
think that's less surprising and better than having the user add them,
and the user can still use e.g. ".*foo.*" to explicitly match a
substring.
If this is fixed in notmuch-string-match-list-p then it's not general
anymore. But does adding a mapcar to wrap the regexps here make this
messy again...? What if notmuch-string-match-list-p were just a local
specific helper for clarity?
>
> ?
>
> > (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)"))))
> > inner-parts)
> > --
> > 1.7.1
> >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/2] emacs: support defining a list of alternative parts to show
2012-02-12 12:09 ` Jani Nikula
@ 2012-02-12 14:37 ` Tomi Ollila
0 siblings, 0 replies; 16+ messages in thread
From: Tomi Ollila @ 2012-02-12 14:37 UTC (permalink / raw)
To: Jani Nikula, David Edmondson, notmuch
On Sun, 12 Feb 2012 14:09:57 +0200, Jani Nikula <jani@nikula.org> wrote:
> On Fri, 10 Feb 2012 10:05:46 +0000, David Edmondson <dme@dme.org> wrote:
> > On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <jani@nikula.org> wrote:
[...]
> > > + (if (or (equal notmuch-show-all-multipart/alternative-parts t)
> > > + (string= chosen-type inner-type)
> > > + (and
> > > + notmuch-show-all-multipart/alternative-parts
> > > + (equal (string-match-p (mapconcat (lambda (s) (format "^%s$" s)) notmuch-show-all-multipart/alternative-parts "\\|") inner-type) 0)))
> >
> > This is quite messy. How about we add a general helper to "notmuch-lib.el":
> >
> > (defun notmuch-string-match-list-p (regexps string)
> > (loop for regexp in regexps
> > if (string-match-p regexp string)
> > return t))
> >
> > and then write:
> >
> > (if (or (string= chosen-type inner-type)
> > (equal notmuch-show-all-multipart/alternative-parts t)
> > (notmuch-string-match-list-p notmuch-show-all-multipart/alternative-parts inner-type))
> > ...
>
> Hmm. I wrapped the regexps between ^ and $ to not match substrings. I
> think that's less surprising and better than having the user add them,
> and the user can still use e.g. ".*foo.*" to explicitly match a
> substring.
>
> If this is fixed in notmuch-string-match-list-p then it's not general
> anymore. But does adding a mapcar to wrap the regexps here make this
> messy again...? What if notmuch-string-match-list-p were just a local
> specific helper for clarity?
Something like this could work...
(defun notmuch-string-match-list-p (regexps string)
(loop for regexp in regexps
if (string-match-p (concat "^" regexp "$") string)
return t))
But if you-re going to pre-anchor these regexps then it is better to be
documented clearly as the final 'regexp' works in non-standard way.
> >
> > ?
Tomi
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/2] emacs: support defining a list of alternative parts to show
2012-02-09 14:46 ` [PATCH v2 1/2] emacs: support defining a list of alternative parts to show Jani Nikula
2012-02-09 14:46 ` [PATCH v2 2/2] emacs: support text/calendar mime type Jani Nikula
2012-02-10 10:05 ` [PATCH v2 1/2] emacs: support defining a list of alternative parts to show David Edmondson
@ 2012-02-21 7:50 ` Jani Nikula
2 siblings, 0 replies; 16+ messages in thread
From: Jani Nikula @ 2012-02-21 7:50 UTC (permalink / raw)
To: notmuch
On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <jani@nikula.org> wrote:
> Make notmuch-show-all-multipart/alternative-parts accept a list of
> regexps to match the part types to determine which parts 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.
Wah, this patch (1/2) is crap, as it also seems to affect the
reply. I'll probably return to this later, after the json reply stuff is
merged or so.
BR,
Jani.
>
> Signed-off-by: Jani Nikula <jani@nikula.org>
> ---
> emacs/notmuch-show.el | 23 ++++++++++++++++++-----
> 1 files changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 24fde05..5f643f1 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -94,10 +94,20 @@ any given message."
> :group 'notmuch-show
> :group 'notmuch-hooks)
>
> -;; Mostly useful for debugging.
> (defcustom notmuch-show-all-multipart/alternative-parts t
> - "Should all parts of multipart/alternative parts be shown?"
> - :type 'boolean
> + "Which parts of multipart/alternative should be shown?
> +
> +This variable determines which parts of multipart/alternative
> +should be displayed. Set to t (the default) to show all
> +parts. Set to nil to only show the preferred parts. Set to a list
> +of regexps to display the preferred parts, and parts matching any
> +of the regexps, for example:
> +
> + (setq notmuch-show-all-multipart/alternative-parts
> + '(\"text/.*calendar\" \"text/html\"))"
> + :type '(choice (const :tag "Show all parts" t)
> + (const :tag "Show preferred parts" nil)
> + (repeat :tag "Show preferred and parts matching regexps" string))
> :group 'notmuch-show)
>
> (defcustom notmuch-show-indent-messages-width 1
> @@ -513,8 +523,11 @@ 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
> - (string= chosen-type inner-type))
> + (if (or (equal notmuch-show-all-multipart/alternative-parts t)
> + (string= chosen-type inner-type)
> + (and
> + notmuch-show-all-multipart/alternative-parts
> + (equal (string-match-p (mapconcat (lambda (s) (format "^%s$" s)) notmuch-show-all-multipart/alternative-parts "\\|") inner-type) 0)))
> (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)"))))
> inner-parts)
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 16+ messages in thread