Mercurial > emacs
comparison lisp/emacs-lisp/byte-run.el @ 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 | d4e4e1694bf8 |
children | 39ca2515a39d 08185296b491 |
comparison
equal
deleted
inserted
replaced
61842:0e4683c3074a | 61843:a158628ce6ac |
---|---|
112 (setq handler (nth 1 (get function 'byte-obsolete-info))) | 112 (setq handler (nth 1 (get function 'byte-obsolete-info))) |
113 (put function 'byte-compile 'byte-compile-obsolete)) | 113 (put function 'byte-compile 'byte-compile-obsolete)) |
114 (put function 'byte-obsolete-info (list new handler when))) | 114 (put function 'byte-obsolete-info (list new handler when))) |
115 function) | 115 function) |
116 | 116 |
117 (defmacro define-obsolete-function-alias (function new | |
118 &optional when docstring) | |
119 "Set FUNCTION's function definition to NEW and warn that FUNCTION is obsolete. | |
120 If provided, WHEN should be a string indicating when FUNCTION was | |
121 first made obsolete, for example a date or a release number. The | |
122 optional argument DOCSTRING specifies the documentation string | |
123 for FUNCTION; if DOCSTRING is omitted or nil, FUNCTION uses the | |
124 documentation string of NEW unluess it already has one." | |
125 `(progn | |
126 (defalias ,function ,new ,docstring) | |
127 (make-obsolete ,function ,new ,when))) | |
128 | |
117 (defun make-obsolete-variable (variable new &optional when) | 129 (defun make-obsolete-variable (variable new &optional when) |
118 "Make the byte-compiler warn that VARIABLE is obsolete. | 130 "Make the byte-compiler warn that VARIABLE is obsolete. |
119 The warning will say that NEW should be used instead. | 131 The warning will say that NEW should be used instead. |
120 If NEW is a string, that is the `use instead' message. | 132 If NEW is a string, that is the `use instead' message. |
121 If provided, WHEN should be a string indicating when the variable | 133 If provided, WHEN should be a string indicating when the variable |