Fix default selection when there's only one candidate

This commit is contained in:
Bram Schoenmakers 2024-02-08 06:59:40 +01:00
parent a450dcda8c
commit 5b2b3b78de
Signed by: bram
GPG Key ID: 0CCD19DFDC63258F
2 changed files with 2 additions and 2 deletions

View File

@ -792,7 +792,7 @@ Based on an answer at the [[https://emacs.stackexchange.com/a/77480/34645][Emacs
(let* ((prompt (format-prompt "URL" ""))
(candidate-urls (-non-nil (mapcar #'funcall my/denote/url-functions)))
(url (if (eql 1 (length candidate-urls))
(read-string prompt (car candidate-urls))
(read-string prompt (caar candidate-urls))
(completing-read prompt candidate-urls))))
;; `candidate-urls' is a mix of strings and cons

View File

@ -60,7 +60,7 @@ looking at the <title> tags."
(let* ((prompt (format-prompt "URL" ""))
(candidate-urls (-non-nil (mapcar #'funcall my/denote/url-functions)))
(url (if (eql 1 (length candidate-urls))
(read-string prompt (car candidate-urls))
(read-string prompt (caar candidate-urls))
(completing-read prompt candidate-urls))))
;; `candidate-urls' is a mix of strings and cons