changeset 17251:0e39c85743af

(set-variable): Take default from `variable-at-point'.
author Richard M. Stallman <rms@gnu.org>
date Thu, 27 Mar 1997 00:25:39 +0000
parents 68dcc3ebe342
children fb59cd650fa1
files lisp/simple.el
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Wed Mar 26 07:36:48 1997 +0000
+++ b/lisp/simple.el	Thu Mar 27 00:25:39 1997 +0000
@@ -2979,7 +2979,15 @@
 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