mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 14:30:50 -08:00
* lisp/emacs-lisp/byte-run.el (make-obsolete): Make when mandatory
(define-obsolete-function-alias, make-obsolete-variable) (define-obsolete-variable-alias): Adjust similarly.
This commit is contained in:
parent
632917461a
commit
32c6732d16
2 changed files with 15 additions and 20 deletions
6
etc/NEWS
6
etc/NEWS
|
|
@ -2019,6 +2019,12 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
|
||||||
'vcursor-toggle-vcursor-map', 'w32-focus-frame', 'w32-select-font',
|
'vcursor-toggle-vcursor-map', 'w32-focus-frame', 'w32-select-font',
|
||||||
'wisent-lex-make-token-table'.
|
'wisent-lex-make-token-table'.
|
||||||
|
|
||||||
|
** The 'when' argument of `make-obsolete` and related functions is mandatory.
|
||||||
|
The use of those functions without a 'when' argument was marked
|
||||||
|
obsolete back in Emacs-23.1. The affected functions are:
|
||||||
|
make-obsolete, define-obsolete-function-alias, make-obsolete-variable,
|
||||||
|
define-obsolete-variable-alias.
|
||||||
|
|
||||||
|
|
||||||
* Lisp Changes in Emacs 28.1
|
* Lisp Changes in Emacs 28.1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,7 @@ convention was modified."
|
||||||
(puthash (indirect-function function) signature
|
(puthash (indirect-function function) signature
|
||||||
advertised-signature-table))
|
advertised-signature-table))
|
||||||
|
|
||||||
(defun make-obsolete (obsolete-name current-name &optional when)
|
(defun make-obsolete (obsolete-name current-name when)
|
||||||
"Make the byte-compiler warn that function OBSOLETE-NAME is obsolete.
|
"Make the byte-compiler warn that function OBSOLETE-NAME is obsolete.
|
||||||
OBSOLETE-NAME should be a function name or macro name (a symbol).
|
OBSOLETE-NAME should be a function name or macro name (a symbol).
|
||||||
|
|
||||||
|
|
@ -381,17 +381,14 @@ If CURRENT-NAME is a string, that is the `use instead' message
|
||||||
\(it should end with a period, and not start with a capital).
|
\(it should end with a period, and not start with a capital).
|
||||||
WHEN should be a string indicating when the function
|
WHEN should be a string indicating when the function
|
||||||
was first made obsolete, for example a date or a release number."
|
was first made obsolete, for example a date or a release number."
|
||||||
(declare (advertised-calling-convention
|
|
||||||
;; New code should always provide the `when' argument.
|
|
||||||
(obsolete-name current-name when) "23.1"))
|
|
||||||
(put obsolete-name 'byte-obsolete-info
|
(put obsolete-name 'byte-obsolete-info
|
||||||
;; The second entry used to hold the `byte-compile' handler, but
|
;; The second entry used to hold the `byte-compile' handler, but
|
||||||
;; is not used any more nowadays.
|
;; is not used any more nowadays.
|
||||||
(purecopy (list current-name nil when)))
|
(purecopy (list current-name nil when)))
|
||||||
obsolete-name)
|
obsolete-name)
|
||||||
|
|
||||||
(defmacro define-obsolete-function-alias (obsolete-name current-name
|
(defmacro define-obsolete-function-alias ( obsolete-name current-name when
|
||||||
&optional when docstring)
|
&optional docstring)
|
||||||
"Set OBSOLETE-NAME's function definition to CURRENT-NAME and mark it obsolete.
|
"Set OBSOLETE-NAME's function definition to CURRENT-NAME and mark it obsolete.
|
||||||
|
|
||||||
\(define-obsolete-function-alias \\='old-fun \\='new-fun \"22.1\" \"old-fun's doc.\")
|
\(define-obsolete-function-alias \\='old-fun \\='new-fun \"22.1\" \"old-fun's doc.\")
|
||||||
|
|
@ -405,15 +402,13 @@ WHEN should be a string indicating when the function was first
|
||||||
made obsolete, for example a date or a release number.
|
made obsolete, for example a date or a release number.
|
||||||
|
|
||||||
See the docstrings of `defalias' and `make-obsolete' for more details."
|
See the docstrings of `defalias' and `make-obsolete' for more details."
|
||||||
(declare (doc-string 4)
|
(declare (doc-string 4))
|
||||||
(advertised-calling-convention
|
|
||||||
;; New code should always provide the `when' argument.
|
|
||||||
(obsolete-name current-name when &optional docstring) "23.1"))
|
|
||||||
`(progn
|
`(progn
|
||||||
(defalias ,obsolete-name ,current-name ,docstring)
|
(defalias ,obsolete-name ,current-name ,docstring)
|
||||||
(make-obsolete ,obsolete-name ,current-name ,when)))
|
(make-obsolete ,obsolete-name ,current-name ,when)))
|
||||||
|
|
||||||
(defun make-obsolete-variable (obsolete-name current-name &optional when access-type)
|
(defun make-obsolete-variable ( obsolete-name current-name when
|
||||||
|
&optional access-type)
|
||||||
"Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
|
"Make the byte-compiler warn that OBSOLETE-NAME is obsolete.
|
||||||
The warning will say that CURRENT-NAME should be used instead.
|
The warning will say that CURRENT-NAME should be used instead.
|
||||||
If CURRENT-NAME is a string, that is the `use instead' message.
|
If CURRENT-NAME is a string, that is the `use instead' message.
|
||||||
|
|
@ -421,16 +416,13 @@ WHEN should be a string indicating when the variable
|
||||||
was first made obsolete, for example a date or a release number.
|
was first made obsolete, for example a date or a release number.
|
||||||
ACCESS-TYPE if non-nil should specify the kind of access that will trigger
|
ACCESS-TYPE if non-nil should specify the kind of access that will trigger
|
||||||
obsolescence warnings; it can be either `get' or `set'."
|
obsolescence warnings; it can be either `get' or `set'."
|
||||||
(declare (advertised-calling-convention
|
|
||||||
;; New code should always provide the `when' argument.
|
|
||||||
(obsolete-name current-name when &optional access-type) "23.1"))
|
|
||||||
(put obsolete-name 'byte-obsolete-variable
|
(put obsolete-name 'byte-obsolete-variable
|
||||||
(purecopy (list current-name access-type when)))
|
(purecopy (list current-name access-type when)))
|
||||||
obsolete-name)
|
obsolete-name)
|
||||||
|
|
||||||
|
|
||||||
(defmacro define-obsolete-variable-alias (obsolete-name current-name
|
(defmacro define-obsolete-variable-alias ( obsolete-name current-name when
|
||||||
&optional when docstring)
|
&optional docstring)
|
||||||
"Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
|
"Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
|
||||||
|
|
||||||
WHEN should be a string indicating when the variable was first
|
WHEN should be a string indicating when the variable was first
|
||||||
|
|
@ -459,10 +451,7 @@ For the benefit of Customize, if OBSOLETE-NAME has
|
||||||
any of the following properties, they are copied to
|
any of the following properties, they are copied to
|
||||||
CURRENT-NAME, if it does not already have them:
|
CURRENT-NAME, if it does not already have them:
|
||||||
`saved-value', `saved-variable-comment'."
|
`saved-value', `saved-variable-comment'."
|
||||||
(declare (doc-string 4)
|
(declare (doc-string 4))
|
||||||
(advertised-calling-convention
|
|
||||||
;; New code should always provide the `when' argument.
|
|
||||||
(obsolete-name current-name when &optional docstring) "23.1"))
|
|
||||||
`(progn
|
`(progn
|
||||||
(defvaralias ,obsolete-name ,current-name ,docstring)
|
(defvaralias ,obsolete-name ,current-name ,docstring)
|
||||||
;; See Bug#4706.
|
;; See Bug#4706.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue