Commit e9dfb72e authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(set-variable): Offer variable at point as default.

parent e9cccb71
...@@ -3549,7 +3549,12 @@ it were the arg to `interactive' (which see) to interactively read VALUE. ...@@ -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 If VARIABLE has been defined with `defcustom', then the type information
in the definition is used to check that VALUE is valid." 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)) (minibuffer-help-form '(describe-variable var))
(prop (get var 'variable-interactive)) (prop (get var 'variable-interactive))
(prompt (format "Set %s to value: " var)) (prompt (format "Set %s to value: " var))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment