]> code.delx.au - gnu-emacs/blobdiff - lisp/byte-run.el
Doc fix.
[gnu-emacs] / lisp / byte-run.el
index b0bd59b98d118b3278552ad17e2701134c44fa98..8d5595a8b0a76b6e935151adcd617e3355e31c85 100644 (file)
@@ -1,4 +1,4 @@
-;; byte-run.el --- byte-compiler support for inlining
+;;; byte-run.el --- byte-compiler support for inlining
 
 ;; Copyright (C) 1992 Free Software Foundation, Inc.
 
@@ -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)))))
 
 \f