X-Git-Url: http://rtime.felk.cvut.cz/gitweb/notmuch.git/blobdiff_plain/ca076ce2736b5db2ec03afe1b0e09299b24f05ff..c13ff402c42143941010cd03bd57658d42f0df7d:/emacs/notmuch-address.el diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index 49e24023..8b79d340 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -1,4 +1,4 @@ -;; notmuch-address.el --- address completion with notmuch +;;; notmuch-address.el --- address completion with notmuch ;; ;; Copyright © David Edmondson ;; @@ -19,6 +19,8 @@ ;; ;; Authors: David Edmondson +;;; Code: + (require 'message) (require 'notmuch-parser) (require 'notmuch-lib) @@ -247,4 +249,25 @@ called when harvesting finishes." ;; +(defun notmuch-address-from-minibuffer (prompt) + (if (not notmuch-address-command) + (read-string prompt) + (let ((rmap (copy-keymap minibuffer-local-map)) + (omap minibuffer-local-map)) + ;; Configure TAB to start completion when executing read-string. + ;; "Original" minibuffer keymap is restored just before calling + ;; notmuch-address-expand-name as it may also use minibuffer-local-map + ;; (completing-read probably does not but if something else is used there). + (define-key rmap (kbd "TAB") (lambda () + (interactive) + (let ((enable-recursive-minibuffers t) + (minibuffer-local-map omap)) + (notmuch-address-expand-name)))) + (let ((minibuffer-local-map rmap)) + (read-string prompt))))) + +;; + (provide 'notmuch-address) + +;;; notmuch-address.el ends here