X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-address.el;h=8b79d34021849baa67292c3c6f6fd82baef304f2;hp=49e240236c7a439d87640c4fdd2b8102446298e9;hb=cfabfc6dab95f28eaa3d7261bca38ade32a69f79;hpb=edae844efaeda706568850003da116a805b352ee 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