diff -u /home/jv/.emacs.d/hacknotmuch/notmuch-address-original.el /home/jv/.emacs.d/hacknotmuch/notmuch-address-modified.el --- /home/jv/.emacs.d/hacknotmuch/notmuch-address-original.el 2017-04-11 09:30:56.612534096 +0200 +++ /home/jv/.emacs.d/hacknotmuch/notmuch-address-modified.el 2017-04-11 09:40:40.808693641 +0200 @@ -227,16 +227,16 @@ ((eq num-options 1) (car options)) (t - (funcall notmuch-address-selection-function - (format "Address (%s matches): " num-options) - ;; We put the first match as the initial - ;; input; we put all the matches as - ;; possible completions, moving the - ;; first match to the end of the list - ;; makes cursor up/down in the list work - ;; better. - (append (cdr options) (list (car options))) - (car options)))))) + (let ((_prompt (format "Address (%s matches): " num-options)) + (_collection (append (cdr options) (list (car options)))) + ;; offer different initiatial input to completing read in certain + ;; special global minor modes like ivy-mode. + ;; should be extended as to include ido etc. + (_initial_input (if (and (fboundp 'ivy-mode) ivy-mode) orig (car options)))) + (funcall notmuch-address-selection-function + _prompt + _collection + _initial_input)))))) (if chosen (progn (push chosen notmuch-address-history) Diff finished. Tue Apr 11 09:41:25 2017