mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-23 05:17:35 +00:00
(set-variable): Take default from `variable-at-point'.
This commit is contained in:
parent
fcd532ae81
commit
c51f4e0d2c
1 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue