X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=f00273a959eaf35cfac60c91127b000244cf2716;hb=8141555d2540633c9b741993b92d6b9b3030fd83;hp=81ee87a8b8e8cd8b27d0eba312c8b5abe55065ba;hpb=47792533b37b24d353aa351c303562860509441b;p=notmuch diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 81ee87a8..f00273a9 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -44,6 +44,8 @@ (declare-function notmuch-foreach-mime-part "notmuch" (function mm-handle)) (declare-function notmuch-count-attachments "notmuch" (mm-handle)) (declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp)) +(declare-function notmuch-tree "notmuch-tree" + (&optional query query-context target buffer-name open-target)) (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date") "Headers that should be shown in a message, in this order. @@ -407,7 +409,8 @@ unchanged ADDRESS if parsing fails." message at DEPTH in the current thread." (let ((start (point))) (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth)) - (notmuch-show-clean-address (plist-get headers :From)) + (notmuch-sanitize + (notmuch-show-clean-address (plist-get headers :From))) " (" date ") (" @@ -417,7 +420,7 @@ message at DEPTH in the current thread." (defun notmuch-show-insert-header (header header-value) "Insert a single header." - (insert header ": " header-value "\n")) + (insert header ": " (notmuch-sanitize header-value) "\n")) (defun notmuch-show-insert-headers (headers) "Insert the headers of the current message." @@ -1156,7 +1159,7 @@ function is used." (jit-lock-register #'notmuch-show-buttonise-links) ;; Set the header line to the subject of the first message. - (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject))) + (setq header-line-format (notmuch-sanitize (notmuch-show-strip-re (notmuch-show-get-subject)))) (run-hooks 'notmuch-show-hook)))) @@ -1246,6 +1249,7 @@ reset based on the original query." (defvar notmuch-show-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map notmuch-common-keymap) + (define-key map "Z" 'notmuch-tree-from-show-current-query) (define-key map (kbd "") 'widget-backward) (define-key map (kbd "M-TAB") 'notmuch-show-previous-button) (define-key map (kbd "") 'notmuch-show-previous-button) @@ -1322,6 +1326,13 @@ All currently available key bindings: (setq buffer-read-only t truncate-lines t)) +(defun notmuch-tree-from-show-current-query () + "Call notmuch tree with the current query" + (interactive) + (notmuch-tree notmuch-show-thread-id + notmuch-show-query-context + (notmuch-show-get-message-id))) + (defun notmuch-show-move-to-message-top () (goto-char (notmuch-show-message-top)))