diff options
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/ChangeLog | 18 | ||||
| -rw-r--r-- | lispref/eval.texi | 1 | ||||
| -rw-r--r-- | lispref/frames.texi | 4 | ||||
| -rw-r--r-- | lispref/functions.texi | 67 | ||||
| -rw-r--r-- | lispref/hash.texi | 1 | ||||
| -rw-r--r-- | lispref/help.texi | 1 | ||||
| -rw-r--r-- | lispref/symbols.texi | 1 |
7 files changed, 63 insertions, 30 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index b3b4abf2460..1ef5bca1d46 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2004-01-03 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * frames.texi (Frames and Windows): Delete frame-root-window. | ||
| 4 | |||
| 5 | 2004-01-03 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6 | |||
| 7 | * eval.texi, hash.texi, help.texi, symbols.texi: Add anchors. | ||
| 8 | |||
| 9 | * functions.texi: Various small changes in addition to the | ||
| 10 | following. | ||
| 11 | (What Is a Function): `functionp' returns nil for macros. Clarify | ||
| 12 | behavior of this and following functions for symbol arguments. | ||
| 13 | (Function Documentation): Add `\' in front of (fn @var{arglist}) | ||
| 14 | and explain why. | ||
| 15 | (Defining Functions): Mention DOCSTRING argument to `defalias'. | ||
| 16 | Add anchor. | ||
| 17 | (Mapping Functions): Add anchor. Unquote nil in mapcar* example. | ||
| 18 | |||
| 1 | 2004-01-01 Miles Bader <miles@gnu.org> | 19 | 2004-01-01 Miles Bader <miles@gnu.org> |
| 2 | 20 | ||
| 3 | * display.texi (Buttons): New section. | 21 | * display.texi (Buttons): New section. |
diff --git a/lispref/eval.texi b/lispref/eval.texi index fcfde5849dd..7d1ebb9d307 100644 --- a/lispref/eval.texi +++ b/lispref/eval.texi | |||
| @@ -313,6 +313,7 @@ symbol function indirection when calling @code{erste}. | |||
| 313 | perform symbol function indirection explicitly. | 313 | perform symbol function indirection explicitly. |
| 314 | 314 | ||
| 315 | @c Emacs 19 feature | 315 | @c Emacs 19 feature |
| 316 | @anchor{Definition of indirect-function} | ||
| 316 | @defun indirect-function function | 317 | @defun indirect-function function |
| 317 | This function returns the meaning of @var{function} as a function. If | 318 | This function returns the meaning of @var{function} as a function. If |
| 318 | @var{function} is a symbol, then it finds @var{function}'s function | 319 | @var{function} is a symbol, then it finds @var{function}'s function |
diff --git a/lispref/frames.texi b/lispref/frames.texi index ec3c1c6dc7c..a9b29332200 100644 --- a/lispref/frames.texi +++ b/lispref/frames.texi | |||
| @@ -933,10 +933,6 @@ selected window. | |||
| 933 | Conversely, selecting a window for Emacs with @code{select-window} also | 933 | Conversely, selecting a window for Emacs with @code{select-window} also |
| 934 | makes that window selected within its frame. @xref{Selecting Windows}. | 934 | makes that window selected within its frame. @xref{Selecting Windows}. |
| 935 | 935 | ||
| 936 | @defun frame-root-window frame | ||
| 937 | This function returns the window at the top left corner of @var{frame}. | ||
| 938 | @end defun | ||
| 939 | |||
| 940 | Another function that (usually) returns one of the windows in a given | 936 | Another function that (usually) returns one of the windows in a given |
| 941 | frame is @code{minibuffer-window}. @xref{Minibuffer Misc}. | 937 | frame is @code{minibuffer-window}. @xref{Minibuffer Misc}. |
| 942 | 938 | ||
diff --git a/lispref/functions.texi b/lispref/functions.texi index 4ee101ca871..4b727e76506 100644 --- a/lispref/functions.texi +++ b/lispref/functions.texi | |||
| @@ -113,10 +113,15 @@ byte compiler. @xref{Byte-Code Type}. | |||
| 113 | @end table | 113 | @end table |
| 114 | 114 | ||
| 115 | @defun functionp object | 115 | @defun functionp object |
| 116 | This function returns @code{t} if @var{object} is any kind of function, | 116 | This function returns @code{t} if @var{object} is any kind of |
| 117 | or a special form or macro. | 117 | function, or a special form, or, recursively, a symbol whose function |
| 118 | definition is a function or special form. (This does not include | ||
| 119 | macros.) | ||
| 118 | @end defun | 120 | @end defun |
| 119 | 121 | ||
| 122 | Unlike @code{functionp}, the next three functions do @emph{not} | ||
| 123 | treat a symbol as its function definition. | ||
| 124 | |||
| 120 | @defun subrp object | 125 | @defun subrp object |
| 121 | This function returns @code{t} if @var{object} is a built-in function | 126 | This function returns @code{t} if @var{object} is a built-in function |
| 122 | (i.e., a Lisp primitive). | 127 | (i.e., a Lisp primitive). |
| @@ -428,13 +433,14 @@ conventions different from the actual function arguments. Write | |||
| 428 | text like this: | 433 | text like this: |
| 429 | 434 | ||
| 430 | @example | 435 | @example |
| 431 | (fn @var{arglist}) | 436 | \(fn @var{arglist}) |
| 432 | @end example | 437 | @end example |
| 433 | 438 | ||
| 434 | @noindent | 439 | @noindent |
| 435 | following a blank line, with no newline following it inside the | 440 | following a blank line, at the beginning of the line, with no newline |
| 436 | documentation string. This feature is particularly useful for | 441 | following it inside the documentation string. This feature is |
| 437 | macro definitions. | 442 | particularly useful for macro definitions. The @samp{\} is used to |
| 443 | avoid confusing the Emacs motion commands. | ||
| 438 | 444 | ||
| 439 | @node Function Names | 445 | @node Function Names |
| 440 | @section Naming a Function | 446 | @section Naming a Function |
| @@ -571,9 +577,15 @@ defined is often done deliberately, and there is no way to distinguish | |||
| 571 | deliberate redefinition from unintentional redefinition. | 577 | deliberate redefinition from unintentional redefinition. |
| 572 | @end defspec | 578 | @end defspec |
| 573 | 579 | ||
| 574 | @defun defalias name definition | 580 | @anchor{Definition of defalias} |
| 581 | @defun defalias name definition &optional docstring | ||
| 575 | This special form defines the symbol @var{name} as a function, with | 582 | This special form defines the symbol @var{name} as a function, with |
| 576 | definition @var{definition} (which can be any valid Lisp function). | 583 | definition @var{definition} (which can be any valid Lisp function). |
| 584 | It returns @var{definition}. | ||
| 585 | |||
| 586 | If @var{docstring} is non-@code{nil}, it becomes the function | ||
| 587 | documentation of @var{name}. Otherwise, any documentation provided by | ||
| 588 | @var{definition} is used. | ||
| 577 | 589 | ||
| 578 | The proper place to use @code{defalias} is where a specific function | 590 | The proper place to use @code{defalias} is where a specific function |
| 579 | name is being defined---especially where that name appears explicitly in | 591 | name is being defined---especially where that name appears explicitly in |
| @@ -587,7 +599,7 @@ records. | |||
| 587 | @end defun | 599 | @end defun |
| 588 | 600 | ||
| 589 | You cannot create a new primitive function with @code{defun} or | 601 | You cannot create a new primitive function with @code{defun} or |
| 590 | @code{defalias}, but you use them to change the function definition of | 602 | @code{defalias}, but you can use them to change the function definition of |
| 591 | any symbol, even one such as @code{car} or @code{x-popup-menu} whose | 603 | any symbol, even one such as @code{car} or @code{x-popup-menu} whose |
| 592 | normal definition is a primitive. However, this is risky: for | 604 | normal definition is a primitive. However, this is risky: for |
| 593 | instance, it is next to impossible to redefine @code{car} without | 605 | instance, it is next to impossible to redefine @code{car} without |
| @@ -700,8 +712,8 @@ primitive function; special forms and macros do not make sense in | |||
| 700 | @end group | 712 | @end group |
| 701 | @end example | 713 | @end example |
| 702 | 714 | ||
| 703 | For an interesting example of using @code{apply}, see the description of | 715 | For an interesting example of using @code{apply}, see @ref{Definition |
| 704 | @code{mapcar}, in @ref{Mapping Functions}. | 716 | of mapcar}. |
| 705 | @end defun | 717 | @end defun |
| 706 | 718 | ||
| 707 | @cindex functionals | 719 | @cindex functionals |
| @@ -726,19 +738,21 @@ This function ignores any arguments and returns @code{nil}. | |||
| 726 | @section Mapping Functions | 738 | @section Mapping Functions |
| 727 | @cindex mapping functions | 739 | @cindex mapping functions |
| 728 | 740 | ||
| 729 | A @dfn{mapping function} applies a given function to each element of a | 741 | A @dfn{mapping function} applies a given function (@emph{not} a |
| 730 | list or other collection. Emacs Lisp has several such functions; | 742 | special form or macro) to each element of a list or other collection. |
| 731 | @code{mapcar} and @code{mapconcat}, which scan a list, are described | 743 | Emacs Lisp has several such functions; @code{mapcar} and |
| 732 | here. @xref{Creating Symbols}, for the function @code{mapatoms} which | 744 | @code{mapconcat}, which scan a list, are described here. |
| 733 | maps over the symbols in an obarray. @xref{Hash Access}, for the | 745 | @xref{Definition of mapatoms}, for the function @code{mapatoms} which |
| 734 | function @code{maphash} which maps over key/value associations in a | 746 | maps over the symbols in an obarray. @xref{Definition of maphash}, |
| 735 | hash table. | 747 | for the function @code{maphash} which maps over key/value associations |
| 748 | in a hash table. | ||
| 736 | 749 | ||
| 737 | These mapping functions do not allow char-tables because a char-table | 750 | These mapping functions do not allow char-tables because a char-table |
| 738 | is a sparse array whose nominal range of indices is very large. To map | 751 | is a sparse array whose nominal range of indices is very large. To map |
| 739 | over a char-table in a way that deals properly with its sparse nature, | 752 | over a char-table in a way that deals properly with its sparse nature, |
| 740 | use the function @code{map-char-table} (@pxref{Char-Tables}). | 753 | use the function @code{map-char-table} (@pxref{Char-Tables}). |
| 741 | 754 | ||
| 755 | @anchor{Definition of mapcar} | ||
| 742 | @defun mapcar function sequence | 756 | @defun mapcar function sequence |
| 743 | @code{mapcar} applies @var{function} to each element of @var{sequence} | 757 | @code{mapcar} applies @var{function} to each element of @var{sequence} |
| 744 | in turn, and returns a list of the results. | 758 | in turn, and returns a list of the results. |
| @@ -770,7 +784,7 @@ length of @var{sequence}. | |||
| 770 | "Apply FUNCTION to successive cars of all ARGS. | 784 | "Apply FUNCTION to successive cars of all ARGS. |
| 771 | Return the list of results." | 785 | Return the list of results." |
| 772 | ;; @r{If no list is exhausted,} | 786 | ;; @r{If no list is exhausted,} |
| 773 | (if (not (memq 'nil args)) | 787 | (if (not (memq nil args)) |
| 774 | ;; @r{apply function to @sc{car}s.} | 788 | ;; @r{apply function to @sc{car}s.} |
| 775 | (cons (apply function (mapcar 'car args)) | 789 | (cons (apply function (mapcar 'car args)) |
| 776 | (apply 'mapcar* function | 790 | (apply 'mapcar* function |
| @@ -961,8 +975,8 @@ to be used only as a function, and therefore can safely be compiled. | |||
| 961 | Contrast this with @code{quote}, in @ref{Quoting}. | 975 | Contrast this with @code{quote}, in @ref{Quoting}. |
| 962 | @end defspec | 976 | @end defspec |
| 963 | 977 | ||
| 964 | See @code{documentation} in @ref{Accessing Documentation}, for a | 978 | @xref{describe-symbols example}, for a realistic example using |
| 965 | realistic example using @code{function} and an anonymous function. | 979 | @code{function} and an anonymous function. |
| 966 | 980 | ||
| 967 | @node Function Cells | 981 | @node Function Cells |
| 968 | @section Accessing Function Cell Contents | 982 | @section Accessing Function Cell Contents |
| @@ -971,8 +985,8 @@ realistic example using @code{function} and an anonymous function. | |||
| 971 | function cell of the symbol. The functions described here access, test, | 985 | function cell of the symbol. The functions described here access, test, |
| 972 | and set the function cell of symbols. | 986 | and set the function cell of symbols. |
| 973 | 987 | ||
| 974 | See also the function @code{indirect-function} in @ref{Function | 988 | See also the function @code{indirect-function}. @xref{Definition of |
| 975 | Indirection}. | 989 | indirect-function}. |
| 976 | 990 | ||
| 977 | @defun symbol-function symbol | 991 | @defun symbol-function symbol |
| 978 | @kindex void-function | 992 | @kindex void-function |
| @@ -1027,8 +1041,9 @@ is a legitimate function. | |||
| 1027 | 1041 | ||
| 1028 | @defun fmakunbound symbol | 1042 | @defun fmakunbound symbol |
| 1029 | This function makes @var{symbol}'s function cell void, so that a | 1043 | This function makes @var{symbol}'s function cell void, so that a |
| 1030 | subsequent attempt to access this cell will cause a @code{void-function} | 1044 | subsequent attempt to access this cell will cause a |
| 1031 | error. (See also @code{makunbound}, in @ref{Void Variables}.) | 1045 | @code{void-function} error. It returns @var{symbol}. (See also |
| 1046 | @code{makunbound}, in @ref{Void Variables}.) | ||
| 1032 | 1047 | ||
| 1033 | @example | 1048 | @example |
| 1034 | @group | 1049 | @group |
| @@ -1064,7 +1079,7 @@ There are three normal uses of this function: | |||
| 1064 | Copying one symbol's function definition to another---in other words, | 1079 | Copying one symbol's function definition to another---in other words, |
| 1065 | making an alternate name for a function. (If you think of this as the | 1080 | making an alternate name for a function. (If you think of this as the |
| 1066 | definition of the new name, you should use @code{defalias} instead of | 1081 | definition of the new name, you should use @code{defalias} instead of |
| 1067 | @code{fset}; see @ref{Defining Functions}.) | 1082 | @code{fset}; see @ref{Definition of defalias}.) |
| 1068 | 1083 | ||
| 1069 | @item | 1084 | @item |
| 1070 | Giving a symbol a function definition that is not a list and therefore | 1085 | Giving a symbol a function definition that is not a list and therefore |
| @@ -1305,7 +1320,7 @@ See @ref{Anonymous Functions}. | |||
| 1305 | See @ref{Calling Functions}. | 1320 | See @ref{Calling Functions}. |
| 1306 | 1321 | ||
| 1307 | @item indirect-function | 1322 | @item indirect-function |
| 1308 | See @ref{Function Indirection}. | 1323 | See @ref{Definition of indirect-function}. |
| 1309 | 1324 | ||
| 1310 | @item interactive | 1325 | @item interactive |
| 1311 | See @ref{Using Interactive}. | 1326 | See @ref{Using Interactive}. |
diff --git a/lispref/hash.texi b/lispref/hash.texi index a27894fa24b..909c7fb0b7c 100644 --- a/lispref/hash.texi +++ b/lispref/hash.texi | |||
| @@ -205,6 +205,7 @@ table. | |||
| 205 | @end defun | 205 | @end defun |
| 206 | 206 | ||
| 207 | @tindex maphash | 207 | @tindex maphash |
| 208 | @anchor{Definition of maphash} | ||
| 208 | @defun maphash function table | 209 | @defun maphash function table |
| 209 | This function calls @var{function} once for each of the associations in | 210 | This function calls @var{function} once for each of the associations in |
| 210 | @var{table}. The function @var{function} should accept two | 211 | @var{table}. The function @var{function} should accept two |
diff --git a/lispref/help.texi b/lispref/help.texi index 343ffb66078..dc14b0226b5 100644 --- a/lispref/help.texi +++ b/lispref/help.texi | |||
| @@ -156,6 +156,7 @@ Here is an example of using the two functions, @code{documentation} and | |||
| 156 | @code{documentation-property}, to display the documentation strings for | 156 | @code{documentation-property}, to display the documentation strings for |
| 157 | several symbols in a @samp{*Help*} buffer. | 157 | several symbols in a @samp{*Help*} buffer. |
| 158 | 158 | ||
| 159 | @anchor{describe-symbols example} | ||
| 159 | @smallexample | 160 | @smallexample |
| 160 | @group | 161 | @group |
| 161 | (defun describe-symbols (pattern) | 162 | (defun describe-symbols (pattern) |
diff --git a/lispref/symbols.texi b/lispref/symbols.texi index 6cde2115259..632f2cc5174 100644 --- a/lispref/symbols.texi +++ b/lispref/symbols.texi | |||
| @@ -360,6 +360,7 @@ This variable is the standard obarray for use by @code{intern} and | |||
| 360 | @code{read}. | 360 | @code{read}. |
| 361 | @end defvar | 361 | @end defvar |
| 362 | 362 | ||
| 363 | @anchor{Definition of mapatoms} | ||
| 363 | @defun mapatoms function &optional obarray | 364 | @defun mapatoms function &optional obarray |
| 364 | This function calls @var{function} once with each symbol in the obarray | 365 | This function calls @var{function} once with each symbol in the obarray |
| 365 | @var{obarray}. Then it returns @code{nil}. If @var{obarray} is | 366 | @var{obarray}. Then it returns @code{nil}. If @var{obarray} is |