]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-show.el
emacs: support text/calendar mime type
[notmuch] / emacs / notmuch-show.el
index 7ffa1ed1156fb2b78d576a08393d25dbc9d916fc..f35513b9a87c0ef3238e34590b8c76a839d9fa1d 100644 (file)
@@ -729,7 +729,7 @@ current buffer, if possible."
        (run-hook-with-args 'notmuch-show-insert-text/plain-hook msg depth))))
   t)
 
        (run-hook-with-args 'notmuch-show-insert-text/plain-hook msg depth))))
   t)
 
-(defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type)
+(defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth declared-type)
   (notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))
   (insert (with-temp-buffer
            (insert (notmuch-show-get-bodypart-content msg part nth))
   (notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))
   (insert (with-temp-buffer
            (insert (notmuch-show-get-bodypart-content msg part nth))
@@ -747,6 +747,10 @@ current buffer, if possible."
              result)))
   t)
 
              result)))
   t)
 
+;; For backwards compatibility.
+(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)
   ;; 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.
 (defun notmuch-show-insert-part-application/octet-stream (msg part content-type nth depth declared-type)
   ;; 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.
@@ -1038,8 +1042,11 @@ function is used."
     ;; buffer.
     (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
     ;; Set the default value for
     ;; buffer.
     (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
     ;; Set the default value for
-    ;; `notmuch-show-elide-non-matching-messages' in this buffer.
+    ;; `notmuch-show-elide-non-matching-messages' in this buffer. If
+    ;; there is a prefix argument, invert the default.
     (setq notmuch-show-elide-non-matching-messages notmuch-show-only-matching-messages)
     (setq notmuch-show-elide-non-matching-messages notmuch-show-only-matching-messages)
+    (if current-prefix-arg
+       (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages)))
 
     (setq notmuch-show-thread-id thread-id
          notmuch-show-parent-buffer parent-buffer
 
     (setq notmuch-show-thread-id thread-id
          notmuch-show-parent-buffer parent-buffer
@@ -1121,7 +1128,7 @@ This includes:
 Refreshes the current view, observing changes in display
 preferences. If RETAIN-STATE is non-nil then the state of the
 buffer is stored and re-applied after the refresh."
 Refreshes the current view, observing changes in display
 preferences. If RETAIN-STATE is non-nil then the state of the
 buffer is stored and re-applied after the refresh."
-  (interactive)
+  (interactive "P")
   (let ((inhibit-read-only t)
        state)
     (if retain-state
   (let ((inhibit-read-only t)
        state)
     (if retain-state
@@ -1687,26 +1694,6 @@ argument, hide all of the messages."
   (interactive)
   (backward-button 1))
 
   (interactive)
   (backward-button 1))
 
-(defun notmuch-show-tag-thread-internal (tag &optional remove)
-  "Add tag to the current set of messages.
-
-If the remove switch is given, tags will be removed instead of
-added."
-  (goto-char (point-min))
-  (let ((op (if remove "-" "+")))
-    (loop do (notmuch-show-tag-message (concat op tag))
-         until (not (notmuch-show-goto-message-next)))))
-
-(defun notmuch-show-add-tag-thread (tag)
-  "Add tag to all messages in the current thread."
-  (interactive)
-  (notmuch-show-tag-thread-internal tag))
-
-(defun notmuch-show-remove-tag-thread (tag)
-  "Remove tag from all messages in the current thread."
-  (interactive)
-  (notmuch-show-tag-thread-internal tag t))
-
 (defun notmuch-show-next-thread (&optional show-next)
   "Move to the next item in the search results, if any."
   (interactive "P")
 (defun notmuch-show-next-thread (&optional show-next)
   "Move to the next item in the search results, if any."
   (interactive "P")
@@ -1734,9 +1721,8 @@ being delivered to the same thread. It does not archive the
 entire thread, but only the messages shown in the current
 buffer."
   (interactive "P")
 entire thread, but only the messages shown in the current
 buffer."
   (interactive "P")
-  (if unarchive
-      (notmuch-show-add-tag-thread "inbox")
-    (notmuch-show-remove-tag-thread "inbox")))
+  (let ((op (if unarchive "+" "-")))
+    (notmuch-show-tag-all (concat op "inbox"))))
 
 (defun notmuch-show-archive-thread-then-next ()
   "Archive each message in thread, then show next thread from search."
 
 (defun notmuch-show-archive-thread-then-next ()
   "Archive each message in thread, then show next thread from search."