Commit 4b1434c2 authored by Erik Naggum's avatar Erik Naggum
Browse files

(set-variable): Use user-variable-p. Clean up.

parent 387ccace
...@@ -2979,15 +2979,14 @@ If you want VALUE to be a string, you must surround it with doublequotes. ...@@ -2979,15 +2979,14 @@ 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 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." it were the arg to `interactive' (which see) to interactively read the value."
(interactive (interactive
(let* ((var (let ((v (variable-at-point)) (let* ((v (variable-at-point))
(enable-recursive-minibuffers t) (enable-recursive-minibuffers t)
val) (val (completing-read
(setq val (completing-read (if v (if v
(format "Set variable (default %s): " v) (format "Set variable (default %s): " v)
"Set variable: ") "Set variable: ")
obarray 'boundp t)) obarray 'user-variable-p t))
(if (equal val "") (var (if (equal val "") v (intern val)))
v (intern val))))
(minibuffer-help-form (minibuffer-help-form
'(funcall myhelp)) '(funcall myhelp))
(myhelp (myhelp
......
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