]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: use def instead of initial-input for notmuch-show-browse-urls
authorKeegan Carruthers-Smith <keegan.csmith@gmail.com>
Mon, 13 Apr 2020 19:58:19 +0000 (21:58 +0200)
committerDavid Bremner <david@tethera.net>
Tue, 14 Apr 2020 15:29:47 +0000 (12:29 -0300)
This is the non-deprecated way to use completing-read. Additionally
the old use was broken when using ivy for completing-read. For user's
using completing-read-default they won't see the default URL now, but
if they hit enter it will be visited. Alternatively they can select
it with M-n.

From the completing-read documentation for initial-input:

 This feature is deprecated--it is best to pass nil for INITIAL-INPUT
 and supply the default value DEF instead.  The user can yank the
 default value into the minibuffer easily using M-n.

Additionally collection is now all urls, rather than all but the
first. I'm not sure why "(cdr urls)" was previously done.

emacs/notmuch-show.el

index 214e279fde2af643762f26b39138088e5e3217d6..079281c341f0ea433d569d441f592ccea8058db6 100644 (file)
@@ -2559,7 +2559,7 @@ browsing."
        (prompt (if kill "Copy URL to kill ring: " "Browse URL: "))
        (fn (if kill #'kill-new #'browse-url)))
     (if urls
        (prompt (if kill "Copy URL to kill ring: " "Browse URL: "))
        (fn (if kill #'kill-new #'browse-url)))
     (if urls
-       (funcall fn (completing-read prompt (cdr urls) nil nil (car urls)))
+       (funcall fn (completing-read prompt urls nil nil nil nil (car urls)))
       (message "No URLs found."))))
 
 (provide 'notmuch-show)
       (message "No URLs found."))))
 
 (provide 'notmuch-show)