]> git.eshelyaron.com Git - emacs.git/commitdiff
(set-variable): Take default from `variable-at-point'.
authorRichard M. Stallman <rms@gnu.org>
Thu, 27 Mar 1997 00:25:39 +0000 (00:25 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 27 Mar 1997 00:25:39 +0000 (00:25 +0000)
lisp/simple.el

index 7f8aa1deff0fb43f51b9bcf2035feae9d5f58c7c..3b7913ff75359c1115fc4ef93641b3c56e98c114 100644 (file)
@@ -2979,7 +2979,15 @@ If you want VALUE to be a string, you must surround it with doublequotes.
 If VARIABLE has a `variable-interactive' property, that is used as if
 it were the arg to `interactive' (which see) to interactively read the value."
   (interactive
-   (let* ((var (read-variable "Set variable: "))
+   (let* ((var (let ((v (variable-at-point))
+                    (enable-recursive-minibuffers t)
+                    val)
+                (setq val (completing-read (if v
+                                               (format "Set variable (default %s): " v)
+                                             "Set variable: ")
+                                           obarray 'boundp t))
+                (if (equal val "")
+                    v (intern val))))
          (minibuffer-help-form
           '(funcall myhelp))
          (myhelp