unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls
@ 2020-04-13 19:58 Keegan Carruthers-Smith
  2020-04-14 12:12 ` David Edmondson
  2020-04-16 11:12 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Keegan Carruthers-Smith @ 2020-04-13 19:58 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls
  2020-04-13 19:58 [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls Keegan Carruthers-Smith
@ 2020-04-14 12:12 ` David Edmondson
  2020-04-16 11:12 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Edmondson @ 2020-04-14 12:12 UTC (permalink / raw)
  To: Keegan Carruthers-Smith, notmuch

On Monday, 2020-04-13 at 21:58:19 +02, Keegan Carruthers-Smith wrote:

> 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.

Reviewed-by: David Edmondson <dme@dme.org>

> ---
>  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
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

dme.
-- 
I used to worry, thought I was goin' mad in a hurry.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls
  2020-04-13 19:58 [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls Keegan Carruthers-Smith
  2020-04-14 12:12 ` David Edmondson
@ 2020-04-16 11:12 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2020-04-16 11:12 UTC (permalink / raw)
  To: Keegan Carruthers-Smith, notmuch

Keegan Carruthers-Smith <keegan.csmith@gmail.com> writes:

> 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.

pushed,

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-16 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 19:58 [PATCH] emacs: use def instead of initial-input for notmuch-show-browse-urls Keegan Carruthers-Smith
2020-04-14 12:12 ` David Edmondson
2020-04-16 11:12 ` David Bremner

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).