changeset 66281:3213e48ea8b3

(set-variable): Use user-variable-p instead of symbolp. Add the old variable value as 4th default-value arg of read-string.
author Juri Linkov <juri@jurta.org>
date Fri, 21 Oct 2005 08:55:12 +0000
parents 843776c843bf
children 5f52c9ace731
files lisp/simple.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Fri Oct 21 08:50:28 2005 +0000
+++ b/lisp/simple.el	Fri Oct 21 08:55:12 2005 +0000
@@ -4572,10 +4572,10 @@
 With a prefix argument, set VARIABLE to VALUE buffer-locally."
   (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: ")))
+          (var (if (user-variable-p 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))
           (obsolete (car (get var 'byte-obsolete-variable)))
@@ -4600,7 +4600,8 @@
                                             arg))
                    (read
                     (read-string prompt nil
-                                 'set-variable-value-history))))))
+                                 'set-variable-value-history
+				 (format "%S" (symbol-value var))))))))
      (list var val current-prefix-arg)))
 
   (and (custom-variable-p variable)