1785 |
to keep the old name as an @emph{alias} of the new one for |
to keep the old name as an @emph{alias} of the new one for |
1786 |
compatibility. You can do this with @code{defvaralias}. |
compatibility. You can do this with @code{defvaralias}. |
1787 |
|
|
1788 |
@defun defvaralias alias-var base-var &optional docstring |
@defun defvaralias new-alias base-variable &optional docstring |
1789 |
This function defines the symbol @var{alias-var} as a variable alias |
This function defines the symbol @var{new-alias} as a variable alias |
1790 |
for symbol @var{base-var}. This means that retrieving the value of |
for symbol @var{base-variable}. This means that retrieving the value of |
1791 |
@var{alias-var} returns the value of @var{base-var}, and changing the |
@var{new-alias} returns the value of @var{base-variable}, and changing the |
1792 |
value of @var{alias-var} changes the value of @var{base-var}. |
value of @var{new-alias} changes the value of @var{base-variable}. |
1793 |
|
|
1794 |
If the @var{docstring} argument is non-@code{nil}, it specifies the |
If the @var{docstring} argument is non-@code{nil}, it specifies the |
1795 |
documentation for @var{alias-var}; otherwise, the alias gets the same |
documentation for @var{new-alias}; otherwise, the alias gets the same |
1796 |
documentation as @var{base-var} has, if any, unless @var{base-var} is |
documentation as @var{base-variable} has, if any, unless |
1797 |
itself an alias, in which case @var{alias-var} gets the documentation |
@var{base-variable} is itself an alias, in which case @var{new-alias} gets |
1798 |
of the variable at the end of the chain of aliases. |
the documentation of the variable at the end of the chain of aliases. |
1799 |
|
|
1800 |
This function returns @var{base-var}. |
This function returns @var{base-variable}. |
1801 |
@end defun |
@end defun |
1802 |
|
|
1803 |
Variable aliases are convenient for replacing an old name for a |
Variable aliases are convenient for replacing an old name for a |
1805 |
the old name is obsolete and therefore that it may be removed at some |
the old name is obsolete and therefore that it may be removed at some |
1806 |
stage in the future. |
stage in the future. |
1807 |
|
|
1808 |
@defun make-obsolete-variable variable new &optional when |
@defun make-obsolete-variable obsolete-name current-name &optional when |
1809 |
This function makes the byte-compiler warn that the variable |
This function makes the byte-compiler warn that the variable |
1810 |
@var{variable} is obsolete. If @var{new} is a symbol, it is the |
@var{obsolete-name} is obsolete. If @var{current-name} is a symbol, it is |
1811 |
variable's new name; then the warning message says to use @var{new} |
the variable's new name; then the warning message says to use |
1812 |
instead of @var{variable}. If @var{new} is a string, this is the |
@var{current-name} instead of @var{obsolete-name}. If @var{current-name} |
1813 |
message and there is no replacement variable. |
is a string, this is the message and there is no replacement variable. |
1814 |
|
|
1815 |
If provided, @var{when} should be a string indicating when the |
If provided, @var{when} should be a string indicating when the |
1816 |
variable was first made obsolete---for example, a date or a release |
variable was first made obsolete---for example, a date or a release |
1820 |
You can make two variables synonyms and declare one obsolete at the |
You can make two variables synonyms and declare one obsolete at the |
1821 |
same time using the macro @code{define-obsolete-variable-alias}. |
same time using the macro @code{define-obsolete-variable-alias}. |
1822 |
|
|
1823 |
@defmac define-obsolete-variable-alias variable new &optional when docstring |
@defmac define-obsolete-variable-alias obsolete-name current-name &optional when docstring |
1824 |
This macro marks the variable @var{variable} as obsolete and also |
This macro marks the variable @var{obsolete-name} as obsolete and also |
1825 |
makes it an alias for the variable @var{new}. A typical call has the form: |
makes it an alias for the variable @var{current-name}. A typical call has |
1826 |
|
the form: |
1827 |
|
|
1828 |
@example |
@example |
1829 |
(define-obsolete-variable-alias 'old-var 'new-var "22.1" "Doc.") |
(define-obsolete-variable-alias 'old-var 'new-var "22.1" "Doc.") |