X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-address.el;h=d372fbafab001f7931a98eeef1c12d074dfa38a5;hb=3ba1b938b56857dc18e4d2b7233b8aba5cad7820;hp=aafbe5fb8328a4ce1b92a9aa482ffa36dbd7fd6e;hpb=0cf457b73b4b666314d1a09ac3e31bd0fa2346a6;p=notmuch diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index aafbe5fb..d372fbaf 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -15,7 +15,7 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with Notmuch. If not, see . +;; along with Notmuch. If not, see . ;; ;; Authors: David Edmondson @@ -249,6 +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