diff options
author | Nick Roberts <nickrob@snap.net.nz> | 2005-04-22 04:07:29 +0000 |
---|---|---|
committer | Nick Roberts <nickrob@snap.net.nz> | 2005-04-22 04:07:29 +0000 |
commit | 727273e7e0a3b1cf8dce637d097416e4f1ba7e23 (patch) | |
tree | bcd716adad6db320c073d4b394f11c1bf5538d8d /lispref/variables.texi | |
parent | 24f004ca8218d528c21db1156f6428ffe37caa88 (diff) | |
download | emacs-727273e7e0a3b1cf8dce637d097416e4f1ba7e23.tar.gz |
(Variable Aliases): Describe make-obsolete-variable
and define-obsolete-variable-alias.
Diffstat (limited to 'lispref/variables.texi')
-rw-r--r-- | lispref/variables.texi | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lispref/variables.texi b/lispref/variables.texi index de5fb40618f..49a8f0d7a26 100644 --- a/lispref/variables.texi +++ b/lispref/variables.texi @@ -1714,6 +1714,33 @@ of the variable at the end of the chain of aliases. This function returns @var{base-var}. @end defun +Variables aliases are often used prior to replacing an old name for a variable +with a new name. To allow some time for existing code to adapt to this change, +@code{make-obsolete-variable} declares that the old name is obsolete and +therefore that it may be removed at some stage in the future. + +@defmac make-obsolete-variable variable new &optional when +This macro makes the byte-compiler warn that symbol @var{variable} is +obsolete and that symbol @var{new} should be used instead. If +@var{new} is a string, this is the message and there is no replacement +variable. If it is provided, @var{when} should be a string indicating +when the variable was first made obsolete, for example a date or a +release number. +@end defmac + +You can make two variables synonyms and declare one obsolete at the +same time using the macro @code{define-obsolete-variable-alias}. + +@defmac define-obsolete-variable-alias variable new &optional when docstring +This macro defines the symbol @var{variable} as a variable alias for +symbol @var{new} and warns that @var{variable} is obsolete. If it is +provided, @var{when} should be a string indicating when @var{variable} +was first made obsolete. The optional argument @var{docstring} +specifies the documentation string for @var{variable}. If +@var{docstring} is omitted or nil, @var{variable} uses the +documentation string of @var{new} unless it already has one. +@end defmac + @defun indirect-variable variable This function returns the variable at the end of the chain of aliases of @var{variable}. If @var{variable} is not a symbol, or if @var{variable} is |