aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuanma Barranquero2005-06-29 23:50:29 +0000
committerJuanma Barranquero2005-06-29 23:50:29 +0000
commit0684376b791ef5fc652893d45c4866eac89268ec (patch)
treedee31d3f81f2239b6835a3f84d0a39dce4104cb4 /lisp
parentbdf4ec93fdb64406d1ec76811bef2420e785db26 (diff)
downloademacs-0684376b791ef5fc652893d45c4866eac89268ec.tar.gz
emacs-0684376b791ef5fc652893d45c4866eac89268ec.zip
(set-variable): Warn about obsolete user variables.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/simple.el33
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 @@
14 14
152005-06-29 Juanma Barranquero <lekktu@gmail.com> 152005-06-29 Juanma Barranquero <lekktu@gmail.com>
16 16
17 * simple.el (set-variable): Warn about obsolete user variables.
18
17 * imenu.el (imenu--completion-buffer): 19 * imenu.el (imenu--completion-buffer):
18 * mouse.el (mouse-buffer-menu-alist): 20 * mouse.el (mouse-buffer-menu-alist):
19 * msb.el (msb-invisible-buffer-p): 21 * 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."
4538 (read-variable "Set variable: "))) 4538 (read-variable "Set variable: ")))
4539 (minibuffer-help-form '(describe-variable var)) 4539 (minibuffer-help-form '(describe-variable var))
4540 (prop (get var 'variable-interactive)) 4540 (prop (get var 'variable-interactive))
4541 (prompt (format "Set %s%s to value: " var 4541 (obsolete (car (get var 'byte-obsolete-variable)))
4542 (prompt (format "Set %s %s to value: " var
4542 (cond ((local-variable-p var) 4543 (cond ((local-variable-p var)
4543 " (buffer-local)") 4544 "(buffer-local)")
4544 ((or current-prefix-arg 4545 ((or current-prefix-arg
4545 (local-variable-if-set-p var)) 4546 (local-variable-if-set-p var))
4546 " buffer-locally") 4547 "buffer-locally")
4547 (t " globally")))) 4548 (t "globally"))))
4548 (val (if prop 4549 (val (progn
4549 ;; Use VAR's `variable-interactive' property 4550 (when obsolete
4550 ;; as an interactive spec for prompting. 4551 (message (concat "`%S' is obsolete; "
4551 (call-interactively `(lambda (arg) 4552 (if (symbolp obsolete) "use `%S' instead" "%s"))
4552 (interactive ,prop) 4553 var obsolete)
4553 arg)) 4554 (sit-for 3))
4554 (read 4555 (if prop
4555 (read-string prompt nil 4556 ;; Use VAR's `variable-interactive' property
4556 'set-variable-value-history))))) 4557 ;; as an interactive spec for prompting.
4558 (call-interactively `(lambda (arg)
4559 (interactive ,prop)
4560 arg))
4561 (read
4562 (read-string prompt nil
4563 'set-variable-value-history))))))
4557 (list var val current-prefix-arg))) 4564 (list var val current-prefix-arg)))
4558 4565
4559 (and (custom-variable-p variable) 4566 (and (custom-variable-p variable)