Commit 0684376b authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

(set-variable): Warn about obsolete user variables.

parent bdf4ec93
......@@ -14,6 +14,8 @@
 
2005-06-29 Juanma Barranquero <lekktu@gmail.com>
 
* simple.el (set-variable): Warn about obsolete user variables.
* imenu.el (imenu--completion-buffer):
* mouse.el (mouse-buffer-menu-alist):
* msb.el (msb-invisible-buffer-p):
......
......@@ -4538,14 +4538,21 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
(read-variable "Set variable: ")))
(minibuffer-help-form '(describe-variable var))
(prop (get var 'variable-interactive))
(prompt (format "Set %s%s to value: " var
(obsolete (car (get var 'byte-obsolete-variable)))
(prompt (format "Set %s %s to value: " var
(cond ((local-variable-p var)
" (buffer-local)")
"(buffer-local)")
((or current-prefix-arg
(local-variable-if-set-p var))
" buffer-locally")
(t " globally"))))
(val (if prop
"buffer-locally")
(t "globally"))))
(val (progn
(when obsolete
(message (concat "`%S' is obsolete; "
(if (symbolp obsolete) "use `%S' instead" "%s"))
var obsolete)
(sit-for 3))
(if prop
;; Use VAR's `variable-interactive' property
;; as an interactive spec for prompting.
(call-interactively `(lambda (arg)
......@@ -4553,7 +4560,7 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
arg))
(read
(read-string prompt nil
'set-variable-value-history)))))
'set-variable-value-history))))))
(list var val current-prefix-arg)))
(and (custom-variable-p variable)
......
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