branch: master commit 27763580be79d9f9539beb21c1a6070d04bc868b Author: Kaushal Modi <kaushal.m...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
Show current value of the variable in the prompt * counsel-set-variable: The current value of the selected variable is now also shown in the prompt, between the ‹..› brackets. That way, the current value of the variable is more explicit to the user. Fixes #546 --- counsel.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/counsel.el b/counsel.el index c62c666..c4a3174 100644 --- a/counsel.el +++ b/counsel.el @@ -538,9 +538,10 @@ input corresponding to the chosen variable." ((eq sym-type 'boolean) (setq cands '(("nil" . nil) ("t" . t)))) (t nil))) - (let ((res (ivy-read (format "Set (%S): " sym) + (let* ((sym-val (symbol-value sym)) + (res (ivy-read (format "Set (%S <%s>): " sym sym-val) cands - :preselect (prin1-to-string (symbol-value sym))))) + :preselect (prin1-to-string sym-val)))) (when res (setq res (if (assoc res cands)