From 5b2b3b78de12b4b0285ba9f08ad025eb804cca60 Mon Sep 17 00:00:00 2001 From: Bram Schoenmakers Date: Thu, 8 Feb 2024 06:59:40 +0100 Subject: [PATCH] Fix default selection when there's only one candidate --- gists.org | 2 +- gists/denote-create-note-url.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gists.org b/gists.org index 3559645..00a9960 100644 --- a/gists.org +++ b/gists.org @@ -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 diff --git a/gists/denote-create-note-url.el b/gists/denote-create-note-url.el index 01022dc..3fc15e7 100644 --- a/gists/denote-create-note-url.el +++ b/gists/denote-create-note-url.el @@ -60,7 +60,7 @@ looking at the 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