diff options
| author | Nick Roberts | 2005-04-26 09:03:56 +0000 |
|---|---|---|
| committer | Nick Roberts | 2005-04-26 09:03:56 +0000 |
| commit | 0448b476012ef55ac026fcb7fcc0a75cff9f73bc (patch) | |
| tree | 1fad0509cb0b4fe4eafe6ef819932e83f39e69c8 /lisp | |
| parent | 35b1b8abe3d3833ecb4b4cee75b7340ffb707d65 (diff) | |
| download | emacs-0448b476012ef55ac026fcb7fcc0a75cff9f73bc.tar.gz emacs-0448b476012ef55ac026fcb7fcc0a75cff9f73bc.zip | |
(define-obsolete-function-alias): New macro.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/emacs-lisp/byte-run.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index ab7259b667f..5c92f247a05 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el | |||
| @@ -114,6 +114,18 @@ was first made obsolete, for example a date or a release number." | |||
| 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. |