aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/byte-run.el
diff options
context:
space:
mode:
authorJim Blandy <[email protected]>1992-08-12 12:50:10 +0000
committerJim Blandy <[email protected]>1992-08-12 12:50:10 +0000
commit7e1dae733a5eda79d5681349ca39bfc36ca27871 (patch)
treeac88eef920fb50a8ece8593ee46a8f46160e6311 /lisp/byte-run.el
parent9f34a2a0c82e7323e825471b10b54fa60ea8859f (diff)
entered into RCS
Diffstat (limited to 'lisp/byte-run.el')
-rw-r--r--lisp/byte-run.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/lisp/byte-run.el b/lisp/byte-run.el
index b0bd59b98d..1a09ec6ac1 100644
--- a/lisp/byte-run.el
+++ b/lisp/byte-run.el
@@ -86,9 +86,23 @@ If NEW is a string, that is the `use instead' message."
(put fn 'byte-compile 'byte-compile-obsolete)))
fn)
+(defun make-obsolete-variable (var new)
+ "Make the byte-compiler warn that VARIABLE is obsolete,
+and NEW should be used instead. If NEW is a string, then that is the
+`use instead' message."
+ (interactive
+ (list
+ (let ((str (completing-read "Make variable obsolete: " obarray 'boundp t)))
+ (if (equal str "") (error ""))
+ (intern str))
+ (car (read-from-string (read-string "Obsoletion replacement: ")))))
+ (put var 'byte-obsolete-variable new)
+ var)
+
(put 'dont-compile 'lisp-indent-hook 0)
(defmacro dont-compile (&rest body)
- "Like `progn', but the body always runs interpreted (not compiled)."
+ "Like `progn', but the body always runs interpreted (not compiled).
+If you think you need this, you're probably making a mistake somewhere."
(list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))