Mercurial > emacs
comparison lispref/variables.texi @ 61729:bd6904d99629
(Variable Aliases): Describe make-obsolete-variable
and define-obsolete-variable-alias.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Fri, 22 Apr 2005 04:07:29 +0000 |
parents | ab86eb33656d |
children | 48375a96a41a |
comparison
equal
deleted
inserted
replaced
61728:5b01cec64cc9 | 61729:bd6904d99629 |
---|---|
1712 of the variable at the end of the chain of aliases. | 1712 of the variable at the end of the chain of aliases. |
1713 | 1713 |
1714 This function returns @var{base-var}. | 1714 This function returns @var{base-var}. |
1715 @end defun | 1715 @end defun |
1716 | 1716 |
1717 Variables aliases are often used prior to replacing an old name for a variable | |
1718 with a new name. To allow some time for existing code to adapt to this change, | |
1719 @code{make-obsolete-variable} declares that the old name is obsolete and | |
1720 therefore that it may be removed at some stage in the future. | |
1721 | |
1722 @defmac make-obsolete-variable variable new &optional when | |
1723 This macro makes the byte-compiler warn that symbol @var{variable} is | |
1724 obsolete and that symbol @var{new} should be used instead. If | |
1725 @var{new} is a string, this is the message and there is no replacement | |
1726 variable. If it is provided, @var{when} should be a string indicating | |
1727 when the variable was first made obsolete, for example a date or a | |
1728 release number. | |
1729 @end defmac | |
1730 | |
1731 You can make two variables synonyms and declare one obsolete at the | |
1732 same time using the macro @code{define-obsolete-variable-alias}. | |
1733 | |
1734 @defmac define-obsolete-variable-alias variable new &optional when docstring | |
1735 This macro defines the symbol @var{variable} as a variable alias for | |
1736 symbol @var{new} and warns that @var{variable} is obsolete. If it is | |
1737 provided, @var{when} should be a string indicating when @var{variable} | |
1738 was first made obsolete. The optional argument @var{docstring} | |
1739 specifies the documentation string for @var{variable}. If | |
1740 @var{docstring} is omitted or nil, @var{variable} uses the | |
1741 documentation string of @var{new} unless it already has one. | |
1742 @end defmac | |
1743 | |
1717 @defun indirect-variable variable | 1744 @defun indirect-variable variable |
1718 This function returns the variable at the end of the chain of aliases | 1745 This function returns the variable at the end of the chain of aliases |
1719 of @var{variable}. If @var{variable} is not a symbol, or if @var{variable} is | 1746 of @var{variable}. If @var{variable} is not a symbol, or if @var{variable} is |
1720 not defined as an alias, the function returns @var{variable}. | 1747 not defined as an alias, the function returns @var{variable}. |
1721 | 1748 |