X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=079281c341f0ea433d569d441f592ccea8058db6;hp=e13ca3d76c50c8c2e73012c835ea2014cb81fb55;hb=e083987338ab058fff826242c0a7b533f5a453ba;hpb=6682b4e686b7972883626c9b0f941ae4bf02dedb diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index e13ca3d7..079281c3 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -48,8 +48,10 @@ (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)) + (&optional query query-context target buffer-name open-target unthreaded)) (declare-function notmuch-tree-get-message-properties "notmuch-tree" nil) +(declare-function notmuch-unthreaded + (&optional query query-context target buffer-name open-target)) (declare-function notmuch-read-query "notmuch" (prompt)) (declare-function notmuch-draft-resume "notmuch-draft" (id)) @@ -1471,6 +1473,7 @@ reset based on the original query." (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 "U" 'notmuch-unthreaded-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) @@ -1559,6 +1562,13 @@ All currently available key bindings: notmuch-show-query-context (notmuch-show-get-message-id))) +(defun notmuch-unthreaded-from-show-current-query () + "Call notmuch unthreaded with the current query" + (interactive) + (notmuch-unthreaded 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))) @@ -2540,12 +2550,16 @@ message." (push (match-string-no-properties 0) urls)) (reverse urls)))) -(defun notmuch-show-browse-urls () - "Offer to browse any URLs in the current message." - (interactive) - (let ((urls (notmuch-show--gather-urls))) +(defun notmuch-show-browse-urls (&optional kill) + "Offer to browse any URLs in the current message. +With a prefix argument, copy the URL to the kill ring rather than +browsing." + (interactive "P") + (let ((urls (notmuch-show--gather-urls)) + (prompt (if kill "Copy URL to kill ring: " "Browse URL: ")) + (fn (if kill #'kill-new #'browse-url))) (if urls - (browse-url (completing-read "Browse URL: " (cdr urls) nil nil (car urls))) + (funcall fn (completing-read prompt urls nil nil nil nil (car urls))) (message "No URLs found.")))) (provide 'notmuch-show)