From 0684376b791ef5fc652893d45c4866eac89268ec Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 29 Jun 2005 23:50:29 +0000 Subject: [PATCH] (set-variable): Warn about obsolete user variables. --- lisp/ChangeLog | 2 ++ lisp/simple.el | 33 ++++++++++++++++++++------------- 2 files changed, 22 insertions(+), 13 deletions(-) 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) -- 2.39.2