diff options
| author | Luc Teirlinck | 2005-05-05 23:12:19 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-05-05 23:12:19 +0000 |
| commit | 8989fec42c9d68b5bc4e680cfb6ccfdcebcee45a (patch) | |
| tree | 58e1971cbe149e5934737c1fdc078ce368b5ccd3 | |
| parent | 53420faaaf930347bd61bd9b4e6941a3a6df2e5d (diff) | |
| download | emacs-8989fec42c9d68b5bc4e680cfb6ccfdcebcee45a.tar.gz emacs-8989fec42c9d68b5bc4e680cfb6ccfdcebcee45a.zip | |
(Functions): Add "Obsolete Functions" to menu.
(Defining Functions): Add xref.
(Obsolete Functions): New node.
(Function Safety): Standardize capitalization of section title.
| -rw-r--r-- | lispref/functions.texi | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/lispref/functions.texi b/lispref/functions.texi index 26c2449fee6..bcdfc95cc1c 100644 --- a/lispref/functions.texi +++ b/lispref/functions.texi | |||
| @@ -21,6 +21,7 @@ define them. | |||
| 21 | * Anonymous Functions:: Lambda expressions are functions with no names. | 21 | * Anonymous Functions:: Lambda expressions are functions with no names. |
| 22 | * Function Cells:: Accessing or setting the function definition | 22 | * Function Cells:: Accessing or setting the function definition |
| 23 | of a symbol. | 23 | of a symbol. |
| 24 | * Obsolete Functions:: Declaring functions obsolete. | ||
| 24 | * Inline Functions:: Defining functions that the compiler will open code. | 25 | * Inline Functions:: Defining functions that the compiler will open code. |
| 25 | * Function Safety:: Determining whether a function is safe to call. | 26 | * Function Safety:: Determining whether a function is safe to call. |
| 26 | * Related Topics:: Cross-references to specific Lisp primitives | 27 | * Related Topics:: Cross-references to specific Lisp primitives |
| @@ -601,7 +602,7 @@ which file defined the function, just like @code{defun} | |||
| 601 | 602 | ||
| 602 | By contrast, in programs that manipulate function definitions for other | 603 | By contrast, in programs that manipulate function definitions for other |
| 603 | purposes, it is better to use @code{fset}, which does not keep such | 604 | purposes, it is better to use @code{fset}, which does not keep such |
| 604 | records. | 605 | records. @xref{Function Cells}. |
| 605 | @end defun | 606 | @end defun |
| 606 | 607 | ||
| 607 | You cannot create a new primitive function with @code{defun} or | 608 | You cannot create a new primitive function with @code{defun} or |
| @@ -1150,6 +1151,44 @@ file to redefine a function defined elsewhere. If you want to modify | |||
| 1150 | a function defined by another package, it is cleaner to use | 1151 | a function defined by another package, it is cleaner to use |
| 1151 | @code{defadvice} (@pxref{Advising Functions}). | 1152 | @code{defadvice} (@pxref{Advising Functions}). |
| 1152 | 1153 | ||
| 1154 | @node Obsolete Functions | ||
| 1155 | @section Declaring Functions Obsolete | ||
| 1156 | |||
| 1157 | You can use @code{make-obsolete} to declare a function obsolete. This | ||
| 1158 | indicates that the function may be removed at some stage in the future. | ||
| 1159 | |||
| 1160 | @defun make-obsolete function new &optional when | ||
| 1161 | This function makes the byte compiler warn that the function | ||
| 1162 | @var{function} is obsolete. If @var{new} is a symbol, the warning | ||
| 1163 | message says to use @var{new} instead of @var{function}. @var{new} | ||
| 1164 | does not need to be an alias for @var{function}; it can be a different | ||
| 1165 | function with similar functionality. If @var{new} is a string, it is | ||
| 1166 | the warning message. | ||
| 1167 | |||
| 1168 | If provided, @var{when} should be a string indicating when the function | ||
| 1169 | was first made obsolete---for example, a date or a release number. | ||
| 1170 | @end defun | ||
| 1171 | |||
| 1172 | You can define a function as an alias and declare it obsolete at the | ||
| 1173 | same time using the macro @code{define-obsolete-function-alias}. | ||
| 1174 | |||
| 1175 | @defmac define-obsolete-function-alias function new &optional when docstring | ||
| 1176 | This macro marks the function @var{function} obsolete and also defines | ||
| 1177 | it as an alias for the function @var{new}. A typical call has the form: | ||
| 1178 | |||
| 1179 | @example | ||
| 1180 | (define-obsolete-function-alias 'old-fun 'new-fun "22.1" "Doc.") | ||
| 1181 | @end example | ||
| 1182 | |||
| 1183 | @noindent | ||
| 1184 | which is equivalent to the following two lines of code: | ||
| 1185 | |||
| 1186 | @example | ||
| 1187 | (defalias 'old-fun 'new-fun "Doc.") | ||
| 1188 | (make-obsolete 'old-fun 'new-fun "22.1") | ||
| 1189 | @end example | ||
| 1190 | @end defmac | ||
| 1191 | |||
| 1153 | @node Inline Functions | 1192 | @node Inline Functions |
| 1154 | @section Inline Functions | 1193 | @section Inline Functions |
| 1155 | @cindex inline functions | 1194 | @cindex inline functions |
| @@ -1186,7 +1225,7 @@ Inline functions can be used and open-coded later on in the same file, | |||
| 1186 | following the definition, just like macros. | 1225 | following the definition, just like macros. |
| 1187 | 1226 | ||
| 1188 | @node Function Safety | 1227 | @node Function Safety |
| 1189 | @section Determining whether a function is safe to call | 1228 | @section Determining whether a Function is Safe to Call |
| 1190 | @cindex function safety | 1229 | @cindex function safety |
| 1191 | @cindex safety of functions | 1230 | @cindex safety of functions |
| 1192 | 1231 | ||