aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorKenichi Handa2012-10-24 00:47:51 +0900
committerKenichi Handa2012-10-24 00:47:51 +0900
commit6a8f8193298e05931baeebb1bd3aba6f8f5a7b5e (patch)
treefcee273be31e69f367b6f820aa32de660e541b2f /doc
parent7e70a15287ee1ae5461d47e5a96d6c455aefaf57 (diff)
parentd106953274d29b6be4ef7e2c442078c81a52ff2f (diff)
downloademacs-6a8f8193298e05931baeebb1bd3aba6f8f5a7b5e.tar.gz
emacs-6a8f8193298e05931baeebb1bd3aba6f8f5a7b5e.zip
merge trunk
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog8
-rw-r--r--doc/emacs/custom.texi13
-rw-r--r--doc/emacs/kmacro.texi9
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi14
-rw-r--r--doc/lispref/ChangeLog26
-rw-r--r--doc/lispref/display.texi8
-rw-r--r--doc/lispref/files.texi5
-rw-r--r--doc/lispref/functions.texi2
-rw-r--r--doc/lispref/hooks.texi10
-rw-r--r--doc/lispref/intro.texi2
-rw-r--r--doc/lispref/keymaps.texi10
-rw-r--r--doc/lispref/lists.texi2
-rw-r--r--doc/lispref/loading.texi4
-rw-r--r--doc/lispref/modes.texi6
-rw-r--r--doc/lispref/os.texi2
-rw-r--r--doc/lispref/text.texi9
-rw-r--r--doc/lispref/tips.texi19
-rw-r--r--doc/misc/ChangeLog15
-rw-r--r--doc/misc/Makefile.in6
-rw-r--r--doc/misc/cl.texi425
-rw-r--r--doc/misc/dbus.texi4
-rw-r--r--doc/misc/ede.texi2
-rw-r--r--doc/misc/ediff.texi2
-rw-r--r--doc/misc/forms.texi4
-rw-r--r--doc/misc/gnus.texi2
-rw-r--r--doc/misc/mh-e.texi6
-rw-r--r--doc/misc/sem-user.texi2
-rw-r--r--doc/misc/tramp.texi32
28 files changed, 335 insertions, 314 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 66bb2de921b..90beb08233d 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,11 @@
12012-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * custom.texi (Hooks): Clarify that -hooks is deprecated.
4
52012-10-23 Chong Yidong <cyd@gnu.org>
6
7 * kmacro.texi (Edit Keyboard Macro): Fix typo.
8
12012-10-18 Dani Moncayo <dmoncayo@gmail.com> 92012-10-18 Dani Moncayo <dmoncayo@gmail.com>
2 10
3 * mini.texi (Completion Options): Fix off-by-one error. (Bug#12644) 11 * mini.texi (Completion Options): Fix off-by-one error. (Bug#12644)
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 68219d7890f..a614126dbc0 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -838,7 +838,8 @@ is a normal hook.
838 838
839@cindex abnormal hook 839@cindex abnormal hook
840 A few hooks are @dfn{abnormal hooks}. Their names end in 840 A few hooks are @dfn{abnormal hooks}. Their names end in
841@samp{-hooks} or @samp{-functions}, instead of @samp{-hook}. What 841@samp{-functions}, instead of @samp{-hook} (some old code may also use
842the deprecated suffix @samp{-hooks}). What
842makes these hooks abnormal is the way its functions are 843makes these hooks abnormal is the way its functions are
843called---perhaps they are given arguments, or perhaps the values they 844called---perhaps they are given arguments, or perhaps the values they
844return are used in some way. For example, 845return are used in some way. For example,
@@ -1735,11 +1736,11 @@ and @kbd{C-c p} in Texinfo mode:
1735 1736
1736@example 1737@example
1737(add-hook 'texinfo-mode-hook 1738(add-hook 'texinfo-mode-hook
1738 '(lambda () 1739 (lambda ()
1739 (define-key texinfo-mode-map "\C-cp" 1740 (define-key texinfo-mode-map "\C-cp"
1740 'backward-paragraph) 1741 'backward-paragraph)
1741 (define-key texinfo-mode-map "\C-cn" 1742 (define-key texinfo-mode-map "\C-cn"
1742 'forward-paragraph))) 1743 'forward-paragraph)))
1743@end example 1744@end example
1744 1745
1745@node Modifier Keys 1746@node Modifier Keys
diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi
index 7a3f3151e5c..3b83d24e405 100644
--- a/doc/emacs/kmacro.texi
+++ b/doc/emacs/kmacro.texi
@@ -482,10 +482,11 @@ Edit the last 300 keystrokes as a keyboard macro
482@kindex C-x C-k C-e 482@kindex C-x C-k C-e
483@kindex C-x C-k RET 483@kindex C-x C-k RET
484 You can edit the last keyboard macro by typing @kbd{C-x C-k C-e} or 484 You can edit the last keyboard macro by typing @kbd{C-x C-k C-e} or
485@kbd{C-x C-k RET} (@code{kmacro-edit-macro}). This formats the macro 485@kbd{C-x C-k @key{RET}} (@code{kmacro-edit-macro}). This formats the
486definition in a buffer and enters a specialized major mode for editing 486macro definition in a buffer and enters a specialized major mode for
487it. Type @kbd{C-h m} once in that buffer to display details of how to 487editing it. Type @kbd{C-h m} once in that buffer to display details
488edit the macro. When you are finished editing, type @kbd{C-c C-c}. 488of how to edit the macro. When you are finished editing, type
489@kbd{C-c C-c}.
489 490
490@findex edit-kbd-macro 491@findex edit-kbd-macro
491@kindex C-x C-k e 492@kindex C-x C-k e
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 55c3ef4e09e..70ddb81c776 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -17909,10 +17909,10 @@ file that set values:
17909@group 17909@group
17910;; Set calendar highlighting colors 17910;; Set calendar highlighting colors
17911(setq calendar-load-hook 17911(setq calendar-load-hook
17912 '(lambda () 17912 (lambda ()
17913 (set-face-foreground 'diary-face "skyblue") 17913 (set-face-foreground 'diary-face "skyblue")
17914 (set-face-background 'holiday-face "slate blue") 17914 (set-face-background 'holiday-face "slate blue")
17915 (set-face-foreground 'holiday-face "white"))) 17915 (set-face-foreground 'holiday-face "white")))
17916@end group 17916@end group
17917@end smallexample 17917@end smallexample
17918 17918
@@ -20947,7 +20947,7 @@ not yet seen, @code{mapcar} and @code{lambda}.
20947@group 20947@group
20948(defun one-fiftieth (full-range) 20948(defun one-fiftieth (full-range)
20949 "Return list, each number one-fiftieth of previous." 20949 "Return list, each number one-fiftieth of previous."
20950 (mapcar '(lambda (arg) (/ arg 50)) full-range)) 20950 (mapcar (lambda (arg) (/ arg 50)) full-range))
20951@end group 20951@end group
20952@end smallexample 20952@end smallexample
20953 20953
@@ -21168,7 +21168,7 @@ and the second argument is @code{full-range}, which will be bound to
21168The whole expression looks like this: 21168The whole expression looks like this:
21169 21169
21170@smallexample 21170@smallexample
21171(mapcar '(lambda (arg) (/ arg 50)) full-range)) 21171(mapcar (lambda (arg) (/ arg 50)) full-range))
21172@end smallexample 21172@end smallexample
21173 21173
21174@xref{Mapping Functions, , Mapping Functions, elisp, The GNU Emacs 21174@xref{Mapping Functions, , Mapping Functions, elisp, The GNU Emacs
@@ -21840,7 +21840,7 @@ each column."
21840@group 21840@group
21841(defun one-fiftieth (full-range) 21841(defun one-fiftieth (full-range)
21842 "Return list, each number of which is 1/50th previous." 21842 "Return list, each number of which is 1/50th previous."
21843 (mapcar '(lambda (arg) (/ arg 50)) full-range)) 21843 (mapcar (lambda (arg) (/ arg 50)) full-range))
21844@end group 21844@end group
21845@end smallexample 21845@end smallexample
21846 21846
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index acf6f8a51ff..26765e7a384 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,29 @@
12012-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * hooks.texi (Standard Hooks): Clarify that -hooks is deprecated.
4
52012-10-23 Paul Eggert <eggert@cs.ucla.edu>
6
7 Fix outdated timestamp documentation in Elisp manual (bug#12706).
8 * files.texi (File Attributes):
9 * text.texi (Undo):
10 Time stamp resolution is now 1 picosecond, not 1 second.
11
122012-10-23 Chong Yidong <cyd@gnu.org>
13
14 * display.texi (Font Lookup): Remove font-list-limit.
15
16 * keymaps.texi (Key Sequences): Avoid referring to Edit Macro mode
17 (Bug#12529).
18
192012-10-22 Glenn Morris <rgm@gnu.org>
20
21 * os.texi (Recording Input): Tiny fix.
22
23 * intro.texi (Lisp History):
24 * lists.texi (Sets And Lists): Refer to cl-lib rather than cl.
25 * tips.texi (Coding Conventions): Recommend cl-lib over cl.
26
12012-10-15 Chong Yidong <cyd@gnu.org> 272012-10-15 Chong Yidong <cyd@gnu.org>
2 28
3 * macros.texi (Defining Macros): defmacro is now a macro. 29 * macros.texi (Defining Macros): defmacro is now a macro.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 3f92c50e2bc..0b5ada43744 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2944,14 +2944,6 @@ The last three elements give additional information about the font.
2944encoding of the font. 2944encoding of the font.
2945@end defun 2945@end defun
2946 2946
2947@defopt font-list-limit
2948This variable specifies maximum number of fonts to consider in font
2949matching. The function @code{x-family-fonts} will not return more
2950than that many fonts, and font selection will consider only that many
2951fonts when searching a matching font for face attributes. The default
2952is 100.
2953@end defopt
2954
2955@node Fontsets 2947@node Fontsets
2956@subsection Fontsets 2948@subsection Fontsets
2957 2949
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 9424a661236..285e6406426 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1220,9 +1220,8 @@ point number.
1220The file's @acronym{GID}, likewise. 1220The file's @acronym{GID}, likewise.
1221 1221
1222@item 1222@item
1223The time of last access, as a list of two integers. 1223The time of last access, as a list of four integers @code{(@var{sec-high}
1224The first integer has the high-order 16 bits of time, 1224@var{sec-low} @var{microsec} @var{picosec})}. (This is similar to the
1225the second has the low 16 bits. (This is similar to the
1226value of @code{current-time}; see @ref{Time of Day}.) Note that on 1225value of @code{current-time}; see @ref{Time of Day}.) Note that on
1227some FAT-based filesystems, only the date of last access is recorded, 1226some FAT-based filesystems, only the date of last access is recorded,
1228so this time will always hold the midnight of the day of last access. 1227so this time will always hold the midnight of the day of last access.
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index c94e46dad18..623106b6d06 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -978,7 +978,7 @@ anonymous function by quoting it as a list:
978@example 978@example
979@group 979@group
980(defun double-property (symbol prop) 980(defun double-property (symbol prop)
981 (change-property symbol prop '(lambda (x) (* 2 x)))) 981 (change-property symbol prop (lambda (x) (* 2 x))))
982@end group 982@end group
983@end example 983@end example
984 984
diff --git a/doc/lispref/hooks.texi b/doc/lispref/hooks.texi
index 7c91b51b290..a7f01243641 100644
--- a/doc/lispref/hooks.texi
+++ b/doc/lispref/hooks.texi
@@ -17,11 +17,11 @@ arguments and their values are completely ignored. The recommended way
17to put a new function on such a hook is to call @code{add-hook}. 17to put a new function on such a hook is to call @code{add-hook}.
18@xref{Hooks}, for more information about using hooks. 18@xref{Hooks}, for more information about using hooks.
19 19
20The variables whose names end in @samp{-hooks} or @samp{-functions} are 20The variables whose names end in @samp{-functions} are usually @dfn{abnormal
21usually @dfn{abnormal hooks}; their values are lists of functions, but 21hooks} (some old code may also use the deprecated @samp{-hooks} suffix); their
22these functions are called in a special way (they are passed arguments, 22values are lists of functions, but these functions are called in a special way
23or their values are used). The variables whose names end in 23(they are passed arguments, or their return values are used). The variables
24@samp{-function} have single functions as their values. 24whose names end in @samp{-function} have single functions as their values.
25 25
26This is not an exhaustive list, it only covers the more general hooks. 26This is not an exhaustive list, it only covers the more general hooks.
27For example, every major mode defines a hook named 27For example, every major mode defines a hook named
diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi
index ce103a84a74..e61e13662db 100644
--- a/doc/lispref/intro.texi
+++ b/doc/lispref/intro.texi
@@ -119,7 +119,7 @@ worry about it; this manual is self-contained.
119 119
120@pindex cl 120@pindex cl
121 A certain amount of Common Lisp emulation is available via the 121 A certain amount of Common Lisp emulation is available via the
122@file{cl} library. @xref{Top,, Overview, cl, Common Lisp Extensions}. 122@file{cl-lib} library. @xref{Top,, Overview, cl, Common Lisp Extensions}.
123 123
124 Emacs Lisp is not at all influenced by Scheme; but the GNU project has 124 Emacs Lisp is not at all influenced by Scheme; but the GNU project has
125an implementation of Scheme, called Guile. We use it in all new GNU 125an implementation of Scheme, called Guile. We use it in all new GNU
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 40dfcaea043..9fa6193a804 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -78,11 +78,11 @@ representations, @ref{Init Rebinding,,, emacs, The GNU Emacs Manual}.
78@defmac kbd keyseq-text 78@defmac kbd keyseq-text
79This macro converts the text @var{keyseq-text} (a string constant) 79This macro converts the text @var{keyseq-text} (a string constant)
80into a key sequence (a string or vector constant). The contents of 80into a key sequence (a string or vector constant). The contents of
81@var{keyseq-text} should describe the key sequence using almost the same 81@var{keyseq-text} should use the same syntax as in the buffer invoked
82syntax used in this manual. More precisely, it uses the same syntax 82by the @kbd{C-x C-k @key{RET}} (@code{kmacro-edit-macro}) command; in
83that Edit Macro mode uses for editing keyboard macros (@pxref{Edit 83particular, you must surround function key names with
84Keyboard Macro,,, emacs, The GNU Emacs Manual}); you must surround 84@samp{<@dots{}>}. @xref{Edit Keyboard Macro,,, emacs, The GNU Emacs
85function key names with @samp{<@dots{}>}. 85Manual}.
86 86
87@example 87@example
88(kbd "C-x") @result{} "\C-x" 88(kbd "C-x") @result{} "\C-x"
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index d685ce0aa74..4a8740a5734 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1266,7 +1266,7 @@ functions for sets include @code{memq} and @code{delq}, and their
1266@quotation 1266@quotation
1267@b{Common Lisp note:} Common Lisp has functions @code{union} (which 1267@b{Common Lisp note:} Common Lisp has functions @code{union} (which
1268avoids duplicate elements) and @code{intersection} for set operations. 1268avoids duplicate elements) and @code{intersection} for set operations.
1269Although standard GNU Emacs Lisp does not have them, the @file{cl} 1269Although standard GNU Emacs Lisp does not have them, the @file{cl-lib}
1270library provides versions. @xref{Top,, Overview, cl, Common Lisp Extensions}. 1270library provides versions. @xref{Top,, Overview, cl, Common Lisp Extensions}.
1271@end quotation 1271@end quotation
1272 1272
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index aa243185359..77a31cfde7a 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -897,8 +897,8 @@ It then restores any autoloads formerly associated with those symbols.
897 897
898Before restoring the previous definitions, @code{unload-feature} runs 898Before restoring the previous definitions, @code{unload-feature} runs
899@code{remove-hook} to remove functions in the library from certain 899@code{remove-hook} to remove functions in the library from certain
900hooks. These hooks include variables whose names end in @samp{hook} 900hooks. These hooks include variables whose names end in @samp{-hook}
901or @samp{-hooks}, plus those listed in 901(or the deprecated suffix @samp{-hooks}), plus those listed in
902@code{unload-feature-special-hooks}, as well as 902@code{unload-feature-special-hooks}, as well as
903@code{auto-mode-alist}. This is to prevent Emacs from ceasing to 903@code{auto-mode-alist}. This is to prevent Emacs from ceasing to
904function because important hooks refer to functions that are no longer 904function because important hooks refer to functions that are no longer
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 8b5e3da493a..4e4d700aade 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -70,9 +70,9 @@ called. You can use @code{add-hook} to add a function to an abnormal
70hook, but you must write the function to follow the hook's calling 70hook, but you must write the function to follow the hook's calling
71convention. 71convention.
72 72
73 By convention, abnormal hook names end in @samp{-functions} or 73 By convention, abnormal hook names end in @samp{-functions}. If the
74@samp{-hooks}. If the variable's name ends in @samp{-function}, then 74variable's name ends in @samp{-function}, then its value is just a single
75its value is just a single function, not a list of functions. 75function, not a list of functions.
76 76
77@menu 77@menu
78* Running Hooks:: How to run a hook. 78* Running Hooks:: How to run a hook.
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 54754f8e5e9..d3c3c6fd241 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1963,7 +1963,7 @@ is the character Emacs currently uses for quitting, usually @kbd{C-g}.
1963This function returns a vector containing the last 300 input events from 1963This function returns a vector containing the last 300 input events from
1964the keyboard or mouse. All input events are included, whether or not 1964the keyboard or mouse. All input events are included, whether or not
1965they were used as parts of key sequences. Thus, you always get the last 1965they were used as parts of key sequences. Thus, you always get the last
1966100 input events, not counting events generated by keyboard macros. 1966300 input events, not counting events generated by keyboard macros.
1967(These are excluded because they are less interesting for debugging; it 1967(These are excluded because they are less interesting for debugging; it
1968should be enough to see the events that invoked the macros.) 1968should be enough to see the events that invoked the macros.)
1969 1969
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index a5910ea921b..50b97cd4204 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -1233,11 +1233,12 @@ reinsert it is @code{(abs @var{position})}. If @var{position} is
1233positive, point was at the beginning of the deleted text, otherwise it 1233positive, point was at the beginning of the deleted text, otherwise it
1234was at the end. 1234was at the end.
1235 1235
1236@item (t @var{high} . @var{low}) 1236@item (t @var{sec-high} @var{sec-low} @var{microsec} @var{picosec})
1237This kind of element indicates that an unmodified buffer became 1237This kind of element indicates that an unmodified buffer became
1238modified. The elements @var{high} and @var{low} are two integers, each 1238modified. The list @code{(@var{sec-high} @var{sec-low} @var{microsec}
1239recording 16 bits of the visited file's modification time as of when it 1239@var{picosec})} represents the visited file's modification time as of
1240was previously visited or saved. @code{primitive-undo} uses those 1240when it was previously visited or saved, using the same format as
1241@code{current-time}; see @ref{Time of Day}. @code{primitive-undo} uses those
1241values to determine whether to mark the buffer as unmodified once again; 1242values to determine whether to mark the buffer as unmodified once again;
1242it does so only if the file's modification time matches those numbers. 1243it does so only if the file's modification time matches those numbers.
1243 1244
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 0c7282c3586..4336baa128f 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -120,15 +120,18 @@ library when needed. This way people who don't use those aspects of
120your file do not need to load the extra library. 120your file do not need to load the extra library.
121 121
122@item 122@item
123Please don't require the @code{cl} package of Common Lisp extensions at 123If you need Common Lisp extensions, use the @code{cl-lib} library
124run time. Use of this package is optional, and it is not part of the 124rather than the old @code{cl} library. The latter does not
125standard Emacs namespace. If your package loads @code{cl} at run time, 125use a clean namespace (i.e., its definitions do not
126that could cause name clashes for users who don't use that package. 126start with a @samp{cl-} prefix). If your package loads @code{cl} at
127 127run time, that could cause name clashes for users who don't use that
128However, there is no problem with using the @code{cl} package at 128package.
129compile time, with @code{(eval-when-compile (require 'cl))}. That's 129
130There is no problem with using the @code{cl} package at @emph{compile}
131time, with @code{(eval-when-compile (require 'cl))}. That's
130sufficient for using the macros in the @code{cl} package, because the 132sufficient for using the macros in the @code{cl} package, because the
131compiler expands them before generating the byte-code. 133compiler expands them before generating the byte-code. It is still
134better to use the more modern @code{cl-lib} in this case, though.
132 135
133@item 136@item
134When defining a major mode, please follow the major mode 137When defining a major mode, please follow the major mode
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 3ee183ff255..cda4f272ca2 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,18 @@
12012-10-23 Glenn Morris <rgm@gnu.org>
2
3 * cl.texi: Include emacsver.texi. Use Emacs version number rather
4 than unchanging cl.el version number.
5 End all menu descriptions with a period.
6 Do not use @dfn{CL} for every instance of "CL".
7 (Overview): Remove no-runtime caveat, and note about foo* names.
8 (Usage): Use cl-lib rather than cl.
9 (Organization, Naming Conventions): Update for cl-lib.el.
10 (Installation): Remove long-irrelevant node.
11 (Program Structure, Predicates, Control Structure):
12 Start updating for cl-lib namespace.
13 * Makefile.in ($(buildinfodir)/cl$(INFO_EXT), cl.dvi, cl.pdf):
14 Depend on emacsver.texi.
15
12012-10-09 Michael Albinus <michael.albinus@gmx.de> 162012-10-09 Michael Albinus <michael.albinus@gmx.de>
2 17
3 * trampver.texi: Update release number. 18 * trampver.texi: Update release number.
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 5ce6d82e683..ea1e87333bd 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -237,12 +237,12 @@ cc-mode.pdf: ${srcdir}/cc-mode.texi
237 $(ENVADD) $(TEXI2PDF) ${srcdir}/cc-mode.texi 237 $(ENVADD) $(TEXI2PDF) ${srcdir}/cc-mode.texi
238 238
239cl : $(buildinfodir)/cl$(INFO_EXT) 239cl : $(buildinfodir)/cl$(INFO_EXT)
240$(buildinfodir)/cl$(INFO_EXT): ${srcdir}/cl.texi 240$(buildinfodir)/cl$(INFO_EXT): ${srcdir}/cl.texi $(emacsdir)/emacsver.texi
241 $(mkinfodir) 241 $(mkinfodir)
242 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/cl.texi 242 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/cl.texi
243cl.dvi: ${srcdir}/cl.texi 243cl.dvi: ${srcdir}/cl.texi $(emacsdir)/emacsver.texi
244 $(ENVADD) $(TEXI2DVI) ${srcdir}/cl.texi 244 $(ENVADD) $(TEXI2DVI) ${srcdir}/cl.texi
245cl.pdf: ${srcdir}/cl.texi 245cl.pdf: ${srcdir}/cl.texi $(emacsdir)/emacsver.texi
246 $(ENVADD) $(TEXI2PDF) ${srcdir}/cl.texi 246 $(ENVADD) $(TEXI2PDF) ${srcdir}/cl.texi
247 247
248dbus : $(buildinfodir)/dbus$(INFO_EXT) 248dbus : $(buildinfodir)/dbus$(INFO_EXT)
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 18abb0647a2..12fd76e2e1c 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -1,6 +1,7 @@
1\input texinfo @c -*-texinfo-*- 1\input texinfo @c -*-texinfo-*-
2@setfilename ../../info/cl 2@setfilename ../../info/cl
3@settitle Common Lisp Extensions 3@settitle Common Lisp Extensions
4@include emacsver.texi
4 5
5@copying 6@copying
6This file documents the GNU Emacs Common Lisp emulation package. 7This file documents the GNU Emacs Common Lisp emulation package.
@@ -34,7 +35,7 @@ developing GNU and promoting software freedom.''
34@sp 4 35@sp 4
35@center For GNU Emacs Lisp 36@center For GNU Emacs Lisp
36@sp 1 37@sp 1
37@center Version 2.02 38@center as distributed with Emacs @value{EMACSVER}
38@sp 5 39@sp 5
39@center Dave Gillespie 40@center Dave Gillespie
40@center daveg@@synaptics.com 41@center daveg@@synaptics.com
@@ -53,23 +54,23 @@ developing GNU and promoting software freedom.''
53@end ifnottex 54@end ifnottex
54 55
55@menu 56@menu
56* Overview:: Installation, usage, etc. 57* Overview:: Basics, usage, etc.
57* Program Structure:: Arglists, @code{eval-when}, @code{defalias} 58* Program Structure:: Arglists, @code{cl-eval-when}, @code{defalias}.
58* Predicates:: @code{typep} and @code{equalp} 59* Predicates:: @code{cl-typep} and @code{cl-equalp}.
59* Control Structure:: @code{setf}, @code{do}, @code{loop}, etc. 60* Control Structure:: @code{setf}, @code{cl-do}, @code{cl-loop}, etc.
60* Macros:: Destructuring, @code{define-compiler-macro} 61* Macros:: Destructuring, @code{cl-define-compiler-macro}.
61* Declarations:: @code{proclaim}, @code{declare}, etc. 62* Declarations:: @code{cl-proclaim}, @code{cl-declare}, etc.
62* Symbols:: Property lists, @code{gensym} 63* Symbols:: Property lists, @code{cl-gensym}.
63* Numbers:: Predicates, functions, random numbers 64* Numbers:: Predicates, functions, random numbers.
64* Sequences:: Mapping, functions, searching, sorting 65* Sequences:: Mapping, functions, searching, sorting.
65* Lists:: @code{caddr}, @code{sublis}, @code{member*}, @code{assoc*}, etc. 66* Lists:: @code{cl-caddr}, @code{cl-sublis}, @code{cl-member}, @code{cl-assoc}, etc.
66* Structures:: @code{defstruct} 67* Structures:: @code{cl-defstruct}.
67* Assertions:: @code{check-type}, @code{assert}, @code{ignore-errors}. 68* Assertions:: @code{cl-check-type}, @code{cl-assert}, @code{ignore-errors}.
68 69
69* Efficiency Concerns:: Hints and techniques 70* Efficiency Concerns:: Hints and techniques.
70* Common Lisp Compatibility:: All known differences with Steele 71* Common Lisp Compatibility:: All known differences with Steele.
71* Old CL Compatibility:: All known differences with old cl.el 72* Old CL Compatibility:: All known differences with old cl.el.
72* Porting Common Lisp:: Hints for porting Common Lisp code 73* Porting Common Lisp:: Hints for porting Common Lisp code.
73 74
74* GNU Free Documentation License:: The license for this documentation. 75* GNU Free Documentation License:: The license for this documentation.
75* Function Index:: 76* Function Index::
@@ -92,21 +93,11 @@ As Emacs Lisp programmers have grown in number, and the applications
92they write have grown more ambitious, it has become clear that Emacs 93they write have grown more ambitious, it has become clear that Emacs
93Lisp could benefit from many of the conveniences of Common Lisp. 94Lisp could benefit from many of the conveniences of Common Lisp.
94 95
95The @dfn{CL} package adds a number of Common Lisp functions and 96The @code{CL} package adds a number of Common Lisp functions and
96control structures to Emacs Lisp. While not a 100% complete 97control structures to Emacs Lisp. While not a 100% complete
97implementation of Common Lisp, @dfn{CL} adds enough functionality 98implementation of Common Lisp, @code{CL} adds enough functionality
98to make Emacs Lisp programming significantly more convenient. 99to make Emacs Lisp programming significantly more convenient.
99 100
100@strong{Please note:} the @dfn{CL} functions are not standard parts of
101the Emacs Lisp name space, so it is legitimate for users to define
102them with other, conflicting meanings. To avoid conflicting with
103those user activities, we have a policy that packages installed in
104Emacs must not load @dfn{CL} at run time. (It is ok for them to load
105@dfn{CL} at compile time only, with @code{eval-when-compile}, and use
106the macros it provides.) If you are writing packages that you plan to
107distribute and invite widespread use for, you might want to observe
108the same rule.
109
110Some Common Lisp features have been omitted from this package 101Some Common Lisp features have been omitted from this package
111for various reasons: 102for various reasons:
112 103
@@ -119,152 +110,131 @@ examples of this group.
119@item 110@item
120Other features cannot be implemented without modification to the 111Other features cannot be implemented without modification to the
121Emacs Lisp interpreter itself, such as multiple return values, 112Emacs Lisp interpreter itself, such as multiple return values,
122lexical scoping, case-insensitive symbols, and complex numbers. 113case-insensitive symbols, and complex numbers.
123The @dfn{CL} package generally makes no attempt to emulate these 114The @code{CL} package generally makes no attempt to emulate these
124features. 115features.
125 116
126@item
127Some features conflict with existing things in Emacs Lisp. For
128example, Emacs's @code{assoc} function is incompatible with the
129Common Lisp @code{assoc}. In such cases, this package usually
130adds the suffix @samp{*} to the function name of the Common
131Lisp version of the function (e.g., @code{assoc*}).
132@end itemize 117@end itemize
133 118
134The package described here was written by Dave Gillespie, 119The package described here was originally written by Dave Gillespie,
135@file{daveg@@synaptics.com}. It is a total rewrite of the original 120@file{daveg@@synaptics.com}, as a total rewrite of an earlier
1361986 @file{cl.el} package by Cesar Quiroz. Most features of the 1211986 @file{cl.el} package by Cesar Quiroz. Most features of the
137Quiroz package have been retained; any incompatibilities are 122Quiroz package were retained; any incompatibilities are
138noted in the descriptions below. Care has been taken in this 123noted in the descriptions below. Care has been taken in this
139version to ensure that each function is defined efficiently, 124version to ensure that each function is defined efficiently,
140concisely, and with minimal impact on the rest of the Emacs 125concisely, and with minimal impact on the rest of the Emacs
141environment. 126environment. Stefan Monnier added the file @file{cl-lib.el} and
127rationalized the namespace for Emacs 24.3.
142 128
143@menu 129@menu
144* Usage:: How to use the CL package 130* Usage:: How to use the CL package.
145* Organization:: The package's five component files 131* Organization:: The package's five component files.
146* Installation:: Compiling and installing CL 132* Naming Conventions:: Notes on CL function names.
147* Naming Conventions:: Notes on CL function names
148@end menu 133@end menu
149 134
150@node Usage 135@node Usage
151@section Usage 136@section Usage
152 137
153@noindent 138@noindent
154Lisp code that uses features from the @dfn{CL} package should 139The @code{CL} package is distributed with Emacs, so there is no need
155include at the beginning: 140to install any additional files in order to start using it. Lisp code
141that uses features from the @code{CL} package should simply include at
142the beginning:
156 143
157@example 144@example
158(require 'cl) 145(require 'cl-lib)
159@end example 146@end example
160 147
161@noindent 148@noindent
162It is safe to arrange to load @dfn{CL} at all times, e.g., 149You may wish to add such a statement to your init file, if you
163in your @file{.emacs} file. But it's a good idea, for portability, 150make frequent use of CL features.
164to @code{(require 'cl)} in your code even if you do this.
165 151
166@node Organization 152@node Organization
167@section Organization 153@section Organization
168 154
169@noindent 155@noindent
170The Common Lisp package is organized into four files: 156The Common Lisp package is organized into four main files:
171 157
172@table @file 158@table @file
173@item cl.el 159@item cl-lib.el
174This is the ``main'' file, which contains basic functions 160This is the main file, which contains basic functions
175and information about the package. This file is relatively 161and information about the package. This file is relatively compact.
176compact---about 700 lines.
177 162
178@item cl-extra.el 163@item cl-extra.el
179This file contains the larger, more complex or unusual functions. 164This file contains the larger, more complex or unusual functions.
180It is kept separate so that packages which only want to use Common 165It is kept separate so that packages which only want to use Common
181Lisp fundamentals like the @code{cadr} function won't need to pay 166Lisp fundamentals like the @code{cl-incf} function won't need to pay
182the overhead of loading the more advanced functions. 167the overhead of loading the more advanced functions.
183 168
184@item cl-seq.el 169@item cl-seq.el
185This file contains most of the advanced functions for operating 170This file contains most of the advanced functions for operating
186on sequences or lists, such as @code{delete-if} and @code{assoc*}. 171on sequences or lists, such as @code{cl-delete-if} and @code{cl-assoc}.
187 172
188@item cl-macs.el 173@item cl-macs.el
189This file contains the features of the packages which are macros 174This file contains the features that are macros instead of functions.
190instead of functions. Macros expand when the caller is compiled, 175Macros expand when the caller is compiled, not when it is run, so the
191not when it is run, so the macros generally only need to be 176macros generally only need to be present when the byte-compiler is
192present when the byte-compiler is running (or when the macros are 177running (or when the macros are used in uncompiled code). Most of the
193used in uncompiled code such as a @file{.emacs} file). Most of 178macros of this package are isolated in @file{cl-macs.el} so that they
194the macros of this package are isolated in @file{cl-macs.el} so 179won't take up memory unless you are compiling.
195that they won't take up memory unless you are compiling.
196@end table 180@end table
197 181
198The file @file{cl.el} includes all necessary @code{autoload} 182The file @file{cl-lib.el} includes all necessary @code{autoload}
199commands for the functions and macros in the other three files. 183commands for the functions and macros in the other three files.
200All you have to do is @code{(require 'cl)}, and @file{cl.el} 184All you have to do is @code{(require 'cl-lib)}, and @file{cl-lib.el}
201will take care of pulling in the other files when they are 185will take care of pulling in the other files when they are
202needed. 186needed.
203 187
204There is another file, @file{cl-compat.el}, which defines some 188There is another file, @file{cl.el}, which was the main entry point
205routines from the older @file{cl.el} package that are not otherwise 189to the CL package prior to Emacs 24.3. Nowadays, it is replaced
190by @file{cl-lib.el}. The two provide the same features, but use
191different function names (in fact, @file{cl.el} just defines aliases
192to the @file{cl-lib.el} definitions). In particular, the old @file{cl.el}
193does not use a clean namespace. For this reason, Emacs has a policy
194that packages distributed with Emacs must not load @code{cl} at run time.
195(It is ok for them to load @code{cl} at @emph{compile} time, with
196@code{eval-when-compile}, and use the macros it provides.) There is
197no such restriction on the use of @code{cl-lib}. New code should use
198@code{cl-lib} rather than @code{cl}. @xref{Naming Conventions}.
199
200There is one more file, @file{cl-compat.el}, which defines some
201routines from the older CL package that are not otherwise
206present in the new package. This includes internal routines 202present in the new package. This includes internal routines
207like @code{setelt} and @code{zip-lists}, deprecated features 203like @code{setelt} and @code{zip-lists}, deprecated features
208like @code{defkeyword}, and an emulation of the old-style 204like @code{defkeyword}, and an emulation of the old-style
209multiple-values feature. This file is obsolete and should not be used 205multiple-values feature. This file is obsolete and should not be used
210in new code. @xref{Old CL Compatibility}. 206in new code. @xref{Old CL Compatibility}.
211 207
212@node Installation
213@section Installation
214
215@noindent
216The @dfn{CL} package is distributed with Emacs, so there is no need
217to install anything.
218
219If you do need to install it, just put the byte-compiled files
220@file{cl.elc}, @file{cl-extra.elc}, @file{cl-seq.elc},
221@file{cl-macs.elc}, and (if necessary) @file{cl-compat.elc} into a
222directory on your @code{load-path}. Also, format the @file{cl.texi}
223file and put the resulting Info files into a directory in your
224@code{Info-directory-list}.
225
226@node Naming Conventions 208@node Naming Conventions
227@section Naming Conventions 209@section Naming Conventions
228 210
229@noindent 211@noindent
230Except where noted, all functions defined by this package have the 212Except where noted, all functions defined by this package have the
231same names and calling conventions as their Common Lisp counterparts. 213same calling conventions as their Common Lisp counterparts, and
232 214names that are those of Common Lisp plus a @samp{cl-} prefix.
233Following is a complete list of functions whose names were changed
234from Common Lisp, usually to avoid conflicts with Emacs. In each
235case, a @samp{*} has been appended to the Common Lisp name to obtain
236the Emacs name:
237
238@example
239defun* defsubst* defmacro* function*
240member* assoc* rassoc* get*
241remove* delete* mapcar* sort*
242floor* ceiling* truncate* round*
243mod* rem* random*
244@end example
245 215
246Internal function and variable names in the package are prefixed 216Internal function and variable names in the package are prefixed
247by @code{cl-}. Here is a complete list of functions @emph{not} 217by @code{cl--}. Here is a complete list of functions prefixed by
248prefixed by @code{cl-} which were not taken from Common Lisp: 218@code{cl-} that were not taken from Common Lisp:
249 219
220@c FIXME lexical-let lexical-let*
250@example 221@example
251floatp-safe lexical-let lexical-let* 222cl-callf cl-callf2 cl-defsubst
252callf callf2 letf letf* 223cl-floatp-safe cl-letf cl-letf*
253defsubst*
254@end example 224@end example
255 225
256The following simple functions and macros are defined in @file{cl.el}; 226The following simple functions and macros are defined in @file{cl-lib.el};
257they do not cause other components like @file{cl-extra} to be loaded. 227they do not cause other components like @file{cl-extra} to be loaded.
258 228
259@example 229@example
260floatp-safe endp 230cl-floatp-safe cl-endp
261evenp oddp plusp minusp 231cl-evenp cl-oddp cl-plusp cl-minusp
262caaar .. cddddr 232cl-caaar .. cl-cddddr
263list* ldiff rest first .. tenth 233cl-list* cl-ldiff cl-rest cl-first .. cl-tenth
264copy-list subst mapcar* [2] 234cl-copy-list cl-subst cl-mapcar [2]
265adjoin [3] acons pairlis pop [4] 235cl-adjoin [3] cl-acons cl-pairlis
266push [4] pushnew [3,4] incf [4] decf [4] 236cl-pushnew [3,4] cl-incf [4] cl-decf [4]
267proclaim declaim 237cl-proclaim cl-declaim
268@end example 238@end example
269 239
270@noindent 240@noindent
@@ -281,13 +251,13 @@ and @code{:key} is not used.
281@chapter Program Structure 251@chapter Program Structure
282 252
283@noindent 253@noindent
284This section describes features of the @dfn{CL} package which have to 254This section describes features of the @code{CL} package that have to
285do with programs as a whole: advanced argument lists for functions, 255do with programs as a whole: advanced argument lists for functions,
286and the @code{eval-when} construct. 256and the @code{cl-eval-when} construct.
287 257
288@menu 258@menu
289* Argument Lists:: @code{&key}, @code{&aux}, @code{defun*}, @code{defmacro*}. 259* Argument Lists:: @code{&key}, @code{&aux}, @code{cl-defun}, @code{cl-defmacro}.
290* Time of Evaluation:: The @code{eval-when} construct. 260* Time of Evaluation:: The @code{cl-eval-when} construct.
291@end menu 261@end menu
292 262
293@iftex 263@iftex
@@ -309,26 +279,26 @@ this package to implement Common Lisp argument lists seamlessly.
309Instead, this package defines alternates for several Lisp forms 279Instead, this package defines alternates for several Lisp forms
310which you must use if you need Common Lisp argument lists. 280which you must use if you need Common Lisp argument lists.
311 281
312@defspec defun* name arglist body... 282@defspec cl-defun name arglist body...
313This form is identical to the regular @code{defun} form, except 283This form is identical to the regular @code{defun} form, except
314that @var{arglist} is allowed to be a full Common Lisp argument 284that @var{arglist} is allowed to be a full Common Lisp argument
315list. Also, the function body is enclosed in an implicit block 285list. Also, the function body is enclosed in an implicit block
316called @var{name}; @pxref{Blocks and Exits}. 286called @var{name}; @pxref{Blocks and Exits}.
317@end defspec 287@end defspec
318 288
319@defspec defsubst* name arglist body... 289@defspec cl-defsubst name arglist body...
320This is just like @code{defun*}, except that the function that 290This is just like @code{cl-defun}, except that the function that
321is defined is automatically proclaimed @code{inline}, i.e., 291is defined is automatically proclaimed @code{inline}, i.e.,
322calls to it may be expanded into in-line code by the byte compiler. 292calls to it may be expanded into in-line code by the byte compiler.
323This is analogous to the @code{defsubst} form; 293This is analogous to the @code{defsubst} form;
324@code{defsubst*} uses a different method (compiler macros) which 294@code{cl-defsubst} uses a different method (compiler macros) which
325works in all versions of Emacs, and also generates somewhat more 295works in all versions of Emacs, and also generates somewhat more
326efficient inline expansions. In particular, @code{defsubst*} 296efficient inline expansions. In particular, @code{cl-defsubst}
327arranges for the processing of keyword arguments, default values, 297arranges for the processing of keyword arguments, default values,
328etc., to be done at compile-time whenever possible. 298etc., to be done at compile-time whenever possible.
329@end defspec 299@end defspec
330 300
331@defspec defmacro* name arglist body... 301@defspec cl-defmacro name arglist body...
332This is identical to the regular @code{defmacro} form, 302This is identical to the regular @code{defmacro} form,
333except that @var{arglist} is allowed to be a full Common Lisp 303except that @var{arglist} is allowed to be a full Common Lisp
334argument list. The @code{&environment} keyword is supported as 304argument list. The @code{&environment} keyword is supported as
@@ -339,19 +309,19 @@ The macro expander body is enclosed in an implicit block called
339@var{name}. 309@var{name}.
340@end defspec 310@end defspec
341 311
342@defspec function* symbol-or-lambda 312@defspec cl-function symbol-or-lambda
343This is identical to the regular @code{function} form, 313This is identical to the regular @code{function} form,
344except that if the argument is a @code{lambda} form then that 314except that if the argument is a @code{lambda} form then that
345form may use a full Common Lisp argument list. 315form may use a full Common Lisp argument list.
346@end defspec 316@end defspec
347 317
348Also, all forms (such as @code{defsetf} and @code{flet}) defined 318Also, all forms (such as @code{cl-flet} and @code{cl-labels}) defined
349in this package that include @var{arglist}s in their syntax allow 319in this package that include @var{arglist}s in their syntax allow
350full Common Lisp argument lists. 320full Common Lisp argument lists.
351 321
352Note that it is @emph{not} necessary to use @code{defun*} in 322Note that it is @emph{not} necessary to use @code{cl-defun} in
353order to have access to most @dfn{CL} features in your function. 323order to have access to most @code{CL} features in your function.
354These features are always present; @code{defun*}'s only 324These features are always present; @code{cl-defun}'s only
355difference from @code{defun} is its more flexible argument 325difference from @code{defun} is its more flexible argument
356lists and its implicit block. 326lists and its implicit block.
357 327
@@ -401,7 +371,7 @@ are optional arguments which are specified by name rather than
401positionally in the argument list. For example, 371positionally in the argument list. For example,
402 372
403@example 373@example
404(defun* foo (a &optional b &key c d (e 17))) 374(cl-defun foo (a &optional b &key c d (e 17)))
405@end example 375@end example
406 376
407@noindent 377@noindent
@@ -427,7 +397,7 @@ You can also explicitly specify the keyword argument; it need not be
427simply the variable name prefixed with a colon. For example, 397simply the variable name prefixed with a colon. For example,
428 398
429@example 399@example
430(defun* bar (&key (a 1) ((baz b) 4))) 400(cl-defun bar (&key (a 1) ((baz b) 4)))
431@end example 401@end example
432 402
433@noindent 403@noindent
@@ -453,16 +423,16 @@ the ``rest'' argument is bound to the keyword list as it appears
453in the call. For example: 423in the call. For example:
454 424
455@smallexample 425@smallexample
456(defun* find-thing (thing &rest rest &key need &allow-other-keys) 426(cl-defun find-thing (thing &rest rest &key need &allow-other-keys)
457 (or (apply 'member* thing thing-list :allow-other-keys t rest) 427 (or (apply 'cl-member thing thing-list :allow-other-keys t rest)
458 (if need (error "Thing not found")))) 428 (if need (error "Thing not found"))))
459@end smallexample 429@end smallexample
460 430
461@noindent 431@noindent
462This function takes a @code{:need} keyword argument, but also 432This function takes a @code{:need} keyword argument, but also
463accepts other keyword arguments which are passed on to the 433accepts other keyword arguments which are passed on to the
464@code{member*} function. @code{allow-other-keys} is used to 434@code{cl-member} function. @code{allow-other-keys} is used to
465keep both @code{find-thing} and @code{member*} from complaining 435keep both @code{find-thing} and @code{cl-member} from complaining
466about each others' keywords in the arguments. 436about each others' keywords in the arguments.
467 437
468The fifth section of the argument list consists of @dfn{auxiliary 438The fifth section of the argument list consists of @dfn{auxiliary
@@ -473,17 +443,17 @@ difference between the following two functions, except for a
473matter of stylistic taste: 443matter of stylistic taste:
474 444
475@example 445@example
476(defun* foo (a b &aux (c (+ a b)) d) 446(cl-defun foo (a b &aux (c (+ a b)) d)
477 @var{body}) 447 @var{body})
478 448
479(defun* foo (a b) 449(cl-defun foo (a b)
480 (let ((c (+ a b)) d) 450 (let ((c (+ a b)) d)
481 @var{body})) 451 @var{body}))
482@end example 452@end example
483 453
484Argument lists support @dfn{destructuring}. In Common Lisp, 454Argument lists support @dfn{destructuring}. In Common Lisp,
485destructuring is only allowed with @code{defmacro}; this package 455destructuring is only allowed with @code{defmacro}; this package
486allows it with @code{defun*} and other argument lists as well. 456allows it with @code{cl-defun} and other argument lists as well.
487In destructuring, any argument variable (@var{var} in the above 457In destructuring, any argument variable (@var{var} in the above
488diagram) can be replaced by a list of variables, or more generally, 458diagram) can be replaced by a list of variables, or more generally,
489a recursive argument list. The corresponding argument value must 459a recursive argument list. The corresponding argument value must
@@ -491,7 +461,7 @@ be a list whose elements match this recursive argument list.
491For example: 461For example:
492 462
493@example 463@example
494(defmacro* dolist ((var listform &optional resultform) 464(cl-defmacro dolist ((var listform &optional resultform)
495 &rest body) 465 &rest body)
496 ...) 466 ...)
497@end example 467@end example
@@ -532,21 +502,21 @@ For example, the compiler effectively evaluates @code{defmacro} forms
532at compile-time so that later parts of the file can refer to the 502at compile-time so that later parts of the file can refer to the
533macros that are defined. 503macros that are defined.
534 504
535@defspec eval-when (situations...) forms... 505@defspec cl-eval-when (situations...) forms...
536This form controls when the body @var{forms} are evaluated. 506This form controls when the body @var{forms} are evaluated.
537The @var{situations} list may contain any set of the symbols 507The @var{situations} list may contain any set of the symbols
538@code{compile}, @code{load}, and @code{eval} (or their long-winded 508@code{compile}, @code{load}, and @code{eval} (or their long-winded
539ANSI equivalents, @code{:compile-toplevel}, @code{:load-toplevel}, 509ANSI equivalents, @code{:compile-toplevel}, @code{:load-toplevel},
540and @code{:execute}). 510and @code{:execute}).
541 511
542The @code{eval-when} form is handled differently depending on 512The @code{cl-eval-when} form is handled differently depending on
543whether or not it is being compiled as a top-level form. 513whether or not it is being compiled as a top-level form.
544Specifically, it gets special treatment if it is being compiled 514Specifically, it gets special treatment if it is being compiled
545by a command such as @code{byte-compile-file} which compiles files 515by a command such as @code{byte-compile-file} which compiles files
546or buffers of code, and it appears either literally at the 516or buffers of code, and it appears either literally at the
547top level of the file or inside a top-level @code{progn}. 517top level of the file or inside a top-level @code{progn}.
548 518
549For compiled top-level @code{eval-when}s, the body @var{forms} are 519For compiled top-level @code{cl-eval-when}s, the body @var{forms} are
550executed at compile-time if @code{compile} is in the @var{situations} 520executed at compile-time if @code{compile} is in the @var{situations}
551list, and the @var{forms} are written out to the file (to be executed 521list, and the @var{forms} are written out to the file (to be executed
552at load-time) if @code{load} is in the @var{situations} list. 522at load-time) if @code{load} is in the @var{situations} list.
@@ -554,11 +524,11 @@ at load-time) if @code{load} is in the @var{situations} list.
554For non-compiled-top-level forms, only the @code{eval} situation is 524For non-compiled-top-level forms, only the @code{eval} situation is
555relevant. (This includes forms executed by the interpreter, forms 525relevant. (This includes forms executed by the interpreter, forms
556compiled with @code{byte-compile} rather than @code{byte-compile-file}, 526compiled with @code{byte-compile} rather than @code{byte-compile-file},
557and non-top-level forms.) The @code{eval-when} acts like a 527and non-top-level forms.) The @code{cl-eval-when} acts like a
558@code{progn} if @code{eval} is specified, and like @code{nil} 528@code{progn} if @code{eval} is specified, and like @code{nil}
559(ignoring the body @var{forms}) if not. 529(ignoring the body @var{forms}) if not.
560 530
561The rules become more subtle when @code{eval-when}s are nested; 531The rules become more subtle when @code{cl-eval-when}s are nested;
562consult Steele (second edition) for the gruesome details (and 532consult Steele (second edition) for the gruesome details (and
563some gruesome examples). 533some gruesome examples).
564 534
@@ -566,13 +536,13 @@ Some simple examples:
566 536
567@example 537@example
568;; Top-level forms in foo.el: 538;; Top-level forms in foo.el:
569(eval-when (compile) (setq foo1 'bar)) 539(cl-eval-when (compile) (setq foo1 'bar))
570(eval-when (load) (setq foo2 'bar)) 540(cl-eval-when (load) (setq foo2 'bar))
571(eval-when (compile load) (setq foo3 'bar)) 541(cl-eval-when (compile load) (setq foo3 'bar))
572(eval-when (eval) (setq foo4 'bar)) 542(cl-eval-when (eval) (setq foo4 'bar))
573(eval-when (eval compile) (setq foo5 'bar)) 543(cl-eval-when (eval compile) (setq foo5 'bar))
574(eval-when (eval load) (setq foo6 'bar)) 544(cl-eval-when (eval load) (setq foo6 'bar))
575(eval-when (eval compile load) (setq foo7 'bar)) 545(cl-eval-when (eval compile load) (setq foo7 'bar))
576@end example 546@end example
577 547
578When @file{foo.el} is compiled, these variables will be set during 548When @file{foo.el} is compiled, these variables will be set during
@@ -595,18 +565,18 @@ be set:
595foo4 foo5 foo6 foo7 ; `eval' 565foo4 foo5 foo6 foo7 ; `eval'
596@end example 566@end example
597 567
598If these seven @code{eval-when}s had been, say, inside a @code{defun}, 568If these seven @code{cl-eval-when}s had been, say, inside a @code{defun},
599then the first three would have been equivalent to @code{nil} and the 569then the first three would have been equivalent to @code{nil} and the
600last four would have been equivalent to the corresponding @code{setq}s. 570last four would have been equivalent to the corresponding @code{setq}s.
601 571
602Note that @code{(eval-when (load eval) @dots{})} is equivalent 572Note that @code{(cl-eval-when (load eval) @dots{})} is equivalent
603to @code{(progn @dots{})} in all contexts. The compiler treats 573to @code{(progn @dots{})} in all contexts. The compiler treats
604certain top-level forms, like @code{defmacro} (sort-of) and 574certain top-level forms, like @code{defmacro} (sort-of) and
605@code{require}, as if they were wrapped in @code{(eval-when 575@code{require}, as if they were wrapped in @code{(eval-when
606(compile load eval) @dots{})}. 576(compile load eval) @dots{})}.
607@end defspec 577@end defspec
608 578
609Emacs includes two special forms related to @code{eval-when}. 579Emacs includes two special forms related to @code{cl-eval-when}.
610One of these, @code{eval-when-compile}, is not quite equivalent to 580One of these, @code{eval-when-compile}, is not quite equivalent to
611any @code{eval-when} construct and is described below. 581any @code{eval-when} construct and is described below.
612 582
@@ -625,7 +595,7 @@ or other reasons.
625This form is similar to the @samp{#.} syntax of true Common Lisp. 595This form is similar to the @samp{#.} syntax of true Common Lisp.
626@end defspec 596@end defspec
627 597
628@defspec load-time-value form 598@defspec cl-load-time-value form
629The @var{form} is evaluated at load-time; at execution time, 599The @var{form} is evaluated at load-time; at execution time,
630this form acts like a quoted constant of the resulting value. 600this form acts like a quoted constant of the resulting value.
631 601
@@ -633,12 +603,12 @@ Early Common Lisp had a @samp{#,} syntax that was similar to
633this, but ANSI Common Lisp replaced it with @code{load-time-value} 603this, but ANSI Common Lisp replaced it with @code{load-time-value}
634and gave it more well-defined semantics. 604and gave it more well-defined semantics.
635 605
636In a compiled file, @code{load-time-value} arranges for @var{form} 606In a compiled file, @code{cl-load-time-value} arranges for @var{form}
637to be evaluated when the @file{.elc} file is loaded and then used 607to be evaluated when the @file{.elc} file is loaded and then used
638as if it were a quoted constant. In code compiled by 608as if it were a quoted constant. In code compiled by
639@code{byte-compile} rather than @code{byte-compile-file}, the 609@code{byte-compile} rather than @code{byte-compile-file}, the
640effect is identical to @code{eval-when-compile}. In uncompiled 610effect is identical to @code{eval-when-compile}. In uncompiled
641code, both @code{eval-when-compile} and @code{load-time-value} 611code, both @code{eval-when-compile} and @code{cl-load-time-value}
642act exactly like @code{progn}. 612act exactly like @code{progn}.
643 613
644@example 614@example
@@ -649,7 +619,7 @@ act exactly like @code{progn}.
649 (eval-when-compile (current-time-string)) 619 (eval-when-compile (current-time-string))
650 ;; or '#.(current-time-string) in real Common Lisp 620 ;; or '#.(current-time-string) in real Common Lisp
651 ", and loaded on: " 621 ", and loaded on: "
652 (load-time-value (current-time-string)))) 622 (cl-load-time-value (current-time-string))))
653@end example 623@end example
654 624
655@noindent 625@noindent
@@ -676,21 +646,21 @@ This section describes functions for testing whether various
676facts are true or false. 646facts are true or false.
677 647
678@menu 648@menu
679* Type Predicates:: @code{typep}, @code{deftype}, and @code{coerce} 649* Type Predicates:: @code{cl-typep}, @code{cl-deftype}, and @code{cl-coerce}.
680* Equality Predicates:: @code{equalp} 650* Equality Predicates:: @code{cl-equalp}.
681@end menu 651@end menu
682 652
683@node Type Predicates 653@node Type Predicates
684@section Type Predicates 654@section Type Predicates
685 655
686@noindent 656@noindent
687The @dfn{CL} package defines a version of the Common Lisp @code{typep} 657The @code{CL} package defines a version of the Common Lisp @code{typep}
688predicate. 658predicate.
689 659
690@defun typep object type 660@defun cl-typep object type
691Check if @var{object} is of type @var{type}, where @var{type} is a 661Check if @var{object} is of type @var{type}, where @var{type} is a
692(quoted) type name of the sort used by Common Lisp. For example, 662(quoted) type name of the sort used by Common Lisp. For example,
693@code{(typep foo 'integer)} is equivalent to @code{(integerp foo)}. 663@code{(cl-typep foo 'integer)} is equivalent to @code{(integerp foo)}.
694@end defun 664@end defun
695 665
696The @var{type} argument to the above function is either a symbol 666The @var{type} argument to the above function is either a symbol
@@ -705,18 +675,18 @@ than @samp{-p} are used when appropriate.)
705 675
706@item 676@item
707The type symbol @code{t} stands for the union of all types. 677The type symbol @code{t} stands for the union of all types.
708@code{(typep @var{object} t)} is always true. Likewise, the 678@code{(cl-typep @var{object} t)} is always true. Likewise, the
709type symbol @code{nil} stands for nothing at all, and 679type symbol @code{nil} stands for nothing at all, and
710@code{(typep @var{object} nil)} is always false. 680@code{(cl-typep @var{object} nil)} is always false.
711 681
712@item 682@item
713The type symbol @code{null} represents the symbol @code{nil}. 683The type symbol @code{null} represents the symbol @code{nil}.
714Thus @code{(typep @var{object} 'null)} is equivalent to 684Thus @code{(cl-typep @var{object} 'null)} is equivalent to
715@code{(null @var{object})}. 685@code{(null @var{object})}.
716 686
717@item 687@item
718The type symbol @code{atom} represents all objects that are not cons 688The type symbol @code{atom} represents all objects that are not cons
719cells. Thus @code{(typep @var{object} 'atom)} is equivalent to 689cells. Thus @code{(cl-typep @var{object} 'atom)} is equivalent to
720@code{(atom @var{object})}. 690@code{(atom @var{object})}.
721 691
722@item 692@item
@@ -728,7 +698,7 @@ The type symbols @code{character} and @code{string-char} match
728integers in the range from 0 to 255. 698integers in the range from 0 to 255.
729 699
730@item 700@item
731The type symbol @code{float} uses the @code{floatp-safe} predicate 701The type symbol @code{float} uses the @code{cl-floatp-safe} predicate
732defined by this package rather than @code{floatp}, so it will work 702defined by this package rather than @code{floatp}, so it will work
733correctly even in Emacs versions without floating-point support. 703correctly even in Emacs versions without floating-point support.
734 704
@@ -750,7 +720,7 @@ combinations of types. For example, @code{(or integer (float 0 *))}
750represents all objects that are integers or non-negative floats. 720represents all objects that are integers or non-negative floats.
751 721
752@item 722@item
753Lists beginning with @code{member} or @code{member*} represent 723Lists beginning with @code{member} or @code{cl-member} represent
754objects @code{eql} to any of the following values. For example, 724objects @code{eql} to any of the following values. For example,
755@code{(member 1 2 3 4)} is equivalent to @code{(integer 1 4)}, 725@code{(member 1 2 3 4)} is equivalent to @code{(integer 1 4)},
756and @code{(member nil)} is equivalent to @code{null}. 726and @code{(member nil)} is equivalent to @code{null}.
@@ -762,9 +732,9 @@ with that object as an argument.
762@end itemize 732@end itemize
763 733
764The following function and macro (not technically predicates) are 734The following function and macro (not technically predicates) are
765related to @code{typep}. 735related to @code{cl-typep}.
766 736
767@defun coerce object type 737@defun cl-coerce object type
768This function attempts to convert @var{object} to the specified 738This function attempts to convert @var{object} to the specified
769@var{type}. If @var{object} is already of that type as determined by 739@var{type}. If @var{object} is already of that type as determined by
770@code{typep}, it is simply returned. Otherwise, certain types of 740@code{typep}, it is simply returned. Otherwise, certain types of
@@ -774,28 +744,28 @@ converted to that type if possible. If @var{type} is
774@code{character}, then strings of length one and symbols with 744@code{character}, then strings of length one and symbols with
775one-character names can be coerced. If @var{type} is @code{float}, 745one-character names can be coerced. If @var{type} is @code{float},
776then integers can be coerced in versions of Emacs that support 746then integers can be coerced in versions of Emacs that support
777floats. In all other circumstances, @code{coerce} signals an 747floats. In all other circumstances, @code{cl-coerce} signals an
778error. 748error.
779@end defun 749@end defun
780 750
781@defspec deftype name arglist forms... 751@defspec cl-deftype name arglist forms...
782This macro defines a new type called @var{name}. It is similar 752This macro defines a new type called @var{name}. It is similar
783to @code{defmacro} in many ways; when @var{name} is encountered 753to @code{defmacro} in many ways; when @var{name} is encountered
784as a type name, the body @var{forms} are evaluated and should 754as a type name, the body @var{forms} are evaluated and should
785return a type specifier that is equivalent to the type. The 755return a type specifier that is equivalent to the type. The
786@var{arglist} is a Common Lisp argument list of the sort accepted 756@var{arglist} is a Common Lisp argument list of the sort accepted
787by @code{defmacro*}. The type specifier @samp{(@var{name} @var{args}...)} 757by @code{cl-defmacro}. The type specifier @samp{(@var{name} @var{args}...)}
788is expanded by calling the expander with those arguments; the type 758is expanded by calling the expander with those arguments; the type
789symbol @samp{@var{name}} is expanded by calling the expander with 759symbol @samp{@var{name}} is expanded by calling the expander with
790no arguments. The @var{arglist} is processed the same as for 760no arguments. The @var{arglist} is processed the same as for
791@code{defmacro*} except that optional arguments without explicit 761@code{cl-defmacro} except that optional arguments without explicit
792defaults use @code{*} instead of @code{nil} as the ``default'' 762defaults use @code{*} instead of @code{nil} as the ``default''
793default. Some examples: 763default. Some examples:
794 764
795@example 765@example
796(deftype null () '(satisfies null)) ; predefined 766(cl-deftype null () '(satisfies null)) ; predefined
797(deftype list () '(or null cons)) ; predefined 767(cl-deftype list () '(or null cons)) ; predefined
798(deftype unsigned-byte (&optional bits) 768(cl-deftype unsigned-byte (&optional bits)
799 (list 'integer 0 (if (eq bits '*) bits (1- (lsh 1 bits))))) 769 (list 'integer 0 (if (eq bits '*) bits (1- (lsh 1 bits)))))
800(unsigned-byte 8) @equiv{} (integer 0 255) 770(unsigned-byte 8) @equiv{} (integer 0 255)
801(unsigned-byte) @equiv{} (integer 0 *) 771(unsigned-byte) @equiv{} (integer 0 *)
@@ -808,21 +778,21 @@ type specifier could be implemented if desired; this package does
808not implement @code{unsigned-byte} by default. 778not implement @code{unsigned-byte} by default.
809@end defspec 779@end defspec
810 780
811The @code{typecase} and @code{check-type} macros also use type 781The @code{cl-typecase} and @code{cl-check-type} macros also use type
812names. @xref{Conditionals}. @xref{Assertions}. The @code{map}, 782names. @xref{Conditionals}. @xref{Assertions}. The @code{cl-map},
813@code{concatenate}, and @code{merge} functions take type-name 783@code{cl-concatenate}, and @code{cl-merge} functions take type-name
814arguments to specify the type of sequence to return. @xref{Sequences}. 784arguments to specify the type of sequence to return. @xref{Sequences}.
815 785
816@node Equality Predicates 786@node Equality Predicates
817@section Equality Predicates 787@section Equality Predicates
818 788
819@noindent 789@noindent
820This package defines the Common Lisp predicate @code{equalp}. 790This package defines the Common Lisp predicate @code{cl-equalp}.
821 791
822@defun equalp a b 792@defun cl-equalp a b
823This function is a more flexible version of @code{equal}. In 793This function is a more flexible version of @code{equal}. In
824particular, it compares strings case-insensitively, and it compares 794particular, it compares strings case-insensitively, and it compares
825numbers without regard to type (so that @code{(equalp 3 3.0)} is 795numbers without regard to type (so that @code{(cl-equalp 3 3.0)} is
826true). Vectors and conses are compared recursively. All other 796true). Vectors and conses are compared recursively. All other
827objects are compared as if by @code{equal}. 797objects are compared as if by @code{equal}.
828 798
@@ -831,15 +801,15 @@ respects. First, Common Lisp's @code{equalp} also compares
831@emph{characters} case-insensitively, which would be impractical 801@emph{characters} case-insensitively, which would be impractical
832in this package since Emacs does not distinguish between integers 802in this package since Emacs does not distinguish between integers
833and characters. In keeping with the idea that strings are less 803and characters. In keeping with the idea that strings are less
834vector-like in Emacs Lisp, this package's @code{equalp} also will 804vector-like in Emacs Lisp, this package's @code{cl-equalp} also will
835not compare strings against vectors of integers. 805not compare strings against vectors of integers.
836@end defun 806@end defun
837 807
838Also note that the Common Lisp functions @code{member} and @code{assoc} 808Also note that the Common Lisp functions @code{member} and @code{assoc}
839use @code{eql} to compare elements, whereas Emacs Lisp follows the 809use @code{eql} to compare elements, whereas Emacs Lisp follows the
840MacLisp tradition and uses @code{equal} for these two functions. 810MacLisp tradition and uses @code{equal} for these two functions.
841In Emacs, use @code{member*} and @code{assoc*} to get functions 811In Emacs, use @code{memq} (or @code{cl-member}) and @code{assq} (or
842which use @code{eql} for comparisons. 812@code{cl-assoc}) to get functions which use @code{eql} for comparisons.
843 813
844@node Control Structure 814@node Control Structure
845@chapter Control Structure 815@chapter Control Structure
@@ -847,28 +817,32 @@ which use @code{eql} for comparisons.
847@noindent 817@noindent
848The features described in the following sections implement 818The features described in the following sections implement
849various advanced control structures, including the powerful 819various advanced control structures, including the powerful
820@c FIXME setf is now in gv.el, not cl.
850@code{setf} facility and a number of looping and conditional 821@code{setf} facility and a number of looping and conditional
851constructs. 822constructs.
852 823
824@c FIXME setf, push are standard now.
825@c lexical-let is obsolete; flet is not cl-flet.
826@c values is not cl-values.
853@menu 827@menu
854* Assignment:: The @code{psetq} form 828* Assignment:: The @code{cl-psetq} form.
855* Generalized Variables:: @code{setf}, @code{incf}, @code{push}, etc. 829* Generalized Variables:: @code{setf}, @code{cl-incf}, @code{push}, etc.
856* Variable Bindings:: @code{progv}, @code{lexical-let}, @code{flet}, @code{macrolet} 830* Variable Bindings:: @code{cl-progv}, @code{lexical-let}, @code{flet}, @code{cl-macrolet}.
857* Conditionals:: @code{case}, @code{typecase} 831* Conditionals:: @code{cl-case}, @code{cl-typecase}.
858* Blocks and Exits:: @code{block}, @code{return}, @code{return-from} 832* Blocks and Exits:: @code{cl-block}, @code{cl-return}, @code{cl-return-from}.
859* Iteration:: @code{do}, @code{dotimes}, @code{dolist}, @code{do-symbols} 833* Iteration:: @code{cl-do}, @code{cl-dotimes}, @code{cl-dolist}, @code{cl-do-symbols}.
860* Loop Facility:: The Common Lisp @code{loop} macro 834* Loop Facility:: The Common Lisp @code{cl-loop} macro.
861* Multiple Values:: @code{values}, @code{multiple-value-bind}, etc. 835* Multiple Values:: @code{values}, @code{cl-multiple-value-bind}, etc.
862@end menu 836@end menu
863 837
864@node Assignment 838@node Assignment
865@section Assignment 839@section Assignment
866 840
867@noindent 841@noindent
868The @code{psetq} form is just like @code{setq}, except that multiple 842The @code{cl-psetq} form is just like @code{setq}, except that multiple
869assignments are done in parallel rather than sequentially. 843assignments are done in parallel rather than sequentially.
870 844
871@defspec psetq [symbol form]@dots{} 845@defspec cl-psetq [symbol form]@dots{}
872This special form (actually a macro) is used to assign to several 846This special form (actually a macro) is used to assign to several
873variables simultaneously. Given only one @var{symbol} and @var{form}, 847variables simultaneously. Given only one @var{symbol} and @var{form},
874it has the same effect as @code{setq}. Given several @var{symbol} 848it has the same effect as @code{setq}. Given several @var{symbol}
@@ -883,21 +857,22 @@ x
883y ; @r{@code{y} was computed after @code{x} was set.} 857y ; @r{@code{y} was computed after @code{x} was set.}
884 @result{} 15 858 @result{} 15
885(setq x 2 y 3) 859(setq x 2 y 3)
886(psetq x (+ x y) y (* x y)) 860(cl-psetq x (+ x y) y (* x y))
887x 861x
888 @result{} 5 862 @result{} 5
889y ; @r{@code{y} was computed before @code{x} was set.} 863y ; @r{@code{y} was computed before @code{x} was set.}
890 @result{} 6 864 @result{} 6
891@end example 865@end example
892 866
893The simplest use of @code{psetq} is @code{(psetq x y y x)}, which 867The simplest use of @code{cl-psetq} is @code{(cl-psetq x y y x)}, which
894exchanges the values of two variables. (The @code{rotatef} form 868exchanges the values of two variables. (The @code{cl-rotatef} form
895provides an even more convenient way to swap two variables; 869provides an even more convenient way to swap two variables;
896@pxref{Modify Macros}.) 870@pxref{Modify Macros}.)
897 871
898@code{psetq} always returns @code{nil}. 872@code{cl-psetq} always returns @code{nil}.
899@end defspec 873@end defspec
900 874
875@c FIXME now in gv.el.
901@node Generalized Variables 876@node Generalized Variables
902@section Generalized Variables 877@section Generalized Variables
903 878
@@ -922,9 +897,9 @@ Just as certain forms like @code{a[i]} can be lvalues in C, there
922is a set of forms that can be generalized variables in Lisp. 897is a set of forms that can be generalized variables in Lisp.
923 898
924@menu 899@menu
925* Basic Setf:: @code{setf} and place forms 900* Basic Setf:: @code{setf} and place forms.
926* Modify Macros:: @code{incf}, @code{push}, @code{rotatef}, @code{letf}, @code{callf}, etc. 901* Modify Macros:: @code{cl-incf}, @code{push}, @code{cl-rotatef}, @code{letf}, @code{cl-callf}, etc.
927* Customizing Setf:: @code{define-modify-macro}, @code{defsetf}, @code{define-setf-method} 902* Customizing Setf:: @code{define-modify-macro}, @code{defsetf}, @code{define-setf-method}.
928@end menu 903@end menu
929 904
930@node Basic Setf 905@node Basic Setf
@@ -1107,7 +1082,7 @@ that operate on generalized variables. Many are interesting and
1107useful even when the @var{place} is just a variable name. 1082useful even when the @var{place} is just a variable name.
1108 1083
1109@defspec psetf [place form]@dots{} 1084@defspec psetf [place form]@dots{}
1110This macro is to @code{setf} what @code{psetq} is to @code{setq}: 1085This macro is to @code{setf} what @code{cl-psetq} is to @code{setq}:
1111When several @var{place}s and @var{form}s are involved, the 1086When several @var{place}s and @var{form}s are involved, the
1112assignments take place in parallel rather than sequentially. 1087assignments take place in parallel rather than sequentially.
1113Specifically, all subforms are evaluated from left to right, then 1088Specifically, all subforms are evaluated from left to right, then
@@ -1533,10 +1508,10 @@ analogous to Lisp's built-in @code{let} form.
1533are also related to variable bindings. 1508are also related to variable bindings.
1534 1509
1535@menu 1510@menu
1536* Dynamic Bindings:: The @code{progv} form 1511* Dynamic Bindings:: The @code{progv} form.
1537* Lexical Bindings:: @code{lexical-let} and lexical closures 1512* Lexical Bindings:: @code{lexical-let} and lexical closures.
1538* Function Bindings:: @code{flet} and @code{labels} 1513* Function Bindings:: @code{flet} and @code{labels}.
1539* Macro Bindings:: @code{macrolet} and @code{symbol-macrolet} 1514* Macro Bindings:: @code{macrolet} and @code{symbol-macrolet}.
1540@end menu 1515@end menu
1541 1516
1542@node Dynamic Bindings 1517@node Dynamic Bindings
@@ -1563,7 +1538,7 @@ are ignored.
1563@subsection Lexical Bindings 1538@subsection Lexical Bindings
1564 1539
1565@noindent 1540@noindent
1566The @dfn{CL} package defines the following macro which 1541The @code{CL} package defines the following macro which
1567more closely follows the Common Lisp @code{let} form: 1542more closely follows the Common Lisp @code{let} form:
1568 1543
1569@defspec lexical-let (bindings@dots{}) forms@dots{} 1544@defspec lexical-let (bindings@dots{}) forms@dots{}
@@ -1984,7 +1959,7 @@ looping constructs to complement Emacs Lisp's basic @code{while}
1984loop. 1959loop.
1985 1960
1986@defspec loop forms@dots{} 1961@defspec loop forms@dots{}
1987The @dfn{CL} package supports both the simple, old-style meaning of 1962The @code{CL} package supports both the simple, old-style meaning of
1988@code{loop} and the extremely powerful and flexible feature known as 1963@code{loop} and the extremely powerful and flexible feature known as
1989the @dfn{Loop Facility} or @dfn{Loop Macro}. This more advanced 1964the @dfn{Loop Facility} or @dfn{Loop Macro}. This more advanced
1990facility is discussed in the following section; @pxref{Loop Facility}. 1965facility is discussed in the following section; @pxref{Loop Facility}.
@@ -2026,7 +2001,7 @@ associated @var{init} value as if by a @code{let} form. Then, in
2026each iteration of the loop, the @var{end-test} is evaluated; if 2001each iteration of the loop, the @var{end-test} is evaluated; if
2027true, the loop is finished. Otherwise, the body @var{forms} are 2002true, the loop is finished. Otherwise, the body @var{forms} are
2028evaluated, then each @var{var} is set to the associated @var{step} 2003evaluated, then each @var{var} is set to the associated @var{step}
2029expression (as if by a @code{psetq} form) and the next iteration 2004expression (as if by a @code{cl-psetq} form) and the next iteration
2030begins. Once the @var{end-test} becomes true, the @var{result} 2005begins. Once the @var{end-test} becomes true, the @var{result}
2031forms are evaluated (with the @var{var}s still bound to their 2006forms are evaluated (with the @var{var}s still bound to their
2032values) to produce the result returned by @code{do}. 2007values) to produce the result returned by @code{do}.
@@ -2065,7 +2040,7 @@ the rest of the loop.
2065This is to @code{do} what @code{let*} is to @code{let}. In 2040This is to @code{do} what @code{let*} is to @code{let}. In
2066particular, the initial values are bound as if by @code{let*} 2041particular, the initial values are bound as if by @code{let*}
2067rather than @code{let}, and the steps are assigned as if by 2042rather than @code{let}, and the steps are assigned as if by
2068@code{setq} rather than @code{psetq}. 2043@code{setq} rather than @code{cl-psetq}.
2069 2044
2070Here is another way to write the above loop: 2045Here is another way to write the above loop:
2071 2046
@@ -2133,12 +2108,12 @@ construct called the ``Loop Facility'' or ``@code{loop} macro,''
2133with an easy-to-use but very powerful and expressive syntax. 2108with an easy-to-use but very powerful and expressive syntax.
2134 2109
2135@menu 2110@menu
2136* Loop Basics:: @code{loop} macro, basic clause structure 2111* Loop Basics:: @code{loop} macro, basic clause structure.
2137* Loop Examples:: Working examples of @code{loop} macro 2112* Loop Examples:: Working examples of @code{loop} macro.
2138* For Clauses:: Clauses introduced by @code{for} or @code{as} 2113* For Clauses:: Clauses introduced by @code{for} or @code{as}.
2139* Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc. 2114* Iteration Clauses:: @code{repeat}, @code{while}, @code{thereis}, etc.
2140* Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc. 2115* Accumulation Clauses:: @code{collect}, @code{sum}, @code{maximize}, etc.
2141* Other Clauses:: @code{with}, @code{if}, @code{initially}, @code{finally} 2116* Other Clauses:: @code{with}, @code{if}, @code{initially}, @code{finally}.
2142@end menu 2117@end menu
2143 2118
2144@node Loop Basics 2119@node Loop Basics
@@ -2546,7 +2521,7 @@ If you include several @code{for} clauses in a row, they are
2546treated sequentially (as if by @code{let*} and @code{setq}). 2521treated sequentially (as if by @code{let*} and @code{setq}).
2547You can instead use the word @code{and} to link the clauses, 2522You can instead use the word @code{and} to link the clauses,
2548in which case they are processed in parallel (as if by @code{let} 2523in which case they are processed in parallel (as if by @code{let}
2549and @code{psetq}). 2524and @code{cl-psetq}).
2550 2525
2551@example 2526@example
2552(loop for x below 5 for y = nil then x collect (list x y)) 2527(loop for x below 5 for y = nil then x collect (list x y))
@@ -3177,8 +3152,8 @@ This package defines several symbol-related features that were
3177missing from Emacs Lisp. 3152missing from Emacs Lisp.
3178 3153
3179@menu 3154@menu
3180* Property Lists:: @code{get*}, @code{remprop}, @code{getf}, @code{remf} 3155* Property Lists:: @code{get*}, @code{remprop}, @code{getf}, @code{remf}.
3181* Creating Symbols:: @code{gensym}, @code{gentemp} 3156* Creating Symbols:: @code{gensym}, @code{gentemp}.
3182@end menu 3157@end menu
3183 3158
3184@node Property Lists 3159@node Property Lists
@@ -3321,8 +3296,8 @@ which were left out of Emacs Lisp.
3321@menu 3296@menu
3322* Predicates on Numbers:: @code{plusp}, @code{oddp}, @code{floatp-safe}, etc. 3297* Predicates on Numbers:: @code{plusp}, @code{oddp}, @code{floatp-safe}, etc.
3323* Numerical Functions:: @code{abs}, @code{floor*}, etc. 3298* Numerical Functions:: @code{abs}, @code{floor*}, etc.
3324* Random Numbers:: @code{random*}, @code{make-random-state} 3299* Random Numbers:: @code{random*}, @code{make-random-state}.
3325* Implementation Parameters:: @code{most-positive-float} 3300* Implementation Parameters:: @code{most-positive-float}.
3326@end menu 3301@end menu
3327 3302
3328@iftex 3303@iftex
@@ -3614,11 +3589,11 @@ Emacs Lisp includes a few of these, notably @code{elt} and
3614@code{length}; this package defines most of the rest. 3589@code{length}; this package defines most of the rest.
3615 3590
3616@menu 3591@menu
3617* Sequence Basics:: Arguments shared by all sequence functions 3592* Sequence Basics:: Arguments shared by all sequence functions.
3618* Mapping over Sequences:: @code{mapcar*}, @code{mapcan}, @code{map}, @code{every}, etc. 3593* Mapping over Sequences:: @code{mapcar*}, @code{mapcan}, @code{map}, @code{every}, etc.
3619* Sequence Functions:: @code{subseq}, @code{remove*}, @code{substitute}, etc. 3594* Sequence Functions:: @code{subseq}, @code{remove*}, @code{substitute}, etc.
3620* Searching Sequences:: @code{find}, @code{position}, @code{count}, @code{search}, etc. 3595* Searching Sequences:: @code{find}, @code{position}, @code{count}, @code{search}, etc.
3621* Sorting Sequences:: @code{sort*}, @code{stable-sort}, @code{merge} 3596* Sorting Sequences:: @code{sort*}, @code{stable-sort}, @code{merge}.
3622@end menu 3597@end menu
3623 3598
3624@node Sequence Basics 3599@node Sequence Basics
@@ -4101,7 +4076,7 @@ The functions described here operate on lists.
4101* List Functions:: @code{caddr}, @code{first}, @code{list*}, etc. 4076* List Functions:: @code{caddr}, @code{first}, @code{list*}, etc.
4102* Substitution of Expressions:: @code{subst}, @code{sublis}, etc. 4077* Substitution of Expressions:: @code{subst}, @code{sublis}, etc.
4103* Lists as Sets:: @code{member*}, @code{adjoin}, @code{union}, etc. 4078* Lists as Sets:: @code{member*}, @code{adjoin}, @code{union}, etc.
4104* Association Lists:: @code{assoc*}, @code{rassoc*}, @code{acons}, @code{pairlis} 4079* Association Lists:: @code{assoc*}, @code{rassoc*}, @code{acons}, @code{pairlis}.
4105@end menu 4080@end menu
4106 4081
4107@node List Functions 4082@node List Functions
@@ -5045,7 +5020,7 @@ Lisp.
5045@appendixsec The @code{cl-compat} package 5020@appendixsec The @code{cl-compat} package
5046 5021
5047@noindent 5022@noindent
5048The @dfn{CL} package includes emulations of some features of the 5023The @code{CL} package includes emulations of some features of the
5049old @file{cl.el}, in the form of a compatibility package 5024old @file{cl.el}, in the form of a compatibility package
5050@code{cl-compat}. This file is obsolete and may be removed in future, 5025@code{cl-compat}. This file is obsolete and may be removed in future,
5051so it should not be used in new code. 5026so it should not be used in new code.
@@ -5066,7 +5041,7 @@ best fix is to change to use @code{setf} properly.
5066 5041
5067The @code{cl-compat} file defines the keyword functions 5042The @code{cl-compat} file defines the keyword functions
5068@code{keywordp}, @code{keyword-of}, and @code{defkeyword}, 5043@code{keywordp}, @code{keyword-of}, and @code{defkeyword},
5069which are not defined by the new @dfn{CL} package because the 5044which are not defined by the new @code{CL} package because the
5070use of keywords as data is discouraged. 5045use of keywords as data is discouraged.
5071 5046
5072The @code{build-klist} mechanism for parsing keyword arguments 5047The @code{build-klist} mechanism for parsing keyword arguments
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 865e99a3aa6..1f9a401df90 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -1981,7 +1981,7 @@ usually not desired. D-Bus errors in events can be made visible by
1981setting the variable @code{dbus-debug} to @code{t}. They can also be 1981setting the variable @code{dbus-debug} to @code{t}. They can also be
1982handled by a hook function. 1982handled by a hook function.
1983 1983
1984@defvar dbus-event-error-hooks 1984@defvar dbus-event-error-functions
1985This hook variable keeps a list of functions, which are called when a 1985This hook variable keeps a list of functions, which are called when a
1986D-Bus error happens in the event handler. Every function must accept 1986D-Bus error happens in the event handler. Every function must accept
1987two arguments, the event and the error variable caught in 1987two arguments, the event and the error variable caught in
@@ -1997,7 +1997,7 @@ Example:
1997 (message "my-dbus-event-error-handler: %S %S" event error) 1997 (message "my-dbus-event-error-handler: %S %S" event error)
1998 (signal 'file-error (cdr error)))) 1998 (signal 'file-error (cdr error))))
1999 1999
2000(add-hook 'dbus-event-error-hooks 'my-dbus-event-error-handler) 2000(add-hook 'dbus-event-error-functions 'my-dbus-event-error-handler)
2001@end lisp 2001@end lisp
2002@end defvar 2002@end defvar
2003 2003
diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi
index 046cdc99414..1299f2ff062 100644
--- a/doc/misc/ede.texi
+++ b/doc/misc/ede.texi
@@ -1248,7 +1248,7 @@ detection scheme works like this:
1248 1248
1249@table @asis 1249@table @asis
1250@item Step 1: 1250@item Step 1:
1251@code{find-file-hooks} calls @code{ede-turn-on-hook} on BUFFER. 1251@code{find-file-hook} calls @code{ede-turn-on-hook} on BUFFER.
1252@item Step 2: 1252@item Step 2:
1253@code{ede-turn-on-hook} turns on @code{ede-minor-mode} 1253@code{ede-turn-on-hook} turns on @code{ede-minor-mode}
1254@item Step 3: 1254@item Step 3:
diff --git a/doc/misc/ediff.texi b/doc/misc/ediff.texi
index 01349e31468..0afcdd923d6 100644
--- a/doc/misc/ediff.texi
+++ b/doc/misc/ediff.texi
@@ -1248,7 +1248,7 @@ This hook is run just before @code{ediff-quit-hook}. This is a good
1248place to do various cleanups, such as deleting the variant buffers. 1248place to do various cleanups, such as deleting the variant buffers.
1249Ediff provides a function, @code{ediff-janitor}, as one such possible 1249Ediff provides a function, @code{ediff-janitor}, as one such possible
1250hook, which you can add to @code{ediff-cleanup-hook} with 1250hook, which you can add to @code{ediff-cleanup-hook} with
1251@code{add-hooks}. 1251@code{add-hook}.
1252 1252
1253@findex ediff-janitor 1253@findex ediff-janitor
1254This function kills buffers A, B, and, possibly, C, if these buffers aren't 1254This function kills buffers A, B, and, possibly, C, if these buffers aren't
diff --git a/doc/misc/forms.texi b/doc/misc/forms.texi
index bcb8d8974ea..11c3782dd7e 100644
--- a/doc/misc/forms.texi
+++ b/doc/misc/forms.texi
@@ -170,8 +170,8 @@ of the buffer are parsed using the specifications in
170@code{forms-format-list}, and the data file is updated. If the record 170@code{forms-format-list}, and the data file is updated. If the record
171has fields that aren't included in the display, they are not changed. 171has fields that aren't included in the display, they are not changed.
172 172
173@vindex forms-mode-hooks 173@vindex forms-mode-hook
174Entering Forms mode runs the normal hook @code{forms-mode-hooks} to 174Entering Forms mode runs the normal hook @code{forms-mode-hook} to
175perform user-defined customization. 175perform user-defined customization.
176 176
177To save any modified data, you can use @kbd{C-x C-s} 177To save any modified data, you can use @kbd{C-x C-s}
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index afc324e3fb4..a9cd0d3567c 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -3148,7 +3148,7 @@ following is added to a group parameter
3148 3148
3149@lisp 3149@lisp
3150(gnus-summary-prepared-hook 3150(gnus-summary-prepared-hook
3151 '(lambda nil (local-set-key "d" (local-key-binding "n")))) 3151 (lambda nil (local-set-key "d" (local-key-binding "n"))))
3152@end lisp 3152@end lisp
3153 3153
3154when the group is entered, the 'd' key will not mark the article as 3154when the group is entered, the 'd' key will not mark the article as
diff --git a/doc/misc/mh-e.texi b/doc/misc/mh-e.texi
index f6adc435789..e59b312889d 100644
--- a/doc/misc/mh-e.texi
+++ b/doc/misc/mh-e.texi
@@ -429,7 +429,7 @@ for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
429MH-E uses normal hooks in nearly all cases, so you can assume that we 429MH-E uses normal hooks in nearly all cases, so you can assume that we
430are talking about normal hooks unless we explicitly mention that a 430are talking about normal hooks unless we explicitly mention that a
431hook is abnormal. We also follow the conventions described in that 431hook is abnormal. We also follow the conventions described in that
432section: the name of the abnormal hooks end in @code{-hooks} and all 432section: the name of the abnormal hooks end in @code{-functions} and all
433the rest of the MH-E hooks end in @code{-hook}. You can add hooks with 433the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
434either @code{customize-option} or @code{add-hook}. 434either @code{customize-option} or @code{add-hook}.
435 435
@@ -3749,9 +3749,9 @@ when you press @key{TAB} when prompted for a folder name.
3749 3749
3750@findex mh-search-p 3750@findex mh-search-p
3751@kindex k 3751@kindex k
3752@vindex mh-kill-folder-suppress-prompt-hooks 3752@vindex mh-kill-folder-suppress-prompt-functions
3753 3753
3754The hook @code{mh-kill-folder-suppress-prompt-hooks} is an abnormal 3754The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
3755hook run at the beginning of the command @kbd{k}. The hook functions 3755hook run at the beginning of the command @kbd{k}. The hook functions
3756are called with no arguments and should return a non-nil value to 3756are called with no arguments and should return a non-nil value to
3757suppress the normal prompt when you remove a folder. This is useful 3757suppress the normal prompt when you remove a folder. This is useful
diff --git a/doc/misc/sem-user.texi b/doc/misc/sem-user.texi
index 9f4dc72fea3..9d6fb11db50 100644
--- a/doc/misc/sem-user.texi
+++ b/doc/misc/sem-user.texi
@@ -277,7 +277,7 @@ variable. This allows SemanticDB to save tag caches in directories
277controlled by them. 277controlled by them.
278@end defvar 278@end defvar
279 279
280@deffn Option semanticdb-save-database-hooks 280@deffn Option semanticdb-save-database-functions
281Abnormal hook run after a database is saved. Each function is called 281Abnormal hook run after a database is saved. Each function is called
282with one argument, the object representing the database recently 282with one argument, the object representing the database recently
283written. 283written.
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 530b8fdd6c2..46f99acbb87 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -3007,10 +3007,10 @@ checksum.
3007 3007
3008@lisp 3008@lisp
3009(add-hook 3009(add-hook
3010 'find-file-hooks 3010 'find-file-hook
3011 '(lambda () 3011 (lambda ()
3012 (when (file-remote-p default-directory) 3012 (when (file-remote-p default-directory)
3013 (set (make-local-variable 'file-precious-flag) t)))) 3013 (set (make-local-variable 'file-precious-flag) t))))
3014@end lisp 3014@end lisp
3015@end itemize 3015@end itemize
3016 3016
@@ -3126,7 +3126,7 @@ into your @file{~/.emacs}:
3126 (setq mode-line-format 3126 (setq mode-line-format
3127 (format-mode-line mode-line-format 'font-lock-warning-face)))) 3127 (format-mode-line mode-line-format 'font-lock-warning-face))))
3128 3128
3129(add-hook 'find-file-hooks 'my-mode-line-function) 3129(add-hook 'find-file-hook 'my-mode-line-function)
3130(add-hook 'dired-mode-hook 'my-mode-line-function) 3130(add-hook 'dired-mode-hook 'my-mode-line-function)
3131@end lisp 3131@end lisp
3132@end ifset 3132@end ifset
@@ -3159,10 +3159,10 @@ should put it into your @file{~/.emacs}:
3159 3159
3160(add-hook 3160(add-hook
3161 'dired-mode-hook 3161 'dired-mode-hook
3162 '(lambda () 3162 (lambda ()
3163 (setq 3163 (setq
3164 mode-line-buffer-identification 3164 mode-line-buffer-identification
3165 my-mode-line-buffer-identification))) 3165 my-mode-line-buffer-identification)))
3166@end lisp 3166@end lisp
3167 3167
3168Since @value{emacsname} 23.1, the mode line contains an indication if 3168Since @value{emacsname} 23.1, the mode line contains an indication if
@@ -3195,9 +3195,9 @@ like this:
3195@lisp 3195@lisp
3196(add-hook 3196(add-hook
3197 'dired-before-readin-hook 3197 'dired-before-readin-hook
3198 '(lambda () 3198 (lambda ()
3199 (when (file-remote-p default-directory) 3199 (when (file-remote-p default-directory)
3200 (setq dired-actual-switches "-al")))) 3200 (setq dired-actual-switches "-al"))))
3201@end lisp 3201@end lisp
3202@end ifset 3202@end ifset
3203 3203
@@ -3329,9 +3329,9 @@ minibuffer:
3329 3329
3330(add-hook 3330(add-hook
3331 'minibuffer-setup-hook 3331 'minibuffer-setup-hook
3332 '(lambda () 3332 (lambda ()
3333 (abbrev-mode 1) 3333 (abbrev-mode 1)
3334 (setq local-abbrev-table my-tramp-abbrev-table))) 3334 (setq local-abbrev-table my-tramp-abbrev-table)))
3335 3335
3336(defadvice minibuffer-complete 3336(defadvice minibuffer-complete
3337 (before my-minibuffer-complete activate) 3337 (before my-minibuffer-complete activate)
@@ -3398,7 +3398,7 @@ their readability through a remote access:
3398@ifset xemacs 3398@ifset xemacs
3399(recent-files-initialize) 3399(recent-files-initialize)
3400(add-hook 3400(add-hook
3401 'find-file-hooks 3401 'find-file-hook
3402 (lambda () 3402 (lambda ()
3403 (when (file-remote-p (buffer-file-name)) 3403 (when (file-remote-p (buffer-file-name))
3404 (recent-files-make-permanent))) 3404 (recent-files-make-permanent)))