From: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls
Date: Mon, 13 Apr 2020 21:58:19 +0200 [thread overview]
Message-ID: <m2r1wrxin8.fsf@gmail.com> (raw)
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 214e279f..079281c3 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -2559,7 +2559,7 @@ browsing."
(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)
--
2.26.0
next reply other threads:[~2020-04-13 19:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-13 19:58 Keegan Carruthers-Smith [this message]
2020-04-14 12:12 ` [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls David Edmondson
2020-04-16 11:12 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2r1wrxin8.fsf@gmail.com \
--to=keegan.csmith@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).