mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-13 09:32:47 +00:00
(define-obsolete-function-alias): New macro.
This commit is contained in:
parent
35b1b8abe3
commit
0448b47601
@ -114,6 +114,18 @@ was first made obsolete, for example a date or a release number."
|
|||||||
(put function 'byte-obsolete-info (list new handler when)))
|
(put function 'byte-obsolete-info (list new handler when)))
|
||||||
function)
|
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)
|
(defun make-obsolete-variable (variable new &optional when)
|
||||||
"Make the byte-compiler warn that VARIABLE is obsolete.
|
"Make the byte-compiler warn that VARIABLE is obsolete.
|
||||||
The warning will say that NEW should be used instead.
|
The warning will say that NEW should be used instead.
|
||||||
|
Loading…
Reference in New Issue
Block a user