X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=5dc6797068c876619bc36f57cd2ffa4c9ae5e9ab;hp=1781af48d4de1da4476321f864281f5dcfb36c57;hb=60ac94fe58635f9c40724afa0f35965fc9ff1afc;hpb=6a833a6e83865f6999707cc30768d07e1351c2cb diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 1781af48..5dc67970 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -27,6 +27,7 @@ (require 'mm-view) (require 'mm-decode) (require 'cl) +(require 'notmuch-compat) (unless (require 'notmuch-version nil t) (defconst notmuch-emacs-version "unknown" @@ -57,6 +58,10 @@ (custom-add-to-group 'notmuch-send 'message 'custom-group) +(defgroup notmuch-tag nil + "Tags and tagging in Notmuch." + :group 'notmuch) + (defgroup notmuch-crypto nil "Processing and display of cryptographic MIME parts." :group 'notmuch) @@ -147,6 +152,7 @@ For example, if you wanted to remove an \"inbox\" tag and add an (define-key map "z" 'notmuch-tree) (define-key map "m" 'notmuch-mua-new-mail) (define-key map "=" 'notmuch-refresh-this-buffer) + (define-key map (kbd "M-=") 'notmuch-refresh-all-buffers) (define-key map "G" 'notmuch-poll-and-refresh-this-buffer) (define-key map "j" 'notmuch-jump-search) map) @@ -413,10 +419,8 @@ of its command symbol." "Refresh the current buffer." (interactive) (when notmuch-buffer-refresh-function - (if (commandp notmuch-buffer-refresh-function) - ;; Pass prefix argument, etc. - (call-interactively notmuch-buffer-refresh-function) - (funcall notmuch-buffer-refresh-function)))) + ;; Pass prefix argument, etc. + (call-interactively notmuch-buffer-refresh-function))) (defun notmuch-poll-and-refresh-this-buffer () "Invoke `notmuch-poll' to import mail, then refresh the current buffer." @@ -424,6 +428,21 @@ of its command symbol." (notmuch-poll) (notmuch-refresh-this-buffer)) +(defun notmuch-refresh-all-buffers () + "Invoke `notmuch-refresh-this-buffer' on all notmuch major-mode buffers. + +The buffers are silently refreshed, i.e. they are not forced to +be displayed." + (interactive) + (dolist (buffer (buffer-list)) + (let ((buffer-mode (buffer-local-value 'major-mode buffer))) + (when (memq buffer-mode '(notmuch-show-mode + notmuch-tree-mode + notmuch-search-mode + notmuch-hello-mode)) + (with-current-buffer buffer + (notmuch-refresh-this-buffer)))))) + (defun notmuch-prettify-subject (subject) ;; This function is used by `notmuch-search-process-filter' which ;; requires that we not disrupt its' matching state. @@ -790,9 +809,15 @@ You may need to restart Emacs or upgrade your notmuch package.")) (insert-file-contents err-file) (unless (eobp) (buffer-string))))) + (command-string + (mapconcat (lambda (arg) + (shell-quote-argument + (cond ((stringp arg) arg) + ((symbolp arg) (symbol-name arg)) + (t "*UNKNOWN ARGUMENT*")))) + command " ")) (extra - (concat - "command: " (mapconcat #'shell-quote-argument command " ") "\n" + (concat "command: " command-string "\n" (if (integerp exit-status) (format "exit status: %s\n" exit-status) (format "exit signal: %s\n" exit-status))