summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2011-01-20 23:43:27 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2011-01-20 23:43:27 +0000
commit6e3165fb24673920b31d67a61ee8e8a2e0b25eec (patch)
tree12d262cf396635e9f3f75f798a0df124107ad2fd /lisp
parent8dabbfd6325ea5b11e67fa8358625669808312dd (diff)
downloademacs-6e3165fb24673920b31d67a61ee8e8a2e0b25eec.tar.gz
mm-decode.el (mm-inline-media-tests): Add text/x-sh.
gnus-art.el (gnus-mime-inline-part): Use mm-display-inline rather than mm-insert-inline to insert inline part: this respect mm-inline-media-tests displayers. mm-view.el (mm-display-shell-script-inline): New function. mm-decode.el (mm-inline-media-tests): Add x-shellscript and x-sh. mm-uu.el (mm-uu-type-alist): Add org block. (mm-uu-org-src-code-block-extract): New function. mm-view.el (mm-display-org-inline): New function. mm-decode.el (mm-automatic-display): Add text/org. mailcap.el (mailcap-mime-extensions): Add .org.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog21
-rw-r--r--lisp/gnus/gnus-art.el10
-rw-r--r--lisp/gnus/mailcap.el3
-rw-r--r--lisp/gnus/mm-decode.el7
-rw-r--r--lisp/gnus/mm-uu.el14
-rw-r--r--lisp/gnus/mm-view.el8
6 files changed, 51 insertions, 12 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index e2306c3ac47..c9feb09680b 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -4,6 +4,27 @@
the temp buffer.
* message.el (message-mailer-swallows-blank-line): Use with-temp-buffer.
+2011-01-20 Julien Danjou <julien@danjou.info>
+
+ * mm-decode.el (mm-inline-media-tests): Add text/x-sh.
+
+ * gnus-art.el (gnus-mime-inline-part): Use mm-display-inline rather
+ than mm-insert-inline to insert inline part: this respect
+ mm-inline-media-tests displayers.
+
+ * mm-view.el (mm-display-shell-script-inline): New function.
+
+ * mm-decode.el (mm-inline-media-tests): Add x-shellscript and x-sh.
+
+ * mm-uu.el (mm-uu-type-alist): Add org block.
+ (mm-uu-org-src-code-block-extract): New function.
+
+ * mm-view.el (mm-display-org-inline): New function.
+
+ * mm-decode.el (mm-automatic-display): Add text/org.
+
+ * mailcap.el (mailcap-mime-extensions): Add .org.
+
2011-01-19 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (gnus-article-highlight): Remove argument passed to
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 8e8fa9b76f0..280914d0f09 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5249,15 +5249,7 @@ Compressed files like .gz and .bz2 are decompressed."
(if (mm-handle-undisplayer handle)
(mm-remove-part handle))))
(forward-line 2)
- (mm-insert-inline
- handle
- (if (or coding-system
- (and charset
- (setq coding-system
- (mm-charset-to-coding-system charset))
- (not (eq coding-system 'ascii))))
- (mm-decode-coding-string contents coding-system)
- (mm-string-to-multibyte contents)))
+ (mm-display-inline handle)
(goto-char b)))))
(defun gnus-mime-set-charset-parameters (handle charset)
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el
index b6cef39203c..e50e61bb8fb 100644
--- a/lisp/gnus/mailcap.el
+++ b/lisp/gnus/mailcap.el
@@ -910,7 +910,8 @@ If NO-DECODE is non-nil, don't decode STRING."
(".zip" . "application/zip")
(".ai" . "application/postscript")
(".jpe" . "image/jpeg")
- (".jpeg" . "image/jpeg"))
+ (".jpeg" . "image/jpeg")
+ (".org" . "text/org"))
"An alist of file extensions and corresponding MIME content-types.
This exists for you to customize the information in Lisp. It is
merged with values from mailcap files by `mailcap-parse-mimetypes'.")
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 62755347142..40cfa9b2453 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -237,7 +237,11 @@ before the external MIME handler is invoked."
(lambda (handle) (fboundp 'diff-mode)))
("application/emacs-lisp" mm-display-elisp-inline identity)
("application/x-emacs-lisp" mm-display-elisp-inline identity)
+ ("application/x-shellscript" mm-display-shell-script-inline identity)
+ ("application/x-sh" mm-display-shell-script-inline identity)
+ ("text/x-sh" mm-display-shell-script-inline identity)
("text/dns" mm-display-dns-inline identity)
+ ("text/org" mm-display-org-inline identity)
("text/html"
mm-inline-text-html
(lambda (handle)
@@ -313,7 +317,8 @@ when selecting a different article."
"application/pkcs7-signature" "application/x-pkcs7-mime"
"application/pkcs7-mime"
;; Mutt still uses this even though it has already been withdrawn.
- "application/pgp\\'")
+ "application/pgp\\'"
+ "text/org")
"A list of MIME types to be displayed automatically."
:type '(repeat regexp)
:group 'mime-display)
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 432b23c2029..69661225bd4 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -186,7 +186,15 @@ This can be either \"inline\" or \"attachment\".")
"^\\\\end{document}"
mm-uu-latex-extract
nil
- mm-uu-latex-test))
+ mm-uu-latex-test)
+ (org-src-code-block
+ "^[ \t]*#\\+begin_"
+ "^[ \t]*#\\+end_"
+ mm-uu-org-src-code-block-extract)
+ (org-meta-line
+ "^[ \t]*#\\+[[:alpha:]]+: "
+ "$"
+ mm-uu-org-src-code-block-extract))
"A list of specifications for non-MIME attachments.
Each element consist of the following entries: label,
start-regexp, end-regexp, extract-function, test-function.
@@ -383,6 +391,10 @@ apply the face `mm-uu-extract'."
(list mm-dissect-disposition
(cons 'filename file-name))))
+(defun mm-uu-org-src-code-block-extract ()
+ (mm-make-handle (mm-uu-copy-to-buffer start-point end-point)
+ '("text/org")))
+
(defvar gnus-newsgroup-name)
(defun mm-uu-emacs-sources-test ()
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 61d5b32b2c7..fa8c94c36b7 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -632,6 +632,14 @@
(defun mm-display-dns-inline (handle)
(mm-display-inline-fontify handle 'dns-mode))
+(defun mm-display-org-inline (handle)
+ "Show an Org mode text from HANDLE inline."
+ (mm-display-inline-fontify handle 'org-mode))
+
+(defun mm-display-shell-script-inline (handle)
+ "Show an shell script from HANDLE inline."
+ (mm-display-inline-fontify handle 'shell-script-mode))
+
;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
;; us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
(defvar mm-pkcs7-signed-magic