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