Mercurial > emacs
comparison lispref/variables.texi @ 63478:755286b69925
(Variable Aliases): Update argument names of `defvaralias',
`make-obsolete-variable' and `define-obsolete-variable-alias'.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Wed, 15 Jun 2005 23:10:54 +0000 |
parents | fbbfd824228f |
children | 5565eb3af021 82d495f87e7b |
comparison
equal
deleted
inserted
replaced
63477:f0e4b6c7de96 | 63478:755286b69925 |
---|---|
1783 variable---either because you realize its old name was not well | 1783 variable---either because you realize its old name was not well |
1784 chosen, or because its meaning has partly changed---it can be useful | 1784 chosen, or because its meaning has partly changed---it can be useful |
1785 to keep the old name as an @emph{alias} of the new one for | 1785 to keep the old name as an @emph{alias} of the new one for |
1786 compatibility. You can do this with @code{defvaralias}. | 1786 compatibility. You can do this with @code{defvaralias}. |
1787 | 1787 |
1788 @defun defvaralias alias-var base-var &optional docstring | 1788 @defun defvaralias new-alias base-variable &optional docstring |
1789 This function defines the symbol @var{alias-var} as a variable alias | 1789 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 | 1790 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 | 1791 @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}. | 1792 value of @var{new-alias} changes the value of @var{base-variable}. |
1793 | 1793 |
1794 If the @var{docstring} argument is non-@code{nil}, it specifies the | 1794 If the @var{docstring} argument is non-@code{nil}, it specifies the |
1795 documentation for @var{alias-var}; otherwise, the alias gets the same | 1795 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 | 1796 documentation as @var{base-variable} has, if any, unless |
1797 itself an alias, in which case @var{alias-var} gets the documentation | 1797 @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. | 1798 the documentation of the variable at the end of the chain of aliases. |
1799 | 1799 |
1800 This function returns @var{base-var}. | 1800 This function returns @var{base-variable}. |
1801 @end defun | 1801 @end defun |
1802 | 1802 |
1803 Variable aliases are convenient for replacing an old name for a | 1803 Variable aliases are convenient for replacing an old name for a |
1804 variable with a new name. @code{make-obsolete-variable} declares that | 1804 variable with a new name. @code{make-obsolete-variable} declares that |
1805 the old name is obsolete and therefore that it may be removed at some | 1805 the old name is obsolete and therefore that it may be removed at some |
1806 stage in the future. | 1806 stage in the future. |
1807 | 1807 |
1808 @defun make-obsolete-variable variable new &optional when | 1808 @defun make-obsolete-variable obsolete-name current-name &optional when |
1809 This function makes the byte-compiler warn that the variable | 1809 This function makes the byte-compiler warn that the variable |
1810 @var{variable} is obsolete. If @var{new} is a symbol, it is the | 1810 @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} | 1811 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 | 1812 @var{current-name} instead of @var{obsolete-name}. If @var{current-name} |
1813 message and there is no replacement variable. | 1813 is a string, this is the message and there is no replacement variable. |
1814 | 1814 |
1815 If provided, @var{when} should be a string indicating when the | 1815 If provided, @var{when} should be a string indicating when the |
1816 variable was first made obsolete---for example, a date or a release | 1816 variable was first made obsolete---for example, a date or a release |
1817 number. | 1817 number. |
1818 @end defun | 1818 @end defun |
1819 | 1819 |
1820 You can make two variables synonyms and declare one obsolete at the | 1820 You can make two variables synonyms and declare one obsolete at the |
1821 same time using the macro @code{define-obsolete-variable-alias}. | 1821 same time using the macro @code{define-obsolete-variable-alias}. |
1822 | 1822 |
1823 @defmac define-obsolete-variable-alias variable new &optional when docstring | 1823 @defmac define-obsolete-variable-alias obsolete-name current-name &optional when docstring |
1824 This macro marks the variable @var{variable} as obsolete and also | 1824 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: | 1825 makes it an alias for the variable @var{current-name}. A typical call has |
1826 the form: | |
1826 | 1827 |
1827 @example | 1828 @example |
1828 (define-obsolete-variable-alias 'old-var 'new-var "22.1" "Doc.") | 1829 (define-obsolete-variable-alias 'old-var 'new-var "22.1" "Doc.") |
1829 @end example | 1830 @end example |
1830 | 1831 |