]> git.eshelyaron.com Git - emacs.git/commitdiff
(set-variable): Offer variable at point as default.
authorRichard M. Stallman <rms@gnu.org>
Wed, 20 May 1998 03:54:58 +0000 (03:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 20 May 1998 03:54:58 +0000 (03:54 +0000)
lisp/simple.el

index ae4ce3911101d0cff992077413e7ccfcab3f647b..e025788bb70416c7426ba13442b6b1291fd6a790 100644 (file)
@@ -3549,7 +3549,12 @@ it were the arg to `interactive' (which see) to interactively read VALUE.
 
 If VARIABLE has been defined with `defcustom', then the type information
 in the definition is used to check that VALUE is valid."
-  (interactive (let* ((var (read-variable "Set variable: "))
+  (interactive
+   (let* ((default-var (variable-at-point))
+          (var (if (symbolp default-var)
+                   (read-variable (format "Set variable (default %s): " default-var)
+                                  default-var)
+                 (read-variable "Set variable: ")))
                      (minibuffer-help-form '(describe-variable var))
                      (prop (get var 'variable-interactive))
                      (prompt (format "Set %s to value: " var))