emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 2776358 059/348: Show current value of the variable in the


From: Oleh Krehel
Subject: [elpa] master 2776358 059/348: Show current value of the variable in the prompt
Date: Sat, 8 Apr 2017 11:03:24 -0400 (EDT)

branch: master
commit 27763580be79d9f9539beb21c1a6070d04bc868b
Author: Kaushal Modi <address@hidden>
Commit: Oleh Krehel <address@hidden>

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]