X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch.el;h=2bf5f040a3f23881c9f8dc2445a6261969ceae6a;hb=577a6906ce8d918d0ea72dd5fabdd1d6a29f675e;hp=57b7fcf40e0bf790131a2871316fcebdba17adc8;hpb=8cbb5114a20c1217f23977fd5edca99a0b7a2955;p=notmuch diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 57b7fcf4..2bf5f040 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -224,6 +224,7 @@ For a mouse binding, return nil." (define-key map "s" 'notmuch-search) (define-key map "o" 'notmuch-search-toggle-order) (define-key map "=" 'notmuch-search-refresh-view) + (define-key map "G" 'notmuch-search-poll-and-refresh-view) (define-key map "t" 'notmuch-search-filter-by-tag) (define-key map "f" 'notmuch-search-filter) (define-key map [mouse-1] 'notmuch-search-show-thread) @@ -744,6 +745,17 @@ same relative position within the new buffer." (goto-char (point-min)) )) +(defun notmuch-search-poll-and-refresh-view () + "Run external script to import mail and refresh the current view. + +Checks if the variable 'notmuch-external-refresh-script is defined +and runs the external program defined it provides. Then calls +notmuch-search-refresh-view to refresh the current view." + (interactive) + (if (boundp 'notmuch-external-refresh-script) + (call-process notmuch-external-refresh-script nil nil)) + (notmuch-search-refresh-view)) + (defun notmuch-search-toggle-order () "Toggle the current search order. @@ -802,6 +814,7 @@ current search results AND that are tagged with the given tag." (define-key map ">" 'notmuch-folder-last) (define-key map "<" 'notmuch-folder-first) (define-key map "=" 'notmuch-folder) + (define-key map "G" 'notmuch-folder-poll-and-refresh-view) (define-key map "s" 'notmuch-search) (define-key map [mouse-1] 'notmuch-folder-show-search) (define-key map (kbd "RET") 'notmuch-folder-show-search) @@ -915,6 +928,17 @@ Currently available key bindings: (if search (notmuch-search (cdr search) notmuch-search-oldest-first)))) +(defun notmuch-folder-poll-and-refresh-view () + "Run external script to import mail and refresh the folder view. + +Checks if the variable 'notmuch-external-refresh-script is defined +and runs the external program defined it provides. Then calls +notmuch-folder to refresh the current view." + (interactive) + (if (boundp 'notmuch-external-refresh-script) + (call-process notmuch-external-refresh-script nil nil)) + (notmuch-folder)) + ;;;###autoload (defun notmuch-folder () "Show the notmuch folder view and update the displayed counts."