From: Juanma Barranquero Date: Wed, 29 Jun 2005 23:50:29 +0000 (+0000) Subject: (set-variable): Warn about obsolete user variables. X-Git-Tag: emacs-pretest-22.0.90~8556 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0684376b791ef5fc652893d45c4866eac89268ec;p=emacs.git (set-variable): Warn about obsolete user variables. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c5b8f56c074..67d7d79e2cb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -14,6 +14,8 @@ 2005-06-29 Juanma Barranquero + * 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): diff --git a/lisp/simple.el b/lisp/simple.el index b8dc0a7df9d..d0dcbbfc42c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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)