diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2019-03-29 08:46:29 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2019-03-29 08:46:29 -0400 |
commit | fc2da0db49fad772f4497a9dc1ffb5722fc6cc1e (patch) | |
tree | 9f91845b5027c99045d6c437043e77d523381045 /lisp/gnus/mm-decode.el | |
parent | 14e9a428c5e555c590629b4eeec7e754d7e7ae77 (diff) | |
download | emacs-fc2da0db49fad772f4497a9dc1ffb5722fc6cc1e.tar.gz |
Gnus: Automatically render text/calendar in a human-friendly way
* lisp/gnus/mm-decode.el (mm-inline-media-tests): Add text/calendar entry.
Use (fboundp 'device-sound-enabled-p) rather than fishing for features.
(mm-automatic-display): Add text/calendar entry.
* lisp/gnus/gnus-icalendar.el: Use lexical-binding.
Remove redundant :group args.
(gnus-icalendar-mm-inline): Add autoload cookie.
Diffstat (limited to 'lisp/gnus/mm-decode.el')
-rw-r--r-- | lisp/gnus/mm-decode.el | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index b689b51d6a5..3f255419e7e 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -190,45 +190,45 @@ before the external MIME handler is invoked." :group 'mime-display) (defcustom mm-inline-media-tests - '(("image/p?jpeg" + `(("image/p?jpeg" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'jpeg handle))) ("image/png" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'png handle))) ("image/gif" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'gif handle))) ("image/tiff" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'tiff handle))) ("image/xbm" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'xbm handle))) ("image/x-xbitmap" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'xbm handle))) ("image/xpm" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'xpm handle))) ("image/x-xpixmap" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'xpm handle))) ("image/bmp" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'bmp handle))) ("image/x-portable-bitmap" mm-inline-image - (lambda (handle) + ,(lambda (handle) (mm-valid-and-fit-image-p 'pbm handle))) ("text/plain" mm-inline-text identity) ("text/enriched" mm-inline-text identity) @@ -246,13 +246,14 @@ before the external MIME handler is invoked." ("text/x-org" mm-display-org-inline identity) ("text/html" mm-inline-text-html - (lambda (handle) + ,(lambda (_handle) mm-text-html-renderer)) ("text/x-vcard" mm-inline-text-vcard - (lambda (handle) + ,(lambda (_handle) (or (featurep 'vcard) (locate-library "vcard")))) + ("text/calendar" gnus-icalendar-mm-inline identity) ("message/delivery-status" mm-inline-text identity) ("message/rfc822" mm-inline-message identity) ("message/partial" mm-inline-partial identity) @@ -261,13 +262,13 @@ before the external MIME handler is invoked." ("application/x-.?tar\\(-.*\\)?" mm-archive-dissect-and-inline identity) ("application/zip" mm-archive-dissect-and-inline identity) ("audio/wav" mm-inline-audio - (lambda (handle) - (and (or (featurep 'nas-sound) (featurep 'native-sound)) + ,(lambda (_handle) + (and (fboundp 'device-sound-enabled-p) (device-sound-enabled-p)))) ("audio/au" mm-inline-audio - (lambda (handle) - (and (or (featurep 'nas-sound) (featurep 'native-sound)) + ,(lambda (_handle) + (and (fboundp 'device-sound-enabled-p) (device-sound-enabled-p)))) ("application/pgp-signature" ignore identity) ("application/x-pkcs7-signature" ignore identity) @@ -279,7 +280,7 @@ before the external MIME handler is invoked." ("multipart/related" ignore identity) ("image/.*" mm-inline-image - (lambda (handle) + ,(lambda (handle) (and (mm-valid-image-format-p 'imagemagick) (mm-with-unibyte-buffer (mm-insert-part handle) @@ -331,6 +332,7 @@ a list of regexps." (defcustom mm-automatic-display '("text/plain" "text/enriched" "text/richtext" "text/html" "text/x-verbatim" + "text/calendar" "text/x-vcard" "image/.*" "message/delivery-status" "multipart/.*" "message/rfc822" "text/x-patch" "text/dns" "application/pgp-signature" "application/emacs-lisp" "application/x-emacs-lisp" |