From: Richard M. Stallman Date: Wed, 20 May 1998 03:54:58 +0000 (+0000) Subject: (set-variable): Offer variable at point as default. X-Git-Tag: emacs-20.3~920 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e9dfb72ec11018390e1b00d6bd3c151d82c94f94;p=emacs.git (set-variable): Offer variable at point as default. --- diff --git a/lisp/simple.el b/lisp/simple.el index ae4ce391110..e025788bb70 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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))