changeset 61843:a158628ce6ac

(define-obsolete-function-alias): New macro.
author Nick Roberts <nickrob@snap.net.nz>
date Tue, 26 Apr 2005 09:03:56 +0000
parents 0e4683c3074a
children 5a74af829774
files lisp/emacs-lisp/byte-run.el
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/byte-run.el	Tue Apr 26 05:56:22 2005 +0000
+++ b/lisp/emacs-lisp/byte-run.el	Tue Apr 26 09:03:56 2005 +0000
@@ -114,6 +114,18 @@
     (put function 'byte-obsolete-info (list new handler when)))
   function)
 
+(defmacro define-obsolete-function-alias (function new
+						   &optional when docstring)
+  "Set FUNCTION's function definition to NEW and warn that FUNCTION is obsolete.
+If provided, WHEN should be a string indicating when FUNCTION was
+first made obsolete, for example a date or a release number.  The
+optional argument DOCSTRING specifies the documentation string
+for FUNCTION; if DOCSTRING is omitted or nil, FUNCTION uses the
+documentation string of NEW unluess it already has one."
+  `(progn
+     (defalias ,function ,new ,docstring)
+     (make-obsolete ,function ,new ,when)))
+
 (defun make-obsolete-variable (variable new &optional when)
   "Make the byte-compiler warn that VARIABLE is obsolete.
 The warning will say that NEW should be used instead.