|
Jani Nikula |
|
|
I like to have notmuch-show-all-multipart/alternative-parts nil. I'd also
like to see the text/calendar alternatives that I keep getting that have the information that the text/plain alternative is missing (like date and time *sigh*). Patch 1 allows me to specify the alternative parts I want to always see (nil and t work as before): (setq notmuch-show-all-multipart/alternative-parts '("text/calendar")) Patch 2 parses text/calendar as text/x-vcalendar for me so I don't have to. BR, Jani. Jani Nikula (2): emacs: support defining a list of alternative parts to show emacs: regard text/calendar as text/x-vcalendar emacs/notmuch-show.el | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Jani Nikula |
|
|
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 <[hidden email]> --- 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) (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 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Jani Nikula |
|
|
In reply to this post by Jani Nikula
Treat text/calendar as text/x-vcalendar. At least the following
produce text/calendar that parse as text/x-vcalendar: PRODID:-//Google Inc//Google Calendar 70.9054//EN PRODID:Microsoft Exchange Server 2010 Code by David Edmondson <[hidden email]> --- I wish I had some references here, other than my own maildirs. Almost all of the calendar invites I have are text/calendar, and all of them parse just fine as text/x-vcalendar. --- emacs/notmuch-show.el | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 1340380..f6588b3 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -720,6 +720,9 @@ current buffer, if possible." result))) t) +(defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth declared-type) + (notmuch-show-insert-part-text/x-vcalendar 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 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
David Edmondson |
|
|
In reply to this post by Jani Nikula
On Wed, 8 Feb 2012 16:55:15 +0000, Jani Nikula <[hidden email]> 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 <[hidden email]> > --- > 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) > (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 > _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
David Edmondson |
|
|
In reply to this post by Jani Nikula
On Wed, 8 Feb 2012 16:55:16 +0000, Jani Nikula <[hidden email]> wrote:
> Treat text/calendar as text/x-vcalendar. At least the following > produce text/calendar that parse as text/x-vcalendar: > > PRODID:-//Google Inc//Google Calendar 70.9054//EN > PRODID:Microsoft Exchange Server 2010 > > Code by David Edmondson <[hidden email]> > > --- > > I wish I had some references here, other than my own maildirs. Almost > all of the calendar invites I have are text/calendar, and all of them > parse just fine as text/x-vcalendar. > --- > emacs/notmuch-show.el | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index 1340380..f6588b3 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -720,6 +720,9 @@ current buffer, if possible." > result))) > t) > > +(defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth declared-type) > + (notmuch-show-insert-part-text/x-vcalendar msg part content-type nth depth declared-type)) > + > (defun notmuch-show-insert-part-application/octet-stream (msg part content-type nth depth declared-type) "text/x-vcalendar" is old and being phased out, so these should really be the other way around (i.e. text/calendar is the 'real' function that is called by the text/x-vcalendar variant). > ;; 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 > _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Jani Nikula |
|
|
In reply to this post by Jani Nikula
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 <[hidden email]> --- 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 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Jani Nikula |
|
|
In reply to this post by Jani Nikula
Replace text/x-vcalendar with text/calendar, while maintaining support
and backwards compatibility for text/x-vcalendar. Code by David Edmondson <[hidden email]> --- 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 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
David Edmondson |
|
|
In reply to this post by Jani Nikula
On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <[hidden email]> 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 <[hidden email]> > --- > 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: \"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))) (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 > _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
David Edmondson |
|
|
In reply to this post by Jani Nikula
Looks good.
_______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Jani Nikula |
|
|
In reply to this post by David Edmondson
On Fri, 10 Feb 2012 10:05:46 +0000, David Edmondson <[hidden email]> wrote:
> On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <[hidden email]> 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 <[hidden email]> > > --- > > 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 > > _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Jani Nikula |
|
|
In reply to this post by David Edmondson
On Fri, 10 Feb 2012 10:05:46 +0000, David Edmondson <[hidden email]> wrote:
> On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <[hidden email]> 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 <[hidden email]> > > --- > > 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 > > _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Tomi Ollila-2 |
|
|
On Sun, 12 Feb 2012 14:09:57 +0200, Jani Nikula <[hidden email]> wrote:
> On Fri, 10 Feb 2012 10:05:46 +0000, David Edmondson <[hidden email]> wrote: > > On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <[hidden email]> 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 _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Adam Wolfe Gordon |
|
|
In reply to this post by Jani Nikula
+1 from me. Very handy.
_______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch --
Adam Wolfe Gordon |
|
Jani Nikula |
|
|
In reply to this post by Jani Nikula
On Thu, 9 Feb 2012 14:46:02 +0000, Jani Nikula <[hidden email]> 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 <[hidden email]> > --- > 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 > notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
Jani Nikula |
|
|
In reply to this post by Jani Nikula
On Thu, 9 Feb 2012 14:46:03 +0000, Jani Nikula <[hidden email]> 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 <[hidden email]> > --- > 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 > notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
|
David Bremner-2 |
|
|
In reply to this post by Jani Nikula
On Thu, 9 Feb 2012 14:46:03 +0000, Jani Nikula <[hidden email]> wrote:
> Replace text/x-vcalendar with text/calendar, while maintaining support > and backwards compatibility for text/x-vcalendar. pushed _______________________________________________ notmuch mailing list [hidden email] http://notmuchmail.org/mailman/listinfo/notmuch |
| Powered by Nabble | See how NAML generates this page |