aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-show.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/notmuch-show.el')
-rw-r--r--emacs/notmuch-show.el35
1 files changed, 20 insertions, 15 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 1864dd15..d56154eb 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -38,7 +38,6 @@
(require 'notmuch-print)
(declare-function notmuch-call-notmuch-process "notmuch" (&rest args))
-(declare-function notmuch-fontify-headers "notmuch" nil)
(declare-function notmuch-search-next-thread "notmuch" nil)
(declare-function notmuch-search-show-thread "notmuch" nil)
@@ -158,6 +157,7 @@ indentation."
'(("Gmane" . "http://mid.gmane.org/")
("MARC" . "http://marc.info/?i=")
("Mail Archive, The" . "http://mail-archive.com/search?l=mid&q=")
+ ("LKML" . "http://lkml.kernel.org/r/")
;; FIXME: can these services be searched by `Message-Id' ?
;; ("MarkMail" . "http://markmail.org/")
;; ("Nabble" . "http://nabble.com/")
@@ -362,8 +362,7 @@ operation on the contents of the current buffer."
(if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
(let ((inhibit-read-only t))
(replace-match (concat "("
- (propertize (mapconcat 'identity tags " ")
- 'face 'notmuch-tag-face)
+ (notmuch-tag-format-tags tags)
")"))))))
(defun notmuch-clean-address (address)
@@ -441,8 +440,7 @@ message at DEPTH in the current thread."
" ("
date
") ("
- (propertize (mapconcat 'identity tags " ")
- 'face 'notmuch-tag-face)
+ (notmuch-tag-format-tags tags)
")\n")
(overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
@@ -469,7 +467,8 @@ message at DEPTH in the current thread."
'action 'notmuch-show-part-button-default
'keymap 'notmuch-show-part-button-map
'follow-link t
- 'face 'message-mml)
+ 'face 'message-mml
+ :supertype 'notmuch-button-type)
(defvar notmuch-show-part-button-map
(let ((map (make-sparse-keymap)))
@@ -798,9 +797,9 @@ message at DEPTH in the current thread."
(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)
+(defun notmuch-show-get-mime-type-of-application/octet-stream (part)
;; 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.
+ ;; we return that.
(if (plist-get part :filename)
(let ((extension (file-name-extension (plist-get part :filename)))
mime-type)
@@ -810,13 +809,13 @@ message at DEPTH in the current thread."
(setq mime-type (mailcap-extension-to-mime extension))
(if (and mime-type
(not (string-equal mime-type "application/octet-stream")))
- (notmuch-show-insert-bodypart-internal msg part mime-type nth depth content-type)
+ mime-type
nil))
nil))))
;; Handler for wash generated inline patch fake parts.
(defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type)
- (notmuch-show-insert-part-*/* msg part "text/x-diff" nth depth "inline patch"))
+ (notmuch-show-insert-part-*/* msg part content-type nth depth declared-type))
(defun notmuch-show-insert-part-text/html (msg part content-type nth depth declared-type)
;; text/html handler to work around bugs in renderers and our
@@ -887,11 +886,16 @@ message at DEPTH in the current thread."
"Insert the body part PART at depth DEPTH in the current thread.
If HIDE is non-nil then initially hide this part."
- (let ((content-type (downcase (plist-get part :content-type)))
- (nth (plist-get part :id))
- (beg (point)))
-
- (notmuch-show-insert-bodypart-internal msg part content-type nth depth content-type)
+ (let* ((content-type (downcase (plist-get part :content-type)))
+ (mime-type (or (and (string= content-type "application/octet-stream")
+ (notmuch-show-get-mime-type-of-application/octet-stream part))
+ (and (string= content-type "inline patch")
+ "text/x-diff")
+ content-type))
+ (nth (plist-get part :id))
+ (beg (point)))
+
+ (notmuch-show-insert-bodypart-internal msg part mime-type nth depth content-type)
;; Some of the body part handlers leave point somewhere up in the
;; part, so we make sure that we're down at the end.
(goto-char (point-max))
@@ -1085,6 +1089,7 @@ buttons for a corresponding notmuch search."
;; Remove the overlay created by goto-address-mode
(remove-overlays (first link) (second link) 'goto-address t)
(make-text-button (first link) (second link)
+ :type 'notmuch-button-type
'action `(lambda (arg)
(notmuch-show ,(third link)))
'follow-link t