diff options
| author | Karoly Lorentey | 2005-02-19 00:06:48 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-02-19 00:06:48 +0000 |
| commit | 60c73d2ed638e5d51643c65a0fc6dea618fc72c8 (patch) | |
| tree | 3d9e0adc703f9cfd5df162c66ac15999c4106738 /lispref | |
| parent | c20213c90736fc9c2a6eca2ca44d6e200dbf5efe (diff) | |
| parent | 8a59305430c68ee23d3cc7ab7487ab3acebdbe7f (diff) | |
| download | emacs-60c73d2ed638e5d51643c65a0fc6dea618fc72c8.tar.gz emacs-60c73d2ed638e5d51643c65a0fc6dea618fc72c8.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 14-16, 95-106)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-95
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-96
Move Gnus images into etc/images
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-97
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-98
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-99
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-100
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-101
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-102
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-103
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-104
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-105
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-106
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-14
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-15
Update from CVS: lisp/imap.el (imap-log): Doc fix.
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-16
Merge from emacs--cvs-trunk--0
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-295
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/ChangeLog | 69 | ||||
| -rw-r--r-- | lispref/compile.texi | 30 | ||||
| -rw-r--r-- | lispref/control.texi | 23 | ||||
| -rw-r--r-- | lispref/elisp.texi | 3 | ||||
| -rw-r--r-- | lispref/functions.texi | 86 | ||||
| -rw-r--r-- | lispref/hash.texi | 24 | ||||
| -rw-r--r-- | lispref/lists.texi | 109 | ||||
| -rw-r--r-- | lispref/loading.texi | 34 | ||||
| -rw-r--r-- | lispref/minibuf.texi | 5 | ||||
| -rw-r--r-- | lispref/numbers.texi | 62 | ||||
| -rw-r--r-- | lispref/objects.texi | 191 | ||||
| -rw-r--r-- | lispref/streams.texi | 2 | ||||
| -rw-r--r-- | lispref/symbols.texi | 4 | ||||
| -rw-r--r-- | lispref/variables.texi | 7 |
14 files changed, 347 insertions, 302 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index ec5129e0b91..7da20942eaf 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,72 @@ | |||
| 1 | 2005-02-14 Lute Kamstra <lute@gnu.org> | ||
| 2 | |||
| 3 | * elisp.texi (Top): Remove reference to deleted node. | ||
| 4 | |||
| 5 | * lists.texi (Lists): Remove reference to deleted node. | ||
| 6 | (Cons Cells): Fix typo. | ||
| 7 | |||
| 8 | * loading.texi (Where Defined): Fix typo. | ||
| 9 | |||
| 10 | 2005-02-14 Richard M. Stallman <rms@gnu.org> | ||
| 11 | |||
| 12 | * variables.texi (Creating Buffer-Local): change-major-mode-hook | ||
| 13 | is useful for discarding some minor modes. | ||
| 14 | |||
| 15 | * symbols.texi (Symbol Components): Reorder examples. | ||
| 16 | |||
| 17 | * streams.texi (Input Functions): State standard-input default. | ||
| 18 | (Output Variables): State standard-output default. | ||
| 19 | |||
| 20 | * objects.texi (Printed Representation): Clarify read syntax vs print. | ||
| 21 | (Floating Point Type): Explain meaning better. | ||
| 22 | (Symbol Type): Explain uniqueness better. | ||
| 23 | (Cons Cell Type): Explain empty list sooner. CAR and CDR later. | ||
| 24 | List examples sooner. | ||
| 25 | (Box Diagrams): New subnode broken out. | ||
| 26 | Some examples moved from old Lists as Boxes node. | ||
| 27 | (Dotted Pair Notation): Clarify intro. | ||
| 28 | (Array Type): Clarify. | ||
| 29 | (Type Predicates): Add hash-table-p. | ||
| 30 | |||
| 31 | * numbers.texi (Integer Basics): Clarify radix explanation. | ||
| 32 | (Predicates on Numbers): Minor clarification. | ||
| 33 | (Comparison of Numbers): Minor clarification. Clarify eql. | ||
| 34 | Typos in min, max. | ||
| 35 | (Math Functions): Clarify overflow in expt. | ||
| 36 | |||
| 37 | * minibuf.texi (Text from Minibuffer): Minor clarification. | ||
| 38 | Mention arrow keys. | ||
| 39 | |||
| 40 | * loading.texi (Autoload): defun's doc string overrides autoload's | ||
| 41 | doc string. | ||
| 42 | (Repeated Loading): Modernize "add to list" examples. | ||
| 43 | (Where Defined): Finish updating table of load-history elts. | ||
| 44 | |||
| 45 | * lists.texi (List-related Predicates): Minor wording improvement. | ||
| 46 | (Lists as Boxes): Node deleted. | ||
| 47 | (Building Lists): Explain trivial cases of number-sequence. | ||
| 48 | |||
| 49 | * hash.texi (Hash Tables): Add desc to menu items. | ||
| 50 | (Creating Hash): Expain "full" means "make larger", | ||
| 51 | (Hash Access): Any object can be a key. | ||
| 52 | State value of maphash. | ||
| 53 | |||
| 54 | * functions.texi (What Is a Function): Wording cleanup. | ||
| 55 | (Function Documentation): Minor cleanup. | ||
| 56 | Explain purpose of calling convention at end of doc string. | ||
| 57 | (Function Names): Wording cleanup. | ||
| 58 | (Calling Functions): Wording cleanup. | ||
| 59 | Explain better how funcall calls the function. | ||
| 60 | (Function Cells): Delete example of saving and redefining function. | ||
| 61 | |||
| 62 | * control.texi (Combining Conditions): Wording cleanup. | ||
| 63 | (Iteration): dolist and dotimes bind VAR locally. | ||
| 64 | (Cleanups): Xref to Atomic Changes. | ||
| 65 | |||
| 66 | * compile.texi (Byte Compilation): Delete 19.29 info. | ||
| 67 | (Compilation Functions): Macros' difficulties don't affect defsubst. | ||
| 68 | (Docs and Compilation): Delete 19.29 info. | ||
| 69 | |||
| 1 | 2005-02-10 Richard M. Stallman <rms@gnu.org> | 70 | 2005-02-10 Richard M. Stallman <rms@gnu.org> |
| 2 | 71 | ||
| 3 | * objects.texi (Symbol Type): Minor correction. | 72 | * objects.texi (Symbol Type): Minor correction. |
diff --git a/lispref/compile.texi b/lispref/compile.texi index 6c28708bdf1..91c0661a99e 100644 --- a/lispref/compile.texi +++ b/lispref/compile.texi | |||
| @@ -27,17 +27,7 @@ results compatible with running the same file without compilation. | |||
| 27 | @xref{Loading Non-ASCII}. | 27 | @xref{Loading Non-ASCII}. |
| 28 | 28 | ||
| 29 | In general, any version of Emacs can run byte-compiled code produced | 29 | In general, any version of Emacs can run byte-compiled code produced |
| 30 | by recent earlier versions of Emacs, but the reverse is not true. A | 30 | by recent earlier versions of Emacs, but the reverse is not true. |
| 31 | major incompatible change was introduced in Emacs version 19.29, and | ||
| 32 | files compiled with versions since that one will definitely not run | ||
| 33 | in earlier versions unless you specify a special option. | ||
| 34 | @iftex | ||
| 35 | @xref{Docs and Compilation}. | ||
| 36 | @end iftex | ||
| 37 | In addition, the modifier bits in keyboard characters were renumbered in | ||
| 38 | Emacs 19.29; as a result, files compiled in versions before 19.29 will | ||
| 39 | not work in subsequent versions if they contain character constants with | ||
| 40 | modifier bits. | ||
| 41 | 31 | ||
| 42 | @vindex no-byte-compile | 32 | @vindex no-byte-compile |
| 43 | If you do not want a Lisp file to be compiled, ever, put a file-local | 33 | If you do not want a Lisp file to be compiled, ever, put a file-local |
| @@ -122,6 +112,9 @@ macros must already be defined for proper compilation. For more | |||
| 122 | details, see @ref{Compiling Macros}. If a program does not work the | 112 | details, see @ref{Compiling Macros}. If a program does not work the |
| 123 | same way when compiled as it does when interpreted, erroneous macro | 113 | same way when compiled as it does when interpreted, erroneous macro |
| 124 | definitions are one likely cause (@pxref{Problems with Macros}). | 114 | definitions are one likely cause (@pxref{Problems with Macros}). |
| 115 | Inline (@code{defsubst}) functions are less troublesome; if you | ||
| 116 | compile a call to such a function before its definition is known, the | ||
| 117 | call will still work right, it will just run slower. | ||
| 125 | 118 | ||
| 126 | Normally, compiling a file does not evaluate the file's contents or | 119 | Normally, compiling a file does not evaluate the file's contents or |
| 127 | load the file. But it does execute any @code{require} calls at top | 120 | load the file. But it does execute any @code{require} calls at top |
| @@ -313,14 +306,13 @@ directory where you built it, you will experience this problem | |||
| 313 | occasionally if you edit and recompile Lisp files. When it happens, you | 306 | occasionally if you edit and recompile Lisp files. When it happens, you |
| 314 | can cure the problem by reloading the file after recompiling it. | 307 | can cure the problem by reloading the file after recompiling it. |
| 315 | 308 | ||
| 316 | Byte-compiled files made with recent versions of Emacs (since 19.29) | 309 | You can turn off this feature at compile time by setting |
| 317 | will not load into older versions because the older versions don't | 310 | @code{byte-compile-dynamic-docstrings} to @code{nil}; this is useful |
| 318 | support this feature. You can turn off this feature at compile time by | 311 | mainly if you expect to change the file, and you want Emacs processes |
| 319 | setting @code{byte-compile-dynamic-docstrings} to @code{nil}; then you | 312 | that have already loaded it to keep working when the file changes. |
| 320 | can compile files that will load into older Emacs versions. You can do | 313 | You can do this globally, or for one source file by specifying a |
| 321 | this globally, or for one source file by specifying a file-local binding | 314 | file-local binding for the variable. One way to do that is by adding |
| 322 | for the variable. One way to do that is by adding this string to the | 315 | this string to the file's first line: |
| 323 | file's first line: | ||
| 324 | 316 | ||
| 325 | @example | 317 | @example |
| 326 | -*-byte-compile-dynamic-docstrings: nil;-*- | 318 | -*-byte-compile-dynamic-docstrings: nil;-*- |
diff --git a/lispref/control.texi b/lispref/control.texi index e2a1e26b170..760e7bb82de 100644 --- a/lispref/control.texi +++ b/lispref/control.texi | |||
| @@ -346,8 +346,8 @@ Here is a more realistic example of using @code{and}: | |||
| 346 | Note that @code{(car foo)} is not executed if @code{(consp foo)} returns | 346 | Note that @code{(car foo)} is not executed if @code{(consp foo)} returns |
| 347 | @code{nil}, thus avoiding an error. | 347 | @code{nil}, thus avoiding an error. |
| 348 | 348 | ||
| 349 | @code{and} can be expressed in terms of either @code{if} or @code{cond}. | 349 | @code{and} expressions can also be written using either @code{if} or |
| 350 | For example: | 350 | @code{cond}. Here's how: |
| 351 | 351 | ||
| 352 | @example | 352 | @example |
| 353 | @group | 353 | @group |
| @@ -476,11 +476,11 @@ write two common kinds of loops. | |||
| 476 | 476 | ||
| 477 | @defmac dolist (var list [result]) body@dots{} | 477 | @defmac dolist (var list [result]) body@dots{} |
| 478 | @tindex dolist | 478 | @tindex dolist |
| 479 | This construct executes @var{body} once for each element of @var{list}, | 479 | This construct executes @var{body} once for each element of |
| 480 | using the variable @var{var} to hold the current element. Then it | 480 | @var{list}, binding the variable @var{var} locally to hold the current |
| 481 | returns the value of evaluating @var{result}, or @code{nil} if | 481 | element. Then it returns the value of evaluating @var{result}, or |
| 482 | @var{result} is omitted. For example, here is how you could use | 482 | @code{nil} if @var{result} is omitted. For example, here is how you |
| 483 | @code{dolist} to define the @code{reverse} function: | 483 | could use @code{dolist} to define the @code{reverse} function: |
| 484 | 484 | ||
| 485 | @example | 485 | @example |
| 486 | (defun reverse (list) | 486 | (defun reverse (list) |
| @@ -493,8 +493,8 @@ returns the value of evaluating @var{result}, or @code{nil} if | |||
| 493 | @defmac dotimes (var count [result]) body@dots{} | 493 | @defmac dotimes (var count [result]) body@dots{} |
| 494 | @tindex dotimes | 494 | @tindex dotimes |
| 495 | This construct executes @var{body} once for each integer from 0 | 495 | This construct executes @var{body} once for each integer from 0 |
| 496 | (inclusive) to @var{count} (exclusive), using the variable @var{var} to | 496 | (inclusive) to @var{count} (exclusive), binding the variable @var{var} |
| 497 | hold the integer for the current iteration. Then it returns the value | 497 | to the integer for the current iteration. Then it returns the value |
| 498 | of evaluating @var{result}, or @code{nil} if @var{result} is omitted. | 498 | of evaluating @var{result}, or @code{nil} if @var{result} is omitted. |
| 499 | Here is an example of using @code{dotimes} to do something 100 times: | 499 | Here is an example of using @code{dotimes} to do something 100 times: |
| 500 | 500 | ||
| @@ -1167,7 +1167,10 @@ and their conditions. | |||
| 1167 | 1167 | ||
| 1168 | The @code{unwind-protect} construct is essential whenever you | 1168 | The @code{unwind-protect} construct is essential whenever you |
| 1169 | temporarily put a data structure in an inconsistent state; it permits | 1169 | temporarily put a data structure in an inconsistent state; it permits |
| 1170 | you to make the data consistent again in the event of an error or throw. | 1170 | you to make the data consistent again in the event of an error or |
| 1171 | throw. (Another more specific cleanup construct that is used only for | ||
| 1172 | changes in buffer contents is the atomic change group; @ref{Atomic | ||
| 1173 | Changes}.) | ||
| 1171 | 1174 | ||
| 1172 | @defspec unwind-protect body-form cleanup-forms@dots{} | 1175 | @defspec unwind-protect body-form cleanup-forms@dots{} |
| 1173 | @cindex cleanup forms | 1176 | @cindex cleanup forms |
diff --git a/lispref/elisp.texi b/lispref/elisp.texi index fa84a0a93fb..64e956afdf3 100644 --- a/lispref/elisp.texi +++ b/lispref/elisp.texi | |||
| @@ -34,7 +34,7 @@ Published by the Free Software Foundation | |||
| 34 | 59 Temple Place, Suite 330 | 34 | 59 Temple Place, Suite 330 |
| 35 | Boston, MA 02111-1307 USA | 35 | Boston, MA 02111-1307 USA |
| 36 | 36 | ||
| 37 | Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,@* | 37 | Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2005,@* |
| 38 | 2000, 2002 Free Software Foundation, Inc. | 38 | 2000, 2002 Free Software Foundation, Inc. |
| 39 | 39 | ||
| 40 | Permission is granted to copy, distribute and/or modify this document | 40 | Permission is granted to copy, distribute and/or modify this document |
| @@ -281,7 +281,6 @@ Strings and Characters | |||
| 281 | Lists | 281 | Lists |
| 282 | 282 | ||
| 283 | * Cons Cells:: How lists are made out of cons cells. | 283 | * Cons Cells:: How lists are made out of cons cells. |
| 284 | * Lists as Boxes:: Graphical notation to explain lists. | ||
| 285 | * List-related Predicates:: Is this object a list? Comparing two lists. | 284 | * List-related Predicates:: Is this object a list? Comparing two lists. |
| 286 | * List Elements:: Extracting the pieces of a list. | 285 | * List Elements:: Extracting the pieces of a list. |
| 287 | * Building Lists:: Creating list structure. | 286 | * Building Lists:: Creating list structure. |
diff --git a/lispref/functions.texi b/lispref/functions.texi index 5c7433507b0..26c2449fee6 100644 --- a/lispref/functions.texi +++ b/lispref/functions.texi | |||
| @@ -53,7 +53,7 @@ macros are not functions. | |||
| 53 | @cindex built-in function | 53 | @cindex built-in function |
| 54 | A @dfn{primitive} is a function callable from Lisp that is written in C, | 54 | A @dfn{primitive} is a function callable from Lisp that is written in C, |
| 55 | such as @code{car} or @code{append}. These functions are also called | 55 | such as @code{car} or @code{append}. These functions are also called |
| 56 | @dfn{built-in} functions or @dfn{subrs}. (Special forms are also | 56 | @dfn{built-in functions}, or @dfn{subrs}. (Special forms are also |
| 57 | considered primitives.) | 57 | considered primitives.) |
| 58 | 58 | ||
| 59 | Usually the reason we implement a function as a primitive is either | 59 | Usually the reason we implement a function as a primitive is either |
| @@ -412,13 +412,14 @@ are easier to access. | |||
| 412 | because @code{apropos} displays just this first line. It should consist | 412 | because @code{apropos} displays just this first line. It should consist |
| 413 | of one or two complete sentences that summarize the function's purpose. | 413 | of one or two complete sentences that summarize the function's purpose. |
| 414 | 414 | ||
| 415 | The start of the documentation string is usually indented in the source file, | 415 | The start of the documentation string is usually indented in the |
| 416 | but since these spaces come before the starting double-quote, they are not part of | 416 | source file, but since these spaces come before the starting |
| 417 | the string. Some people make a practice of indenting any additional | 417 | double-quote, they are not part of the string. Some people make a |
| 418 | lines of the string so that the text lines up in the program source. | 418 | practice of indenting any additional lines of the string so that the |
| 419 | @emph{That is a mistake.} The indentation of the following lines is | 419 | text lines up in the program source. @emph{That is a mistake.} The |
| 420 | inside the string; what looks nice in the source code will look ugly | 420 | indentation of the following lines is inside the string; what looks |
| 421 | when displayed by the help commands. | 421 | nice in the source code will look ugly when displayed by the help |
| 422 | commands. | ||
| 422 | 423 | ||
| 423 | You may wonder how the documentation string could be optional, since | 424 | You may wonder how the documentation string could be optional, since |
| 424 | there are required components of the function that follow it (the body). | 425 | there are required components of the function that follow it (the body). |
| @@ -438,9 +439,14 @@ text like this: | |||
| 438 | 439 | ||
| 439 | @noindent | 440 | @noindent |
| 440 | following a blank line, at the beginning of the line, with no newline | 441 | following a blank line, at the beginning of the line, with no newline |
| 441 | following it inside the documentation string. This feature is | 442 | following it inside the documentation string. (The @samp{\} is used |
| 442 | particularly useful for macro definitions. The @samp{\} is used to | 443 | to avoid confusing the Emacs motion commands.) The calling convention |
| 443 | avoid confusing the Emacs motion commands. | 444 | specified in this way appears in help messages in place of the one |
| 445 | derived from the actual arguments of the function. | ||
| 446 | |||
| 447 | This feature is particularly useful for macro definitions, since the | ||
| 448 | arguments written in a macro definition often do not correspond to the | ||
| 449 | way users think of the parts of the macro call. | ||
| 444 | 450 | ||
| 445 | @node Function Names | 451 | @node Function Names |
| 446 | @section Naming a Function | 452 | @section Naming a Function |
| @@ -481,8 +487,8 @@ practice). | |||
| 481 | We often identify functions with the symbols used to name them. For | 487 | We often identify functions with the symbols used to name them. For |
| 482 | example, we often speak of ``the function @code{car}'', not | 488 | example, we often speak of ``the function @code{car}'', not |
| 483 | distinguishing between the symbol @code{car} and the primitive | 489 | distinguishing between the symbol @code{car} and the primitive |
| 484 | subr-object that is its function definition. For most purposes, there | 490 | subr-object that is its function definition. For most purposes, the |
| 485 | is no need to distinguish. | 491 | distinction is not important. |
| 486 | 492 | ||
| 487 | Even so, keep in mind that a function need not have a unique name. While | 493 | Even so, keep in mind that a function need not have a unique name. While |
| 488 | a given function object @emph{usually} appears in the function cell of only | 494 | a given function object @emph{usually} appears in the function cell of only |
| @@ -626,13 +632,12 @@ For example, evaluating the list @code{(concat "a" "b")} calls the | |||
| 626 | function @code{concat} with arguments @code{"a"} and @code{"b"}. | 632 | function @code{concat} with arguments @code{"a"} and @code{"b"}. |
| 627 | @xref{Evaluation}, for a description of evaluation. | 633 | @xref{Evaluation}, for a description of evaluation. |
| 628 | 634 | ||
| 629 | When you write a list as an expression in your program, the function | 635 | When you write a list as an expression in your program, you specify |
| 630 | name it calls is written in your program. This means that you choose | 636 | which function to call, and how many arguments to give it, in the text |
| 631 | which function to call, and how many arguments to give it, when you | 637 | of the program. Usually that's just what you want. Occasionally you |
| 632 | write the program. Usually that's just what you want. Occasionally you | 638 | need to compute at run time which function to call. To do that, use |
| 633 | need to compute at run time which function to call. To do that, use the | 639 | the function @code{funcall}. When you also need to determine at run |
| 634 | function @code{funcall}. When you also need to determine at run time | 640 | time how many arguments to pass, use @code{apply}. |
| 635 | how many arguments to pass, use @code{apply}. | ||
| 636 | 641 | ||
| 637 | @defun funcall function &rest arguments | 642 | @defun funcall function &rest arguments |
| 638 | @code{funcall} calls @var{function} with @var{arguments}, and returns | 643 | @code{funcall} calls @var{function} with @var{arguments}, and returns |
| @@ -641,11 +646,12 @@ whatever @var{function} returns. | |||
| 641 | Since @code{funcall} is a function, all of its arguments, including | 646 | Since @code{funcall} is a function, all of its arguments, including |
| 642 | @var{function}, are evaluated before @code{funcall} is called. This | 647 | @var{function}, are evaluated before @code{funcall} is called. This |
| 643 | means that you can use any expression to obtain the function to be | 648 | means that you can use any expression to obtain the function to be |
| 644 | called. It also means that @code{funcall} does not see the expressions | 649 | called. It also means that @code{funcall} does not see the |
| 645 | you write for the @var{arguments}, only their values. These values are | 650 | expressions you write for the @var{arguments}, only their values. |
| 646 | @emph{not} evaluated a second time in the act of calling @var{function}; | 651 | These values are @emph{not} evaluated a second time in the act of |
| 647 | @code{funcall} enters the normal procedure for calling a function at the | 652 | calling @var{function}; the operation of @code{funcall} is like the |
| 648 | place where the arguments have already been evaluated. | 653 | normal procedure for calling a function, once its arguments have |
| 654 | already been evaluated. | ||
| 649 | 655 | ||
| 650 | The argument @var{function} must be either a Lisp function or a | 656 | The argument @var{function} must be either a Lisp function or a |
| 651 | primitive function. Special forms and macros are not allowed, because | 657 | primitive function. Special forms and macros are not allowed, because |
| @@ -1137,30 +1143,12 @@ Here are examples of these uses: | |||
| 1137 | @end example | 1143 | @end example |
| 1138 | @end defun | 1144 | @end defun |
| 1139 | 1145 | ||
| 1140 | When writing a function that extends a previously defined function, | 1146 | @code{fset} is sometimes used to save the old definition of a |
| 1141 | the following idiom is sometimes used: | 1147 | function before redefining it. That permits the new definition to |
| 1142 | 1148 | invoke the old definition. But it is unmodular and unclean for a Lisp | |
| 1143 | @example | 1149 | file to redefine a function defined elsewhere. If you want to modify |
| 1144 | (fset 'old-foo (symbol-function 'foo)) | 1150 | a function defined by another package, it is cleaner to use |
| 1145 | (defun foo () | 1151 | @code{defadvice} (@pxref{Advising Functions}). |
| 1146 | "Just like old-foo, except more so." | ||
| 1147 | @group | ||
| 1148 | (old-foo) | ||
| 1149 | (more-so)) | ||
| 1150 | @end group | ||
| 1151 | @end example | ||
| 1152 | |||
| 1153 | @noindent | ||
| 1154 | This does not work properly if @code{foo} has been defined to autoload. | ||
| 1155 | In such a case, when @code{foo} calls @code{old-foo}, Lisp attempts | ||
| 1156 | to define @code{old-foo} by loading a file. Since this presumably | ||
| 1157 | defines @code{foo} rather than @code{old-foo}, it does not produce the | ||
| 1158 | proper results. The only way to avoid this problem is to make sure the | ||
| 1159 | file is loaded before moving aside the old definition of @code{foo}. | ||
| 1160 | |||
| 1161 | But it is unmodular and unclean, in any case, for a Lisp file to | ||
| 1162 | redefine a function defined elsewhere. It is cleaner to use the advice | ||
| 1163 | facility (@pxref{Advising Functions}). | ||
| 1164 | 1152 | ||
| 1165 | @node Inline Functions | 1153 | @node Inline Functions |
| 1166 | @section Inline Functions | 1154 | @section Inline Functions |
diff --git a/lispref/hash.texi b/lispref/hash.texi index 107935f1ba0..9343196a238 100644 --- a/lispref/hash.texi +++ b/lispref/hash.texi | |||
| @@ -46,10 +46,10 @@ of object and are used only for recording interned symbols | |||
| 46 | (@pxref{Creating Symbols}). | 46 | (@pxref{Creating Symbols}). |
| 47 | 47 | ||
| 48 | @menu | 48 | @menu |
| 49 | * Creating Hash:: | 49 | * Creating Hash:: Functions to create hash tables. |
| 50 | * Hash Access:: | 50 | * Hash Access:: Reading and writing the hash table contents. |
| 51 | * Defining Hash:: | 51 | * Defining Hash:: Defining new comparison methods |
| 52 | * Other Hash:: | 52 | * Other Hash:: Miscellaneous. |
| 53 | @end menu | 53 | @end menu |
| 54 | 54 | ||
| 55 | @node Creating Hash | 55 | @node Creating Hash |
| @@ -146,11 +146,11 @@ number. | |||
| 146 | The default value is 1.5. | 146 | The default value is 1.5. |
| 147 | 147 | ||
| 148 | @item :rehash-threshold @var{threshold} | 148 | @item :rehash-threshold @var{threshold} |
| 149 | This specifies the criterion for when the hash table is ``full.'' The | 149 | This specifies the criterion for when the hash table is ``full'' (so |
| 150 | value, @var{threshold}, should be a positive floating point number, no | 150 | it should be made larger). The value, @var{threshold}, should be a |
| 151 | greater than 1. The hash table is ``full'' whenever the actual number of | 151 | positive floating point number, no greater than 1. The hash table is |
| 152 | entries exceeds this fraction of the nominal size. The default for | 152 | ``full'' whenever the actual number of entries exceeds this fraction |
| 153 | @var{threshold} is 0.8. | 153 | of the nominal size. The default for @var{threshold} is 0.8. |
| 154 | @end table | 154 | @end table |
| 155 | @end defun | 155 | @end defun |
| 156 | 156 | ||
| @@ -167,7 +167,9 @@ This function is obsolete. Use @code{make-hash-table} instead. | |||
| 167 | @section Hash Table Access | 167 | @section Hash Table Access |
| 168 | 168 | ||
| 169 | This section describes the functions for accessing and storing | 169 | This section describes the functions for accessing and storing |
| 170 | associations in a hash table. | 170 | associations in a hash table. In general, any Lisp object can be used |
| 171 | as a hash key, unless the comparison method imposes limits. Any Lisp | ||
| 172 | object can also be used as the value. | ||
| 171 | 173 | ||
| 172 | @tindex gethash | 174 | @tindex gethash |
| 173 | @defun gethash key table &optional default | 175 | @defun gethash key table &optional default |
| @@ -210,7 +212,7 @@ table. | |||
| 210 | This function calls @var{function} once for each of the associations in | 212 | This function calls @var{function} once for each of the associations in |
| 211 | @var{table}. The function @var{function} should accept two | 213 | @var{table}. The function @var{function} should accept two |
| 212 | arguments---a @var{key} listed in @var{table}, and its associated | 214 | arguments---a @var{key} listed in @var{table}, and its associated |
| 213 | @var{value}. | 215 | @var{value}. @code{maphash} returns @code{nil}. |
| 214 | @end defun | 216 | @end defun |
| 215 | 217 | ||
| 216 | @node Defining Hash | 218 | @node Defining Hash |
diff --git a/lispref/lists.texi b/lispref/lists.texi index d30dcb0c270..dbcddd741b3 100644 --- a/lispref/lists.texi +++ b/lispref/lists.texi | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, |
| 4 | @c 2003, 2004 | 4 | @c 2003, 2004, 2005 |
| 5 | @c Free Software Foundation, Inc. | 5 | @c Free Software Foundation, Inc. |
| 6 | @c See the file elisp.texi for copying conditions. | 6 | @c See the file elisp.texi for copying conditions. |
| 7 | @setfilename ../info/lists | 7 | @setfilename ../info/lists |
| @@ -18,7 +18,6 @@ the whole list. | |||
| 18 | 18 | ||
| 19 | @menu | 19 | @menu |
| 20 | * Cons Cells:: How lists are made out of cons cells. | 20 | * Cons Cells:: How lists are made out of cons cells. |
| 21 | * Lists as Boxes:: Graphical notation to explain lists. | ||
| 22 | * List-related Predicates:: Is this object a list? Comparing two lists. | 21 | * List-related Predicates:: Is this object a list? Comparing two lists. |
| 23 | * List Elements:: Extracting the pieces of a list. | 22 | * List Elements:: Extracting the pieces of a list. |
| 24 | * Building Lists:: Creating list structure. | 23 | * Building Lists:: Creating list structure. |
| @@ -86,100 +85,17 @@ cells. | |||
| 86 | The @sc{cdr} of any nonempty list @var{l} is a list containing all the | 85 | The @sc{cdr} of any nonempty list @var{l} is a list containing all the |
| 87 | elements of @var{l} except the first. | 86 | elements of @var{l} except the first. |
| 88 | 87 | ||
| 89 | @node Lists as Boxes | ||
| 90 | @comment node-name, next, previous, up | ||
| 91 | @section Lists as Linked Pairs of Boxes | ||
| 92 | @cindex box representation for lists | ||
| 93 | @cindex lists represented as boxes | ||
| 94 | @cindex cons cell as box | ||
| 95 | |||
| 96 | A cons cell can be illustrated as a pair of boxes. The first box | ||
| 97 | represents the @sc{car} and the second box represents the @sc{cdr}. | ||
| 98 | Here is an illustration of the two-element list, @code{(tulip lily)}, | ||
| 99 | made from two cons cells: | ||
| 100 | |||
| 101 | @example | ||
| 102 | @group | ||
| 103 | --------------- --------------- | ||
| 104 | | car | cdr | | car | cdr | | ||
| 105 | | tulip | o---------->| lily | nil | | ||
| 106 | | | | | | | | ||
| 107 | --------------- --------------- | ||
| 108 | @end group | ||
| 109 | @end example | ||
| 110 | |||
| 111 | Each pair of boxes represents a cons cell. Each box ``refers to'', | ||
| 112 | ``points to'' or ``holds'' a Lisp object. (These terms are | ||
| 113 | synonymous.) The first box, which describes the @sc{car} of the first | ||
| 114 | cons cell, contains the symbol @code{tulip}. The arrow from the | ||
| 115 | @sc{cdr} box of the first cons cell to the second cons cell indicates | ||
| 116 | that the @sc{cdr} of the first cons cell is the second cons cell. | ||
| 117 | |||
| 118 | The same list can be illustrated in a different sort of box notation | ||
| 119 | like this: | ||
| 120 | |||
| 121 | @example | ||
| 122 | @group | ||
| 123 | --- --- --- --- | ||
| 124 | | | |--> | | |--> nil | ||
| 125 | --- --- --- --- | ||
| 126 | | | | ||
| 127 | | | | ||
| 128 | --> tulip --> lily | ||
| 129 | @end group | ||
| 130 | @end example | ||
| 131 | |||
| 132 | Here is a more complex illustration, showing the three-element list, | ||
| 133 | @code{((pine needles) oak maple)}, the first element of which is a | ||
| 134 | two-element list: | ||
| 135 | |||
| 136 | @example | ||
| 137 | @group | ||
| 138 | --- --- --- --- --- --- | ||
| 139 | | | |--> | | |--> | | |--> nil | ||
| 140 | --- --- --- --- --- --- | ||
| 141 | | | | | ||
| 142 | | | | | ||
| 143 | | --> oak --> maple | ||
| 144 | | | ||
| 145 | | --- --- --- --- | ||
| 146 | --> | | |--> | | |--> nil | ||
| 147 | --- --- --- --- | ||
| 148 | | | | ||
| 149 | | | | ||
| 150 | --> pine --> needles | ||
| 151 | @end group | ||
| 152 | @end example | ||
| 153 | |||
| 154 | The same list represented in the first box notation looks like this: | ||
| 155 | |||
| 156 | @example | ||
| 157 | @group | ||
| 158 | -------------- -------------- -------------- | ||
| 159 | | car | cdr | | car | cdr | | car | cdr | | ||
| 160 | | o | o------->| oak | o------->| maple | nil | | ||
| 161 | | | | | | | | | | | | ||
| 162 | -- | --------- -------------- -------------- | ||
| 163 | | | ||
| 164 | | | ||
| 165 | | -------------- ---------------- | ||
| 166 | | | car | cdr | | car | cdr | | ||
| 167 | ------>| pine | o------->| needles | nil | | ||
| 168 | | | | | | | | ||
| 169 | -------------- ---------------- | ||
| 170 | @end group | ||
| 171 | @end example | ||
| 172 | |||
| 173 | @xref{Cons Cell Type}, for the read and print syntax of cons cells and | 88 | @xref{Cons Cell Type}, for the read and print syntax of cons cells and |
| 174 | lists, and for more ``box and arrow'' illustrations of lists. | 89 | lists, and for ``box and arrow'' illustrations of lists. |
| 175 | 90 | ||
| 176 | @node List-related Predicates | 91 | @node List-related Predicates |
| 177 | @section Predicates on Lists | 92 | @section Predicates on Lists |
| 178 | 93 | ||
| 179 | The following predicates test whether a Lisp object is an atom, is a | 94 | The following predicates test whether a Lisp object is an atom, |
| 180 | cons cell or is a list, or whether it is the distinguished object | 95 | whether it is a cons cell or is a list, or whether it is the |
| 181 | @code{nil}. (Many of these predicates can be defined in terms of the | 96 | distinguished object @code{nil}. (Many of these predicates can be |
| 182 | others, but they are used so often that it is worth having all of them.) | 97 | defined in terms of the others, but they are used so often that it is |
| 98 | worth having all of them.) | ||
| 183 | 99 | ||
| 184 | @defun consp object | 100 | @defun consp object |
| 185 | This function returns @code{t} if @var{object} is a cons cell, @code{nil} | 101 | This function returns @code{t} if @var{object} is a cons cell, @code{nil} |
| @@ -749,9 +665,14 @@ This returns a list of numbers starting with @var{from} and | |||
| 749 | incrementing by @var{separation}, and ending at or just before | 665 | incrementing by @var{separation}, and ending at or just before |
| 750 | @var{to}. @var{separation} can be positive or negative and defaults | 666 | @var{to}. @var{separation} can be positive or negative and defaults |
| 751 | to 1. If @var{to} is @code{nil} or numerically equal to @var{from}, | 667 | to 1. If @var{to} is @code{nil} or numerically equal to @var{from}, |
| 752 | the one element list @code{(from)} is returned. If @var{separation} | 668 | the value is the one-element list @code{(@var{from})}. If @var{to} is |
| 753 | is 0 and @var{to} is neither @code{nil} nor numerically equal to | 669 | less than @var{from} with a positive @var{separation}, or greater than |
| 754 | @var{from}, an error is signaled. | 670 | @var{from} with a negative @var{separation}, the value is @code{nil} |
| 671 | because those arguments specify an empty sequence. | ||
| 672 | |||
| 673 | If @var{separation} is 0 and @var{to} is neither @code{nil} nor | ||
| 674 | numerically equal to @var{from}, @code{number-sequence} signals an | ||
| 675 | error, since those arguments specify an infinite sequence. | ||
| 755 | 676 | ||
| 756 | All arguments can be integers or floating point numbers. However, | 677 | All arguments can be integers or floating point numbers. However, |
| 757 | floating point arguments can be tricky, because floating point | 678 | floating point arguments can be tricky, because floating point |
diff --git a/lispref/loading.texi b/lispref/loading.texi index 61c5b13ca6f..e12826af2f8 100644 --- a/lispref/loading.texi +++ b/lispref/loading.texi | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, |
| 4 | @c 2003, 2004 | 4 | @c 2003, 2004, 2005 |
| 5 | @c Free Software Foundation, Inc. | 5 | @c Free Software Foundation, Inc. |
| 6 | @c See the file elisp.texi for copying conditions. | 6 | @c See the file elisp.texi for copying conditions. |
| 7 | @setfilename ../info/loading | 7 | @setfilename ../info/loading |
| @@ -365,10 +365,12 @@ one of these suffixes, and it will not load from a file whose name is | |||
| 365 | just @var{filename} with no added suffix. | 365 | just @var{filename} with no added suffix. |
| 366 | 366 | ||
| 367 | The argument @var{docstring} is the documentation string for the | 367 | The argument @var{docstring} is the documentation string for the |
| 368 | function. Normally, this should be identical to the documentation string | 368 | function. Specifying the documentation string in the call to |
| 369 | in the function definition itself. Specifying the documentation string | 369 | @code{autoload} makes it possible to look at the documentation without |
| 370 | in the call to @code{autoload} makes it possible to look at the | 370 | loading the function's real definition. Normally, this should be |
| 371 | documentation without loading the function's real definition. | 371 | identical to the documentation string in the function definition |
| 372 | itself. If it isn't, the function definition's documentation string | ||
| 373 | takes effect when it is loaded. | ||
| 372 | 374 | ||
| 373 | If @var{interactive} is non-@code{nil}, that says @var{function} can be | 375 | If @var{interactive} is non-@code{nil}, that says @var{function} can be |
| 374 | called interactively. This lets completion in @kbd{M-x} work without | 376 | called interactively. This lets completion in @kbd{M-x} work without |
| @@ -526,8 +528,7 @@ initialized. (@xref{Defining Variables}.) | |||
| 526 | The simplest way to add an element to an alist is like this: | 528 | The simplest way to add an element to an alist is like this: |
| 527 | 529 | ||
| 528 | @example | 530 | @example |
| 529 | (setq minor-mode-alist | 531 | (push '(leif-mode " Leif") minor-mode-alist) |
| 530 | (cons '(leif-mode " Leif") minor-mode-alist)) | ||
| 531 | @end example | 532 | @end example |
| 532 | 533 | ||
| 533 | @noindent | 534 | @noindent |
| @@ -536,12 +537,15 @@ To avoid the problem, write this: | |||
| 536 | 537 | ||
| 537 | @example | 538 | @example |
| 538 | (or (assq 'leif-mode minor-mode-alist) | 539 | (or (assq 'leif-mode minor-mode-alist) |
| 539 | (setq minor-mode-alist | 540 | (push '(leif-mode " Leif") minor-mode-alist)) |
| 540 | (cons '(leif-mode " Leif") minor-mode-alist))) | ||
| 541 | @end example | 541 | @end example |
| 542 | 542 | ||
| 543 | To add an element to a list just once, you can also use @code{add-to-list} | 543 | @noindent |
| 544 | (@pxref{Setting Variables}). | 544 | or this: |
| 545 | |||
| 546 | @example | ||
| 547 | (add-to-list '(leif-mode " Leif") minor-mode-alist) | ||
| 548 | @end example | ||
| 545 | 549 | ||
| 546 | Occasionally you will want to test explicitly whether a library has | 550 | Occasionally you will want to test explicitly whether a library has |
| 547 | already been loaded. Here's one way to test, in a library, whether it | 551 | already been loaded. Here's one way to test, in a library, whether it |
| @@ -746,12 +750,12 @@ elements have these forms: | |||
| 746 | @item @var{var} | 750 | @item @var{var} |
| 747 | The symbol @var{var} was defined as a variable. | 751 | The symbol @var{var} was defined as a variable. |
| 748 | @item (defun . @var{fun}) | 752 | @item (defun . @var{fun}) |
| 749 | The @var{fun} was defined by this library. | 753 | The function @var{fun} was defined. |
| 750 | @item (t . @var{fun}) | 754 | @item (t . @var{fun}) |
| 751 | The function @var{fun} was previously an autoload before this library | 755 | The function @var{fun} was previously an autoload before this library |
| 752 | redefined it as a function. The following element is always the | 756 | redefined it as a function. The following element is always |
| 753 | symbol @var{fun}, which signifies that the library defined @var{fun} | 757 | @code{(defun . @var{fun})}, which represents defining @var{fun} as a |
| 754 | as a function. | 758 | function. |
| 755 | @item (autoload . @var{fun}) | 759 | @item (autoload . @var{fun}) |
| 756 | The function @var{fun} was defined as an autoload. | 760 | The function @var{fun} was defined as an autoload. |
| 757 | @item (require . @var{feature}) | 761 | @item (require . @var{feature}) |
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi index 1455c63fe34..0e855b499ae 100644 --- a/lispref/minibuf.texi +++ b/lispref/minibuf.texi | |||
| @@ -111,7 +111,8 @@ was supplied when Emacs was started. | |||
| 111 | Most often, the minibuffer is used to read text as a string. It can | 111 | Most often, the minibuffer is used to read text as a string. It can |
| 112 | also be used to read a Lisp object in textual form. The most basic | 112 | also be used to read a Lisp object in textual form. The most basic |
| 113 | primitive for minibuffer input is @code{read-from-minibuffer}; it can do | 113 | primitive for minibuffer input is @code{read-from-minibuffer}; it can do |
| 114 | either one. | 114 | either one. There are also specialized commands for reading |
| 115 | commands, variables, file names, etc. (@pxref{Completion}). | ||
| 115 | 116 | ||
| 116 | In most cases, you should not call minibuffer input functions in the | 117 | In most cases, you should not call minibuffer input functions in the |
| 117 | middle of a Lisp function. Instead, do all minibuffer input as part of | 118 | middle of a Lisp function. Instead, do all minibuffer input as part of |
| @@ -234,9 +235,11 @@ default, it makes the following bindings: | |||
| 234 | @code{abort-recursive-edit} | 235 | @code{abort-recursive-edit} |
| 235 | 236 | ||
| 236 | @item @kbd{M-n} | 237 | @item @kbd{M-n} |
| 238 | @itemx @key{DOWN} | ||
| 237 | @code{next-history-element} | 239 | @code{next-history-element} |
| 238 | 240 | ||
| 239 | @item @kbd{M-p} | 241 | @item @kbd{M-p} |
| 242 | @itemx @key{UP} | ||
| 240 | @code{previous-history-element} | 243 | @code{previous-history-element} |
| 241 | 244 | ||
| 242 | @item @kbd{M-s} | 245 | @item @kbd{M-s} |
diff --git a/lispref/numbers.texi b/lispref/numbers.texi index 53435da081b..776251e4933 100644 --- a/lispref/numbers.texi +++ b/lispref/numbers.texi | |||
| @@ -73,14 +73,21 @@ initial sign and optional final period. | |||
| 73 | @cindex hex numbers | 73 | @cindex hex numbers |
| 74 | @cindex octal numbers | 74 | @cindex octal numbers |
| 75 | @cindex reading numbers in hex, octal, and binary | 75 | @cindex reading numbers in hex, octal, and binary |
| 76 | In addition, the Lisp reader recognizes a syntax for integers in | 76 | The syntax for integers in bases other than 10 uses @samp{#} |
| 77 | bases other than 10: @samp{#B@var{integer}} reads @var{integer} in | 77 | followed by a letter that specifies the radix: @samp{b} for binary, |
| 78 | binary (radix 2), @samp{#O@var{integer}} reads @var{integer} in octal | 78 | @samp{o} for octal, @samp{x} for hex, or @samp{@var{radix}r} to |
| 79 | (radix 8), @samp{#X@var{integer}} reads @var{integer} in hexadecimal | 79 | specify radix @var{radix}. Case is not significant for the letter |
| 80 | (radix 16), and @samp{#@var{radix}r@var{integer}} reads @var{integer} | 80 | that specifies the radix. Thus, @samp{#b@var{integer}} reads |
| 81 | in radix @var{radix} (where @var{radix} is between 2 and 36, | 81 | @var{integer} in binary, and @samp{#@var{radix}r@var{integer}} reads |
| 82 | inclusively). Case is not significant for the letter after @samp{#} | 82 | @var{integer} in radix @var{radix}. Allowed values of @var{radix} run |
| 83 | (@samp{B}, @samp{O}, etc.) that denotes the radix. | 83 | from 2 to 36. For example: |
| 84 | |||
| 85 | @example | ||
| 86 | #b101100 @result{} 44 | ||
| 87 | #o54 @result{} 44 | ||
| 88 | #x2c @result{} 44 | ||
| 89 | #24r1k @result{} 44 | ||
| 90 | @end example | ||
| 84 | 91 | ||
| 85 | To understand how various functions work on integers, especially the | 92 | To understand how various functions work on integers, especially the |
| 86 | bitwise operators (@pxref{Bitwise Operations}), it is often helpful to | 93 | bitwise operators (@pxref{Bitwise Operations}), it is often helpful to |
| @@ -211,13 +218,12 @@ down to an integer. | |||
| 211 | @node Predicates on Numbers | 218 | @node Predicates on Numbers |
| 212 | @section Type Predicates for Numbers | 219 | @section Type Predicates for Numbers |
| 213 | 220 | ||
| 214 | The functions in this section test whether the argument is a number or | 221 | The functions in this section test for numbers, or for a specific |
| 215 | whether it is a certain sort of number. The functions @code{integerp} | 222 | type of number. The functions @code{integerp} and @code{floatp} can |
| 216 | and @code{floatp} can take any type of Lisp object as argument (the | 223 | take any type of Lisp object as argument (they would not be of much |
| 217 | predicates would not be of much use otherwise); but the @code{zerop} | 224 | use otherwise), but the @code{zerop} predicate requires a number as |
| 218 | predicate requires a number as its argument. See also | 225 | its argument. See also @code{integer-or-marker-p} and |
| 219 | @code{integer-or-marker-p} and @code{number-or-marker-p}, in | 226 | @code{number-or-marker-p}, in @ref{Predicates on Markers}. |
| 220 | @ref{Predicates on Markers}. | ||
| 221 | 227 | ||
| 222 | @defun floatp object | 228 | @defun floatp object |
| 223 | This predicate tests whether its argument is a floating point | 229 | This predicate tests whether its argument is a floating point |
| @@ -251,7 +257,7 @@ considered non-negative. | |||
| 251 | This predicate tests whether its argument is zero, and returns @code{t} | 257 | This predicate tests whether its argument is zero, and returns @code{t} |
| 252 | if so, @code{nil} otherwise. The argument must be a number. | 258 | if so, @code{nil} otherwise. The argument must be a number. |
| 253 | 259 | ||
| 254 | These two forms are equivalent: @code{(zerop x)} @equiv{} @code{(= x 0)}. | 260 | @code{(zerop x)} is equivalent to @code{(= x 0)}. |
| 255 | @end defun | 261 | @end defun |
| 256 | 262 | ||
| 257 | @node Comparison of Numbers | 263 | @node Comparison of Numbers |
| @@ -275,10 +281,11 @@ numbers or markers. However, it is a good idea to use @code{=} if you | |||
| 275 | can, even for comparing integers, just in case we change the | 281 | can, even for comparing integers, just in case we change the |
| 276 | representation of integers in a future Emacs version. | 282 | representation of integers in a future Emacs version. |
| 277 | 283 | ||
| 278 | Sometimes it is useful to compare numbers with @code{equal}; it treats | 284 | Sometimes it is useful to compare numbers with @code{equal}; it |
| 279 | two numbers as equal if they have the same data type (both integers, or | 285 | treats two numbers as equal if they have the same data type (both |
| 280 | both floating point) and the same value. By contrast, @code{=} can | 286 | integers, or both floating point) and the same value. By contrast, |
| 281 | treat an integer and a floating point number as equal. | 287 | @code{=} can treat an integer and a floating point number as equal. |
| 288 | @xref{Equality Predicates}. | ||
| 282 | 289 | ||
| 283 | There is another wrinkle: because floating point arithmetic is not | 290 | There is another wrinkle: because floating point arithmetic is not |
| 284 | exact, it is often a bad idea to check for equality of two floating | 291 | exact, it is often a bad idea to check for equality of two floating |
| @@ -309,10 +316,10 @@ returns @code{t} if so, @code{nil} otherwise. | |||
| 309 | @end defun | 316 | @end defun |
| 310 | 317 | ||
| 311 | @defun eql value1 value2 | 318 | @defun eql value1 value2 |
| 312 | This function compares two floating point numbers like @code{=}, and | 319 | This function acts like @code{eq} except when both arguments are |
| 313 | compares two integers like @code{=}, and acts like @code{eq} in all | 320 | numbers. It compares numbers by type and numberic value, so that |
| 314 | other cases. Thus, @code{(eql 1.0 1)} returns @code{nil}, but | 321 | @code{(eql 1.0 1)} returns @code{nil}, but @code{(eql 1.0 1.0)} and |
| 315 | @code{(eql 1.0 1.0)} and @code{(eql 1 1)} both return @code{t}. | 322 | @code{(eql 1 1)} both return @code{t}. |
| 316 | @end defun | 323 | @end defun |
| 317 | 324 | ||
| 318 | @defun /= number-or-marker1 number-or-marker2 | 325 | @defun /= number-or-marker1 number-or-marker2 |
| @@ -345,7 +352,7 @@ otherwise. | |||
| 345 | 352 | ||
| 346 | @defun max number-or-marker &rest numbers-or-markers | 353 | @defun max number-or-marker &rest numbers-or-markers |
| 347 | This function returns the largest of its arguments. | 354 | This function returns the largest of its arguments. |
| 348 | If any of the argument is floating-point, the value is returned | 355 | If any of the arguments is floating-point, the value is returned |
| 349 | as floating point, even if it was given as an integer. | 356 | as floating point, even if it was given as an integer. |
| 350 | 357 | ||
| 351 | @example | 358 | @example |
| @@ -360,7 +367,7 @@ as floating point, even if it was given as an integer. | |||
| 360 | 367 | ||
| 361 | @defun min number-or-marker &rest numbers-or-markers | 368 | @defun min number-or-marker &rest numbers-or-markers |
| 362 | This function returns the smallest of its arguments. | 369 | This function returns the smallest of its arguments. |
| 363 | If any of the argument is floating-point, the value is returned | 370 | If any of the arguments is floating-point, the value is returned |
| 364 | as floating point, even if it was given as an integer. | 371 | as floating point, even if it was given as an integer. |
| 365 | 372 | ||
| 366 | @example | 373 | @example |
| @@ -1147,8 +1154,7 @@ approximately. | |||
| 1147 | @defun expt x y | 1154 | @defun expt x y |
| 1148 | This function returns @var{x} raised to power @var{y}. If both | 1155 | This function returns @var{x} raised to power @var{y}. If both |
| 1149 | arguments are integers and @var{y} is positive, the result is an | 1156 | arguments are integers and @var{y} is positive, the result is an |
| 1150 | integer; in this case, it is truncated to fit the range of possible | 1157 | integer; in this case, overflow causes truncation, so watch out. |
| 1151 | integer values. | ||
| 1152 | @end defun | 1158 | @end defun |
| 1153 | 1159 | ||
| 1154 | @defun sqrt arg | 1160 | @defun sqrt arg |
diff --git a/lispref/objects.texi b/lispref/objects.texi index 43ecb02f09e..f0bef593f29 100644 --- a/lispref/objects.texi +++ b/lispref/objects.texi | |||
| @@ -68,36 +68,37 @@ to use these types can be found in later chapters. | |||
| 68 | 68 | ||
| 69 | The @dfn{printed representation} of an object is the format of the | 69 | The @dfn{printed representation} of an object is the format of the |
| 70 | output generated by the Lisp printer (the function @code{prin1}) for | 70 | output generated by the Lisp printer (the function @code{prin1}) for |
| 71 | that object. The @dfn{read syntax} of an object is the format of the | 71 | that object. Every data type has a unique printed representation. |
| 72 | input accepted by the Lisp reader (the function @code{read}) for that | 72 | The @dfn{read syntax} of an object is the format of the input accepted |
| 73 | object. @xref{Read and Print}. | 73 | by the Lisp reader (the function @code{read}) for that object. This |
| 74 | 74 | is not necessarily unique; many kinds of object have more than one | |
| 75 | Most objects have more than one possible read syntax. Some types of | 75 | syntax. @xref{Read and Print}. |
| 76 | object have no read syntax, since it may not make sense to enter objects | ||
| 77 | of these types directly in a Lisp program. Except for these cases, the | ||
| 78 | printed representation of an object is also a read syntax for it. | ||
| 79 | |||
| 80 | In other languages, an expression is text; it has no other form. In | ||
| 81 | Lisp, an expression is primarily a Lisp object and only secondarily the | ||
| 82 | text that is the object's read syntax. Often there is no need to | ||
| 83 | emphasize this distinction, but you must keep it in the back of your | ||
| 84 | mind, or you will occasionally be very confused. | ||
| 85 | 76 | ||
| 86 | @cindex hash notation | 77 | @cindex hash notation |
| 87 | Every type has a printed representation. Some types have no read | 78 | In most cases, an object's printed representation is also a read |
| 88 | syntax---for example, the buffer type has none. Objects of these types | 79 | syntax for the object. However, some types have no read syntax, since |
| 89 | are printed in @dfn{hash notation}: the characters @samp{#<} followed by | 80 | it does not make sense to enter objects of these types as constants in |
| 90 | a descriptive string (typically the type name followed by the name of | 81 | a Lisp program. These objects are printed in @dfn{hash notation}: the |
| 91 | the object), and closed with a matching @samp{>}. Hash notation cannot | 82 | characters @samp{#<} followed by a descriptive string (typically the |
| 92 | be read at all, so the Lisp reader signals the error | 83 | type name followed by the name of the object), and closed with a |
| 93 | @code{invalid-read-syntax} whenever it encounters @samp{#<}. | 84 | matching @samp{>}. For example: |
| 94 | @kindex invalid-read-syntax | ||
| 95 | 85 | ||
| 96 | @example | 86 | @example |
| 97 | (current-buffer) | 87 | (current-buffer) |
| 98 | @result{} #<buffer objects.texi> | 88 | @result{} #<buffer objects.texi> |
| 99 | @end example | 89 | @end example |
| 100 | 90 | ||
| 91 | @noindent | ||
| 92 | Hash notation cannot be read at all, so the Lisp reader signals the | ||
| 93 | error @code{invalid-read-syntax} whenever it encounters @samp{#<}. | ||
| 94 | @kindex invalid-read-syntax | ||
| 95 | |||
| 96 | In other languages, an expression is text; it has no other form. In | ||
| 97 | Lisp, an expression is primarily a Lisp object and only secondarily the | ||
| 98 | text that is the object's read syntax. Often there is no need to | ||
| 99 | emphasize this distinction, but you must keep it in the back of your | ||
| 100 | mind, or you will occasionally be very confused. | ||
| 101 | |||
| 101 | When you evaluate an expression interactively, the Lisp interpreter | 102 | When you evaluate an expression interactively, the Lisp interpreter |
| 102 | first reads the textual representation of it, producing a Lisp object, | 103 | first reads the textual representation of it, producing a Lisp object, |
| 103 | and then evaluates that object (@pxref{Evaluation}). However, | 104 | and then evaluates that object (@pxref{Evaluation}). However, |
| @@ -204,9 +205,11 @@ leading @samp{+} or a final @samp{.}. | |||
| 204 | @subsection Floating Point Type | 205 | @subsection Floating Point Type |
| 205 | 206 | ||
| 206 | Floating point numbers are the computer equivalent of scientific | 207 | Floating point numbers are the computer equivalent of scientific |
| 207 | notation. The precise number of significant figures and the range of | 208 | notation; you can think of a floating point number as a fraction |
| 208 | possible exponents is machine-specific; Emacs always uses the C data | 209 | together with a power of ten. The precise number of significant |
| 209 | type @code{double} to store the value. | 210 | figures and the range of possible exponents is machine-specific; Emacs |
| 211 | uses the C data type @code{double} to store the value, and internally | ||
| 212 | this records a power of 2 rather than a power of 10. | ||
| 210 | 213 | ||
| 211 | The printed representation for floating point numbers requires either | 214 | The printed representation for floating point numbers requires either |
| 212 | a decimal point (with at least one digit following), an exponent, or | 215 | a decimal point (with at least one digit following), an exponent, or |
| @@ -474,9 +477,10 @@ following text.) | |||
| 474 | @node Symbol Type | 477 | @node Symbol Type |
| 475 | @subsection Symbol Type | 478 | @subsection Symbol Type |
| 476 | 479 | ||
| 477 | A @dfn{symbol} in GNU Emacs Lisp is an object with a name. The symbol | 480 | A @dfn{symbol} in GNU Emacs Lisp is an object with a name. The |
| 478 | name serves as the printed representation of the symbol. In ordinary | 481 | symbol name serves as the printed representation of the symbol. In |
| 479 | use, the name is unique---no two symbols have the same name. | 482 | ordinary Lisp use, with one single obarray (@pxref{Creating Symbols}, |
| 483 | a symbol's name is unique---no two symbols have the same name. | ||
| 480 | 484 | ||
| 481 | A symbol can serve as a variable, as a function name, or to hold a | 485 | A symbol can serve as a variable, as a function name, or to hold a |
| 482 | property list. Or it may serve only to be distinct from all other Lisp | 486 | property list. Or it may serve only to be distinct from all other Lisp |
| @@ -606,18 +610,10 @@ Lisp are implicit. | |||
| 606 | 610 | ||
| 607 | A @dfn{list} is a series of cons cells, linked together so that the | 611 | A @dfn{list} is a series of cons cells, linked together so that the |
| 608 | @sc{cdr} slot of each cons cell holds either the next cons cell or the | 612 | @sc{cdr} slot of each cons cell holds either the next cons cell or the |
| 609 | empty list. @xref{Lists}, for functions that work on lists. Because | 613 | empty list. The empty list is actually the symbol @code{nil}. |
| 610 | most cons cells are used as part of lists, the phrase @dfn{list | 614 | @xref{Lists}, for functions that work on lists. Because most cons |
| 611 | structure} has come to refer to any structure made out of cons cells. | 615 | cells are used as part of lists, the phrase @dfn{list structure} has |
| 612 | 616 | come to refer to any structure made out of cons cells. | |
| 613 | The names @sc{car} and @sc{cdr} derive from the history of Lisp. The | ||
| 614 | original Lisp implementation ran on an @w{IBM 704} computer which | ||
| 615 | divided words into two parts, called the ``address'' part and the | ||
| 616 | ``decrement''; @sc{car} was an instruction to extract the contents of | ||
| 617 | the address part of a register, and @sc{cdr} an instruction to extract | ||
| 618 | the contents of the decrement. By contrast, ``cons cells'' are named | ||
| 619 | for the function @code{cons} that creates them, which in turn was named | ||
| 620 | for its purpose, the construction of cells. | ||
| 621 | 617 | ||
| 622 | @cindex atom | 618 | @cindex atom |
| 623 | Because cons cells are so central to Lisp, we also have a word for | 619 | Because cons cells are so central to Lisp, we also have a word for |
| @@ -627,7 +623,18 @@ for its purpose, the construction of cells. | |||
| 627 | @cindex parenthesis | 623 | @cindex parenthesis |
| 628 | The read syntax and printed representation for lists are identical, and | 624 | The read syntax and printed representation for lists are identical, and |
| 629 | consist of a left parenthesis, an arbitrary number of elements, and a | 625 | consist of a left parenthesis, an arbitrary number of elements, and a |
| 630 | right parenthesis. | 626 | right parenthesis. Here are examples of lists: |
| 627 | |||
| 628 | @example | ||
| 629 | (A 2 "A") ; @r{A list of three elements.} | ||
| 630 | () ; @r{A list of no elements (the empty list).} | ||
| 631 | nil ; @r{A list of no elements (the empty list).} | ||
| 632 | ("A ()") ; @r{A list of one element: the string @code{"A ()"}.} | ||
| 633 | (A ()) ; @r{A list of two elements: @code{A} and the empty list.} | ||
| 634 | (A nil) ; @r{Equivalent to the previous.} | ||
| 635 | ((A B C)) ; @r{A list of one element} | ||
| 636 | ; @r{(which is a list of three elements).} | ||
| 637 | @end example | ||
| 631 | 638 | ||
| 632 | Upon reading, each object inside the parentheses becomes an element | 639 | Upon reading, each object inside the parentheses becomes an element |
| 633 | of the list. That is, a cons cell is made for each element. The | 640 | of the list. That is, a cons cell is made for each element. The |
| @@ -636,8 +643,26 @@ slot refers to the next cons cell of the list, which holds the next | |||
| 636 | element in the list. The @sc{cdr} slot of the last cons cell is set to | 643 | element in the list. The @sc{cdr} slot of the last cons cell is set to |
| 637 | hold @code{nil}. | 644 | hold @code{nil}. |
| 638 | 645 | ||
| 646 | The names @sc{car} and @sc{cdr} derive from the history of Lisp. The | ||
| 647 | original Lisp implementation ran on an @w{IBM 704} computer which | ||
| 648 | divided words into two parts, called the ``address'' part and the | ||
| 649 | ``decrement''; @sc{car} was an instruction to extract the contents of | ||
| 650 | the address part of a register, and @sc{cdr} an instruction to extract | ||
| 651 | the contents of the decrement. By contrast, ``cons cells'' are named | ||
| 652 | for the function @code{cons} that creates them, which in turn was named | ||
| 653 | for its purpose, the construction of cells. | ||
| 654 | |||
| 655 | @menu | ||
| 656 | * Box Diagrams:: Drawing pictures of lists. | ||
| 657 | * Dotted Pair Notation:: A general syntax for cons cells. | ||
| 658 | * Association List Type:: A specially constructed list. | ||
| 659 | @end menu | ||
| 660 | |||
| 661 | @node Box Diagrams | ||
| 662 | @subsubsection Drawing Lists as Box Diagrams | ||
| 639 | @cindex box diagrams, for lists | 663 | @cindex box diagrams, for lists |
| 640 | @cindex diagrams, boxed, for lists | 664 | @cindex diagrams, boxed, for lists |
| 665 | |||
| 641 | A list can be illustrated by a diagram in which the cons cells are | 666 | A list can be illustrated by a diagram in which the cons cells are |
| 642 | shown as pairs of boxes, like dominoes. (The Lisp reader cannot read | 667 | shown as pairs of boxes, like dominoes. (The Lisp reader cannot read |
| 643 | such an illustration; unlike the textual notation, which can be | 668 | such an illustration; unlike the textual notation, which can be |
| @@ -688,19 +713,6 @@ buttercup)}, sketched in a different manner: | |||
| 688 | to the symbol @code{nil}. In other words, @code{nil} is both a symbol | 713 | to the symbol @code{nil}. In other words, @code{nil} is both a symbol |
| 689 | and a list. | 714 | and a list. |
| 690 | 715 | ||
| 691 | Here are examples of lists written in Lisp syntax: | ||
| 692 | |||
| 693 | @example | ||
| 694 | (A 2 "A") ; @r{A list of three elements.} | ||
| 695 | () ; @r{A list of no elements (the empty list).} | ||
| 696 | nil ; @r{A list of no elements (the empty list).} | ||
| 697 | ("A ()") ; @r{A list of one element: the string @code{"A ()"}.} | ||
| 698 | (A ()) ; @r{A list of two elements: @code{A} and the empty list.} | ||
| 699 | (A nil) ; @r{Equivalent to the previous.} | ||
| 700 | ((A B C)) ; @r{A list of one element} | ||
| 701 | ; @r{(which is a list of three elements).} | ||
| 702 | @end example | ||
| 703 | |||
| 704 | Here is the list @code{(A ())}, or equivalently @code{(A nil)}, | 716 | Here is the list @code{(A ())}, or equivalently @code{(A nil)}, |
| 705 | depicted with boxes and arrows: | 717 | depicted with boxes and arrows: |
| 706 | 718 | ||
| @@ -715,27 +727,64 @@ depicted with boxes and arrows: | |||
| 715 | @end group | 727 | @end group |
| 716 | @end example | 728 | @end example |
| 717 | 729 | ||
| 718 | @menu | 730 | Here is a more complex illustration, showing the three-element list, |
| 719 | * Dotted Pair Notation:: An alternative syntax for lists. | 731 | @code{((pine needles) oak maple)}, the first element of which is a |
| 720 | * Association List Type:: A specially constructed list. | 732 | two-element list: |
| 721 | @end menu | 733 | |
| 734 | @example | ||
| 735 | @group | ||
| 736 | --- --- --- --- --- --- | ||
| 737 | | | |--> | | |--> | | |--> nil | ||
| 738 | --- --- --- --- --- --- | ||
| 739 | | | | | ||
| 740 | | | | | ||
| 741 | | --> oak --> maple | ||
| 742 | | | ||
| 743 | | --- --- --- --- | ||
| 744 | --> | | |--> | | |--> nil | ||
| 745 | --- --- --- --- | ||
| 746 | | | | ||
| 747 | | | | ||
| 748 | --> pine --> needles | ||
| 749 | @end group | ||
| 750 | @end example | ||
| 751 | |||
| 752 | The same list represented in the first box notation looks like this: | ||
| 753 | |||
| 754 | @example | ||
| 755 | @group | ||
| 756 | -------------- -------------- -------------- | ||
| 757 | | car | cdr | | car | cdr | | car | cdr | | ||
| 758 | | o | o------->| oak | o------->| maple | nil | | ||
| 759 | | | | | | | | | | | | ||
| 760 | -- | --------- -------------- -------------- | ||
| 761 | | | ||
| 762 | | | ||
| 763 | | -------------- ---------------- | ||
| 764 | | | car | cdr | | car | cdr | | ||
| 765 | ------>| pine | o------->| needles | nil | | ||
| 766 | | | | | | | | ||
| 767 | -------------- ---------------- | ||
| 768 | @end group | ||
| 769 | @end example | ||
| 722 | 770 | ||
| 723 | @node Dotted Pair Notation | 771 | @node Dotted Pair Notation |
| 724 | @comment node-name, next, previous, up | ||
| 725 | @subsubsection Dotted Pair Notation | 772 | @subsubsection Dotted Pair Notation |
| 726 | @cindex dotted pair notation | 773 | @cindex dotted pair notation |
| 727 | @cindex @samp{.} in lists | 774 | @cindex @samp{.} in lists |
| 728 | 775 | ||
| 729 | @dfn{Dotted pair notation} is an alternative syntax for cons cells | 776 | @dfn{Dotted pair notation} is a general syntax for cons cells that |
| 730 | that represents the @sc{car} and @sc{cdr} explicitly. In this syntax, | 777 | represents the @sc{car} and @sc{cdr} explicitly. In this syntax, |
| 731 | @code{(@var{a} .@: @var{b})} stands for a cons cell whose @sc{car} is | 778 | @code{(@var{a} .@: @var{b})} stands for a cons cell whose @sc{car} is |
| 732 | the object @var{a}, and whose @sc{cdr} is the object @var{b}. Dotted | 779 | the object @var{a}, and whose @sc{cdr} is the object @var{b}. Dotted |
| 733 | pair notation is therefore more general than list syntax. In the dotted | 780 | pair notation is more general than list syntax because the @sc{cdr} |
| 734 | pair notation, the list @samp{(1 2 3)} is written as @samp{(1 . (2 . (3 | 781 | does not have to be a list. However, it is more cumbersome in cases |
| 735 | . nil)))}. For @code{nil}-terminated lists, you can use either | 782 | where list syntax would work. In dotted pair notation, the list |
| 736 | notation, but list notation is usually clearer and more convenient. | 783 | @samp{(1 2 3)} is written as @samp{(1 . (2 . (3 . nil)))}. For |
| 737 | When printing a list, the dotted pair notation is only used if the | 784 | @code{nil}-terminated lists, you can use either notation, but list |
| 738 | @sc{cdr} of a cons cell is not a list. | 785 | notation is usually clearer and more convenient. When printing a |
| 786 | list, the dotted pair notation is only used if the @sc{cdr} of a cons | ||
| 787 | cell is not a list. | ||
| 739 | 788 | ||
| 740 | Here's an example using boxes to illustrate dotted pair notation. | 789 | Here's an example using boxes to illustrate dotted pair notation. |
| 741 | This example shows the pair @code{(rose . violet)}: | 790 | This example shows the pair @code{(rose . violet)}: |
| @@ -860,8 +909,9 @@ Once an array is created, its length is fixed. | |||
| 860 | 909 | ||
| 861 | All Emacs Lisp arrays are one-dimensional. (Most other programming | 910 | All Emacs Lisp arrays are one-dimensional. (Most other programming |
| 862 | languages support multidimensional arrays, but they are not essential; | 911 | languages support multidimensional arrays, but they are not essential; |
| 863 | you can get the same effect with an array of arrays.) Each type of | 912 | you can get the same effect with nested one-dimensional arrays.) Each |
| 864 | array has its own read syntax; see the following sections for details. | 913 | type of array has its own read syntax; see the following sections for |
| 914 | details. | ||
| 865 | 915 | ||
| 866 | The array type is contained in the sequence type and | 916 | The array type is contained in the sequence type and |
| 867 | contains the string type, the vector type, the bool-vector type, and the | 917 | contains the string type, the vector type, the bool-vector type, and the |
| @@ -1661,6 +1711,9 @@ with references to further information. | |||
| 1661 | @item functionp | 1711 | @item functionp |
| 1662 | @xref{Functions, functionp}. | 1712 | @xref{Functions, functionp}. |
| 1663 | 1713 | ||
| 1714 | @item hash-table-p | ||
| 1715 | @xref{Other Hash, hash-table-p}. | ||
| 1716 | |||
| 1664 | @item integer-or-marker-p | 1717 | @item integer-or-marker-p |
| 1665 | @xref{Predicates on Markers, integer-or-marker-p}. | 1718 | @xref{Predicates on Markers, integer-or-marker-p}. |
| 1666 | 1719 | ||
diff --git a/lispref/streams.texi b/lispref/streams.texi index 599416fe679..2f27fe193dc 100644 --- a/lispref/streams.texi +++ b/lispref/streams.texi | |||
| @@ -338,6 +338,7 @@ For example: | |||
| 338 | @defvar standard-input | 338 | @defvar standard-input |
| 339 | This variable holds the default input stream---the stream that | 339 | This variable holds the default input stream---the stream that |
| 340 | @code{read} uses when the @var{stream} argument is @code{nil}. | 340 | @code{read} uses when the @var{stream} argument is @code{nil}. |
| 341 | The default is @code{t}, meaning use the minibuffer. | ||
| 341 | @end defvar | 342 | @end defvar |
| 342 | 343 | ||
| 343 | @node Output Streams | 344 | @node Output Streams |
| @@ -684,6 +685,7 @@ returns @code{"The buffer is foo"}. | |||
| 684 | @defvar standard-output | 685 | @defvar standard-output |
| 685 | The value of this variable is the default output stream---the stream | 686 | The value of this variable is the default output stream---the stream |
| 686 | that print functions use when the @var{stream} argument is @code{nil}. | 687 | that print functions use when the @var{stream} argument is @code{nil}. |
| 688 | The default is @code{t}, meaning display in the echo area. | ||
| 687 | @end defvar | 689 | @end defvar |
| 688 | 690 | ||
| 689 | @defvar print-quoted | 691 | @defvar print-quoted |
diff --git a/lispref/symbols.texi b/lispref/symbols.texi index 858918445ff..92c8b0f1e82 100644 --- a/lispref/symbols.texi +++ b/lispref/symbols.texi | |||
| @@ -115,10 +115,10 @@ the four cells of the symbol @code{buffer-file-name}: | |||
| 115 | @result{} "buffer-file-name" | 115 | @result{} "buffer-file-name" |
| 116 | (symbol-value 'buffer-file-name) | 116 | (symbol-value 'buffer-file-name) |
| 117 | @result{} "/gnu/elisp/symbols.texi" | 117 | @result{} "/gnu/elisp/symbols.texi" |
| 118 | (symbol-plist 'buffer-file-name) | ||
| 119 | @result{} (variable-documentation 29529) | ||
| 120 | (symbol-function 'buffer-file-name) | 118 | (symbol-function 'buffer-file-name) |
| 121 | @result{} #<subr buffer-file-name> | 119 | @result{} #<subr buffer-file-name> |
| 120 | (symbol-plist 'buffer-file-name) | ||
| 121 | @result{} (variable-documentation 29529) | ||
| 122 | @end example | 122 | @end example |
| 123 | 123 | ||
| 124 | @noindent | 124 | @noindent |
diff --git a/lispref/variables.texi b/lispref/variables.texi index 1f793b8f03f..de5fb40618f 100644 --- a/lispref/variables.texi +++ b/lispref/variables.texi | |||
| @@ -1429,8 +1429,11 @@ variables that major modes set should not be marked permanent. | |||
| 1429 | The function @code{kill-all-local-variables} runs this normal hook | 1429 | The function @code{kill-all-local-variables} runs this normal hook |
| 1430 | before it does anything else. This gives major modes a way to arrange | 1430 | before it does anything else. This gives major modes a way to arrange |
| 1431 | for something special to be done if the user switches to a different | 1431 | for something special to be done if the user switches to a different |
| 1432 | major mode. For best results, make this variable buffer-local, so that | 1432 | major mode. It is also useful for buffer-specific minor modes |
| 1433 | it will disappear after doing its job and will not interfere with the | 1433 | that should be forgotten if the user changes the major mode. |
| 1434 | |||
| 1435 | For best results, make this variable buffer-local, so that it will | ||
| 1436 | disappear after doing its job and will not interfere with the | ||
| 1434 | subsequent major mode. @xref{Hooks}. | 1437 | subsequent major mode. @xref{Hooks}. |
| 1435 | @end defvar | 1438 | @end defvar |
| 1436 | 1439 | ||