From 1841426679882fe5a8730bf724eb4b421a44fac0 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 3 Aug 2017 13:42:27 -0400 Subject: mail: Read sync-mail arguments through custom function --- init.el | 3 +-- lisp/km-mail.el | 11 +++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/init.el b/init.el index c7c2ad7..a2f17f1 100644 --- a/init.el +++ b/init.el @@ -2391,8 +2391,7 @@ mode-line-misc-info)) (key-chord-define-global "jg" 'km/mail-map) (after 'notmuch-lib - (define-key notmuch-common-keymap ")" #'km/notmuch-sync-mail) - (define-key notmuch-common-keymap "0" #'km/notmuch-sync-mail-fast)) + (define-key notmuch-common-keymap "0" #'km/notmuch-sync-mail)) (setq savehist-file (concat savehist-file "-mail")) (savehist-mode 1) (setq recentf-save-file "~/.emacs.d/cache/recentf-mail") diff --git a/lisp/km-mail.el b/lisp/km-mail.el index 772b3a4..1ff6907 100644 --- a/lisp/km-mail.el +++ b/lisp/km-mail.el @@ -107,8 +107,9 @@ ;;;###autoload (defun km/notmuch-sync-mail (&optional cmd-append) - (interactive (list (and current-prefix-arg - (read-string "sync-mail args: ")))) + (interactive (list (if (fboundp 'km/read-sync-mail-args) + (km/read-sync-mail-args) + (read-string "sync-mail args: ")))) (setq mail-sync-calling-buffer (current-buffer)) (let ((default-directory (expand-file-name "~/")) (display-buffer-overriding-action @@ -117,11 +118,5 @@ (and cmd-append " ") cmd-append) 'mail-sync-mode))) - -;;;###autoload -(defun km/notmuch-sync-mail-fast () - (interactive) - (km/notmuch-sync-mail "--fast")) - (provide 'km-mail) ;;; km-mail.el ends here -- cgit v1.2.3