Remove define-obsolete-*-alias fix
Packages have had enough time to catch up. Also, with 9d3742c0d these fixes are no longer effective for packages. Closes #4534
This commit is contained in:
parent
fb89327ff2
commit
dee20c7585
1 changed files with 0 additions and 67 deletions
|
@ -692,72 +692,5 @@ the value of the variable `exec-path'."
|
||||||
(funcall handler 'exec-path)
|
(funcall handler 'exec-path)
|
||||||
exec-path))))
|
exec-path))))
|
||||||
|
|
||||||
;; DEPRECATED Remove once enough packages have adapted to these breaking changes.
|
|
||||||
(eval-when! EMACS28+
|
|
||||||
(defmacro define-obsolete-variable-alias (obsolete-name current-name &optional when docstring)
|
|
||||||
"Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
|
|
||||||
|
|
||||||
WHEN should be a string indicating when the variable was first
|
|
||||||
made obsolete, for example a date or a release number.
|
|
||||||
|
|
||||||
This macro evaluates all its parameters, and both OBSOLETE-NAME
|
|
||||||
and CURRENT-NAME should be symbols, so a typical usage would look like:
|
|
||||||
|
|
||||||
(define-obsolete-variable-alias 'foo-thing 'bar-thing \"27.1\")
|
|
||||||
|
|
||||||
This macro uses `defvaralias' and `make-obsolete-variable' (which see).
|
|
||||||
See the Info node `(elisp)Variable Aliases' for more details.
|
|
||||||
|
|
||||||
If CURRENT-NAME is a defcustom or a defvar (more generally, any variable
|
|
||||||
where OBSOLETE-NAME may be set, e.g. in an init file, before the
|
|
||||||
alias is defined), then the define-obsolete-variable-alias
|
|
||||||
statement should be evaluated before the defcustom, if user
|
|
||||||
customizations are to be respected. The simplest way to achieve
|
|
||||||
this is to place the alias statement before the defcustom (this
|
|
||||||
is not necessary for aliases that are autoloaded, or in files
|
|
||||||
dumped with Emacs). This is so that any user customizations are
|
|
||||||
applied before the defcustom tries to initialize the
|
|
||||||
variable (this is due to the way `defvaralias' works).
|
|
||||||
|
|
||||||
For the benefit of Customize, if OBSOLETE-NAME has
|
|
||||||
any of the following properties, they are copied to
|
|
||||||
CURRENT-NAME, if it does not already have them:
|
|
||||||
`saved-value', `saved-variable-comment'."
|
|
||||||
(declare (doc-string 4)
|
|
||||||
(advertised-calling-convention
|
|
||||||
(obsolete-name current-name when &optional docstring) "23.1"))
|
|
||||||
`(progn
|
|
||||||
(defvaralias ,obsolete-name ,current-name ,docstring)
|
|
||||||
(dolist (prop '(saved-value saved-variable-comment))
|
|
||||||
(and (get ,obsolete-name prop)
|
|
||||||
(null (get ,current-name prop))
|
|
||||||
(put ,current-name prop (get ,obsolete-name prop))))
|
|
||||||
(make-obsolete-variable ,obsolete-name ,current-name ,when)))
|
|
||||||
|
|
||||||
(defmacro define-obsolete-face-alias (obsolete-face current-face &optional when)
|
|
||||||
"Make OBSOLETE-FACE a face alias for CURRENT-FACE and mark it obsolete.
|
|
||||||
WHEN should be a string indicating when the face was first made
|
|
||||||
obsolete, for example a date or a release number."
|
|
||||||
`(progn (put ,obsolete-face 'face-alias ,current-face)
|
|
||||||
(put ,obsolete-face 'obsolete-face (or (purecopy ,when) t))))
|
|
||||||
|
|
||||||
(defmacro define-obsolete-function-alias (obsolete-name current-name &optional when docstring)
|
|
||||||
"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.\")
|
|
||||||
|
|
||||||
is equivalent to the following two lines of code:
|
|
||||||
|
|
||||||
\(defalias \\='old-fun \\='new-fun \"old-fun's doc.\")
|
|
||||||
\(make-obsolete \\='old-fun \\='new-fun \"22.1\")
|
|
||||||
|
|
||||||
WHEN should be a string indicating when the function was first
|
|
||||||
made obsolete, for example a date or a release number.
|
|
||||||
|
|
||||||
See the docstrings of `defalias' and `make-obsolete' for more details."
|
|
||||||
(declare (doc-string 4))
|
|
||||||
`(progn (defalias ,obsolete-name ,current-name ,docstring)
|
|
||||||
(make-obsolete ,obsolete-name ,current-name ,when))))
|
|
||||||
|
|
||||||
(provide 'core-lib)
|
(provide 'core-lib)
|
||||||
;;; core-lib.el ends here
|
;;; core-lib.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue