1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-06 20:49:33 +00:00

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

This commit is contained in:
Juanma Barranquero 2005-06-29 23:50:29 +00:00
parent bdf4ec93fd
commit 0684376b79
2 changed files with 22 additions and 13 deletions

View File

@ -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):

View File

@ -4538,22 +4538,29 @@ 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
;; Use VAR's `variable-interactive' property
;; as an interactive spec for prompting.
(call-interactively `(lambda (arg)
(interactive ,prop)
arg))
(read
(read-string prompt nil
'set-variable-value-history)))))
"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)
(interactive ,prop)
arg))
(read
(read-string prompt nil
'set-variable-value-history))))))
(list var val current-prefix-arg)))
(and (custom-variable-p variable)