Add shellscript fontification
authorJulien Danjou <julien@danjou.info>
Thu, 20 Jan 2011 14:44:22 +0000 (15:44 +0100)
committerJulien Danjou <julien@danjou.info>
Thu, 20 Jan 2011 14:44:22 +0000 (15:44 +0100)
Signed-off-by: Julien Danjou <julien@danjou.info>
lisp/ChangeLog
lisp/mm-decode.el
lisp/mm-view.el

index 08c158a..7c4ebc1 100644 (file)
@@ -1,5 +1,9 @@
 2011-01-20  Julien Danjou  <julien@danjou.info>
 
+       * 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.
 
index bbe7150..3b592aa 100644 (file)
@@ -237,6 +237,8 @@ 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/dns" mm-display-dns-inline identity)
     ("text/org" mm-display-org-inline identity)
     ("text/html"
index c1e270b..fa8c94c 100644 (file)
   "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 }