branch: externals/cursory commit 0c8c41cff2302d91140348428e35e6d69a271558 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Refine default value of prompt Use the previous one from the history, if available. --- cursory.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cursory.el b/cursory.el index 93944ce3ce..d61a8ec2b3 100644 --- a/cursory.el +++ b/cursory.el @@ -146,10 +146,13 @@ Saving is done by the `cursory-store-latest-preset' function." (defun cursory--set-cursor-prompt () "Promp for `cursory-presets' (used by `cursory-set-preset')." - (let ((def (nth 1 cursory--style-hist))) + (let* ((def (nth 1 cursory--style-hist)) + (prompt (if def + (format "Apply cursor configurations from PRESET [%s]: " def) + "Apply cursor configurations from PRESET: "))) (completing-read - (format "Select cursor STYLE [%s]: " def) (mapcar #'car cursory-presets) + prompt nil t nil 'cursory--style-hist def))) ;;;###autoload