]> git.eshelyaron.com Git - emacs.git/commitdiff
(set-variable): Warn about obsolete user variables.
authorJuanma Barranquero <lekktu@gmail.com>
Wed, 29 Jun 2005 23:50:29 +0000 (23:50 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Wed, 29 Jun 2005 23:50:29 +0000 (23:50 +0000)
lisp/ChangeLog
lisp/simple.el

index c5b8f56c0746fa9f8b490a88528af3b7296f676d..67d7d79e2cb1867e282b247f3bae95865055709e 100644 (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):
index b8dc0a7df9de10ea8734b3fe47754065ba201a69..d0dcbbfc42ccc9a1e352aaf696a1c9c1b9ff59f9 100644 (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)