aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJoakim Verona2012-10-25 13:00:31 +0200
committerJoakim Verona2012-10-25 13:00:31 +0200
commitd1eb940020b683ef6864eb6a105dbc8eb3d9452a (patch)
tree4d6dc0dd1d8c2921956173d99d4268215a8e3a81 /doc
parentfd0ea43455f2bd9c96f76b87188f0808bd6ce213 (diff)
parentcee6efdef3af910f952968a28094e89bde13faed (diff)
downloademacs-d1eb940020b683ef6864eb6a105dbc8eb3d9452a.tar.gz
emacs-d1eb940020b683ef6864eb6a105dbc8eb3d9452a.zip
upstream
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog10
-rw-r--r--doc/emacs/dired.texi86
-rw-r--r--doc/emacs/mule.texi16
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/minibuf.texi21
-rw-r--r--doc/lispref/nonascii.texi8
-rw-r--r--doc/misc/ChangeLog21
-rw-r--r--doc/misc/cl.texi327
8 files changed, 190 insertions, 305 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 9a71ed5b272..b911153f080 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,13 @@
12012-10-24 Chong Yidong <cyd@gnu.org>
2
3 * mule.texi (Text Coding): set-buffer-file-coding-system can now
4 be invoked from the mode line.
5
6 * dired.texi (Dired Deletion, Marks vs Flags): Document Emacs 24.3
7 changes to the mark and unmark commands.
8 (Comparison in Dired): Document chages to dired-diff. Remove M-=,
9 which is no longer bound to dired-backup-diff.
10
12012-10-23 Bastien Guerry <bzg@gnu.org> 112012-10-23 Bastien Guerry <bzg@gnu.org>
2 12
3 * text.texi (Org Authoring): Use a comma after @ref to avoid the 13 * text.texi (Org Authoring): Use a comma after @ref to avoid the
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index 0dcded78364..8babbcb89ea 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -167,13 +167,14 @@ deletion, then delete the files that were flagged.
167 167
168@table @kbd 168@table @kbd
169@item d 169@item d
170Flag this file for deletion. 170Flag this file for deletion (@code{dired-flag-file-deletion}).
171@item u 171@item u
172Remove deletion flag on this line. 172Remove the deletion flag (@code{dired-unmark}).
173@item @key{DEL} 173@item @key{DEL}
174Move point to previous line and remove the deletion flag on that line. 174Move point to previous line and remove the deletion flag on that line
175(@code{dired-unmark-backward}).
175@item x 176@item x
176Delete the files that are flagged for deletion. 177Delete files flagged for deletion (@code{dired-do-flagged-delete}).
177@end table 178@end table
178 179
179@kindex d @r{(Dired)} 180@kindex d @r{(Dired)}
@@ -182,8 +183,12 @@ Delete the files that are flagged for deletion.
182the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The 183the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The
183deletion flag is visible as a @samp{D} at the beginning of the line. 184deletion flag is visible as a @samp{D} at the beginning of the line.
184This command moves point to the next line, so that repeated @kbd{d} 185This command moves point to the next line, so that repeated @kbd{d}
185commands flag successive files. A numeric argument serves as a repeat 186commands flag successive files. A numeric prefix argument serves as a
186count. 187repeat count; a negative count means to flag preceding files.
188
189 If the region is active, the @kbd{d} command flags all files in the
190region for deletion; in this case, the command does not move point,
191and ignores any prefix argument.
187 192
188@kindex u @r{(Dired deletion)} 193@kindex u @r{(Dired deletion)}
189@kindex DEL @r{(Dired)} 194@kindex DEL @r{(Dired)}
@@ -194,14 +199,17 @@ can remove deletion flags using the commands @kbd{u} and @key{DEL}.
194@kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes 199@kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes
195flags rather than making flags. @key{DEL} 200flags rather than making flags. @key{DEL}
196(@code{dired-unmark-backward}) moves upward, removing flags; it is 201(@code{dired-unmark-backward}) moves upward, removing flags; it is
197like @kbd{u} with argument @minus{}1. 202like @kbd{u} with argument @minus{}1. A numeric prefix argument to
203either command serves as a repeat count, with a negative count meaning
204to unflag in the opposite direction. If the region is active, these
205commands instead unflag all files in the region, without moving point.
198 206
199@kindex x @r{(Dired)} 207@kindex x @r{(Dired)}
200@findex dired-do-flagged-delete 208@findex dired-do-flagged-delete
201 To delete the flagged files, type @kbd{x} 209 To delete flagged files, type @kbd{x}
202(@code{dired-do-flagged-delete}). This command first displays a list 210(@code{dired-do-flagged-delete}). This command displays a list of all
203of all the file names flagged for deletion, and requests confirmation 211the file names flagged for deletion, and requests confirmation with
204with @kbd{yes}. If you confirm, Dired deletes the flagged files, then 212@kbd{yes}. If you confirm, Dired deletes the flagged files, then
205deletes their lines from the text of the Dired buffer. The Dired 213deletes their lines from the text of the Dired buffer. The Dired
206buffer, with somewhat fewer lines, remains selected. 214buffer, with somewhat fewer lines, remains selected.
207 215
@@ -387,10 +395,11 @@ and unflag files.)
387@kindex m @r{(Dired)} 395@kindex m @r{(Dired)}
388@kindex * m @r{(Dired)} 396@kindex * m @r{(Dired)}
389@findex dired-mark 397@findex dired-mark
390Mark the current file with @samp{*} (@code{dired-mark}). With a numeric 398Mark the current file with @samp{*} (@code{dired-mark}). If the
391argument @var{n}, mark the next @var{n} files starting with the current 399region is active, mark all files in the region instead; otherwise, if
392file. (If @var{n} is negative, mark the previous @minus{}@var{n} 400a numeric argument @var{n} is supplied, mark the next @var{n} files
393files.) 401instead, starting with the current file (if @var{n} is negative, mark
402the previous @minus{}@var{n} files).
394 403
395@item * * 404@item * *
396@kindex * * @r{(Dired)} 405@kindex * * @r{(Dired)}
@@ -426,7 +435,11 @@ and @file{..} (@code{dired-mark-subdir-files}).
426@kindex u @r{(Dired)} 435@kindex u @r{(Dired)}
427@kindex * u @r{(Dired)} 436@kindex * u @r{(Dired)}
428@findex dired-unmark 437@findex dired-unmark
429Remove any mark on this line (@code{dired-unmark}). 438Remove any mark on this line (@code{dired-unmark}). If the region is
439active, unmark all files in the region instead; otherwise, if a
440numeric argument @var{n} is supplied, unmark the next @var{n} files
441instead, starting with the current file (if @var{n} is negative,
442unmark the previous @minus{}@var{n} files).
430 443
431@item @key{DEL} 444@item @key{DEL}
432@itemx * @key{DEL} 445@itemx * @key{DEL}
@@ -434,7 +447,11 @@ Remove any mark on this line (@code{dired-unmark}).
434@findex dired-unmark-backward 447@findex dired-unmark-backward
435@cindex unmarking files (in Dired) 448@cindex unmarking files (in Dired)
436Move point to previous line and remove any mark on that line 449Move point to previous line and remove any mark on that line
437(@code{dired-unmark-backward}). 450(@code{dired-unmark-backward}). If the region is active, unmark all
451files in the region instead; otherwise, if a numeric argument @var{n}
452is supplied, unmark the @var{n} preceding files instead, starting with
453the current file (if @var{n} is negative, unmark the next
454@minus{}@var{n} files).
438 455
439@item * ! 456@item * !
440@itemx U 457@itemx U
@@ -936,32 +953,19 @@ default.
936@cindex file comparison (in Dired) 953@cindex file comparison (in Dired)
937@cindex compare files (in Dired) 954@cindex compare files (in Dired)
938 955
939 Here are two Dired commands that compare specified files using
940@code{diff}. They show the output in a buffer using Diff mode
941(@pxref{Comparing Files}).
942
943@table @kbd
944@item =
945@findex dired-diff 956@findex dired-diff
946@kindex = @r{(Dired)} 957@kindex = @r{(Dired)}
947Compare the current file (the file at point) with another file (the 958 The @kbd{=} (@code{dired-diff}) command compares the current file
948file at the mark) using the @code{diff} program (@code{dired-diff}). 959(the file at point) with another file (read using the minibuffer)
949The file at the mark is the first argument of @code{diff}, and the 960using the @command{diff} program. The file specified with the
950file at point is the second argument. This refers to the ordinary 961minibuffer is the first argument of @command{diff}, and file at point
951Emacs mark, not Dired marks; use @kbd{C-@key{SPC}} 962is the second argument. The output of the @command{diff} program is
952(@code{set-mark-command}) to set the mark at the first file's line 963shown in a buffer using Diff mode (@pxref{Comparing Files}).
953(@pxref{Setting Mark}). 964
954 965 If the region is active, the default for the file read using the
955@findex dired-backup-diff 966minibuffer is the file at the mark (i.e.@: the ordinary Emacs mark,
956@kindex M-= @r{(Dired)} 967not a Dired mark; @pxref{Setting Mark}). Otherwise, if the file at
957@item M-= 968point has a backup file (@pxref{Backup}), that is the default.
958Compare the current file with its latest backup file
959(@code{dired-backup-diff}). If the current file is itself a backup,
960compare it with the file it is a backup of; this way, you can compare
961a file with any one of its backups.
962
963The backup file is the first file given to @code{diff}.
964@end table
965 969
966@node Subdirectories in Dired 970@node Subdirectories in Dired
967@section Subdirectories in Dired 971@section Subdirectories in Dired
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 1dfae79c788..d7ed6cc488f 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1040,12 +1040,16 @@ decoding it using coding system @var{right} instead.
1040@findex set-buffer-file-coding-system 1040@findex set-buffer-file-coding-system
1041 The command @kbd{C-x @key{RET} f} 1041 The command @kbd{C-x @key{RET} f}
1042(@code{set-buffer-file-coding-system}) sets the file coding system for 1042(@code{set-buffer-file-coding-system}) sets the file coding system for
1043the current buffer---in other words, it says which coding system to 1043the current buffer (i.e.@: the coding system to use when saving or
1044use when saving or reverting the visited file. You specify which 1044reverting the file). You specify which coding system using the
1045coding system using the minibuffer. If you specify a coding system 1045minibuffer. You can also invoke this command by clicking with
1046that cannot handle all of the characters in the buffer, Emacs warns 1046@kbd{Mouse-3} on the coding system indicator in the mode line
1047you about the troublesome characters when you actually save the 1047(@pxref{Mode Line}).
1048buffer. 1048
1049 If you specify a coding system that cannot handle all the characters
1050in the buffer, Emacs will warn you about the troublesome characters,
1051and ask you to choose another coding system, when you try to save the
1052buffer (@pxref{Output Coding}).
1049 1053
1050@cindex specify end-of-line conversion 1054@cindex specify end-of-line conversion
1051 You can also use this command to specify the end-of-line conversion 1055 You can also use this command to specify the end-of-line conversion
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index bed74bb688a..25dee5212e5 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -11,6 +11,12 @@
11 11
122012-10-24 Chong Yidong <cyd@gnu.org> 122012-10-24 Chong Yidong <cyd@gnu.org>
13 13
14 * minibuf.texi (Text from Minibuffer): Document read-regexp
15 changes.
16
17 * nonascii.texi (Selecting a Representation): Document
18 set-buffer-multibyte changes.
19
14 * keymaps.texi (Toolkit Differences): Node deleted. 20 * keymaps.texi (Toolkit Differences): Node deleted.
15 (Easy Menu): New node. 21 (Easy Menu): New node.
16 22
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 39b4fca3b25..79c83144f77 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -211,22 +211,25 @@ This function works by calling the
211@end smallexample 211@end smallexample
212@end defun 212@end defun
213 213
214@defun read-regexp prompt &optional default 214@defun read-regexp prompt &optional default history
215This function reads a regular expression as a string from the 215This function reads a regular expression as a string from the
216minibuffer and returns it. The argument @var{prompt} is used as in 216minibuffer and returns it. The argument @var{prompt} is used as in
217@code{read-from-minibuffer}. The keymap used is 217@code{read-from-minibuffer}.
218@code{minibuffer-local-map}, and @code{regexp-history} is used as the
219history list (@pxref{Minibuffer History, regexp-history}).
220 218
221The optional argument @var{default} specifies a default value to 219The optional argument @var{default} specifies a default value to
222return if the user enters null input; it should be a string, or 220return if the user enters null input; it should be a string, or
223@code{nil}, which is equivalent to an empty string. 221@code{nil}, which is equivalent to an empty string.
224 222
225In addition, @code{read-regexp} collects a few useful candidates for 223The optional argument @var{history}, if non-@code{nil}, is a symbol
226input and passes them to @code{read-from-minibuffer}, to make them 224specifying a minibuffer history list to use (@pxref{Minibuffer
227available to the user as the ``future minibuffer history list'' 225History}). If it is omitted or @code{nil}, the history list defaults
228(@pxref{Minibuffer History, future list,, emacs, The GNU Emacs 226to @code{regexp-history}.
229Manual}). These candidates are: 227
228@code{read-regexp} also collects a few useful candidates for input and
229passes them to @code{read-from-minibuffer}, to make them available to
230the user as the ``future minibuffer history list'' (@pxref{Minibuffer
231History, future list,, emacs, The GNU Emacs Manual}). These
232candidates are:
230 233
231@itemize @minus 234@itemize @minus
232@item 235@item
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 2f6f516c587..e384d40176e 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -241,8 +241,12 @@ representation is in use. It also adjusts various data in the buffer
241(including overlays, text properties and markers) so that they cover the 241(including overlays, text properties and markers) so that they cover the
242same text as they did before. 242same text as they did before.
243 243
244You cannot use @code{set-buffer-multibyte} on an indirect buffer, 244This function signals an error if the buffer is narrowed, since the
245because indirect buffers always inherit the representation of the 245narrowing might have occurred in the middle of multibyte character
246sequences.
247
248This function also signals an error if the buffer is an indirect
249buffer. An indirect buffer always inherits the representation of its
246base buffer. 250base buffer.
247@end defun 251@end defun
248 252
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 76859e09d42..ec46ab5eb05 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,5 +1,26 @@
12012-10-25 Glenn Morris <rgm@gnu.org>
2
3 * cl.texi: Don't mess with the TeX section number counter.
4 Use Texinfo recommended convention for quotes+punctuation.
5 (Overview, Sequence Functions): Rephrase for better line-breaking.
6 (Time of Evaluation, Type Predicates, Modify Macros, Function Bindings)
7 (Macro Bindings, Conditionals, Iteration, Loop Basics)
8 (Random Numbers, Mapping over Sequences, Structures)
9 (Porting Common Lisp): Further updates for cl-lib namespace.
10 (Modify Macros, Declarations, Macro Bindings, Structures):
11 Break long lines in examples.
12 (Dynamic Bindings): Update for changed progv behavior.
13 (Loop Examples, Efficiency Concerns): Markup fixes.
14 (Structures): Remove TeX margin change.
15 (Declarations): Fix typos.
16
12012-10-24 Glenn Morris <rgm@gnu.org> 172012-10-24 Glenn Morris <rgm@gnu.org>
2 18
19 * cl.texi (Overview, Multiple Values, Creating Symbols)
20 (Numerical Functions): Say less/nothing about the original cl.el.
21 (Old CL Compatibility): Remove.
22 (Assertions): Remove ignore-errors (standard Elisp for some time).
23
3 * cl.texi (Basic Setf, Macros, Declarations, Symbols, Numbers) 24 * cl.texi (Basic Setf, Macros, Declarations, Symbols, Numbers)
4 (Sequences, Lists, Structures, Assertions, Efficiency Concerns) 25 (Sequences, Lists, Structures, Assertions, Efficiency Concerns)
5 (Efficiency Concerns, Efficiency Concerns) 26 (Efficiency Concerns, Efficiency Concerns)
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 5908e94be02..9200958a1b5 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -65,11 +65,10 @@ developing GNU and promoting software freedom.''
65* Sequences:: Mapping, functions, searching, sorting. 65* Sequences:: Mapping, functions, searching, sorting.
66* Lists:: @code{cl-caddr}, @code{cl-sublis}, @code{cl-member}, @code{cl-assoc}, etc. 66* Lists:: @code{cl-caddr}, @code{cl-sublis}, @code{cl-member}, @code{cl-assoc}, etc.
67* Structures:: @code{cl-defstruct}. 67* Structures:: @code{cl-defstruct}.
68* Assertions:: @code{cl-check-type}, @code{cl-assert}, @code{ignore-errors}. 68* Assertions:: @code{cl-check-type}, @code{cl-assert}.
69 69
70* Efficiency Concerns:: Hints and techniques. 70* Efficiency Concerns:: Hints and techniques.
71* Common Lisp Compatibility:: All known differences with Steele. 71* Common Lisp Compatibility:: All known differences with Steele.
72* Old CL Compatibility:: All known differences with old cl.el.
73* Porting Common Lisp:: Hints for porting Common Lisp code. 72* Porting Common Lisp:: Hints for porting Common Lisp code.
74 73
75* GNU Free Documentation License:: The license for this documentation. 74* GNU Free Documentation License:: The license for this documentation.
@@ -116,19 +115,16 @@ features.
116 115
117@end itemize 116@end itemize
118 117
119The package described here was originally written by Dave Gillespie, 118This package was originally written by Dave Gillespie,
120@file{daveg@@synaptics.com}, as a total rewrite of an earlier 119@file{daveg@@synaptics.com}, as a total rewrite of an earlier 1986
1211986 @file{cl.el} package by Cesar Quiroz. Most features of the 120@file{cl.el} package by Cesar Quiroz. Care has been taken to ensure
122Quiroz package were retained; any incompatibilities are 121that each function is defined efficiently, concisely, and with minimal
123noted in the descriptions below. Care has been taken in this 122impact on the rest of the Emacs environment. Stefan Monnier added the
124version to ensure that each function is defined efficiently, 123file @file{cl-lib.el} and rationalized the namespace for Emacs 24.3.
125concisely, and with minimal impact on the rest of the Emacs
126environment. Stefan Monnier added the file @file{cl-lib.el} and
127rationalized the namespace for Emacs 24.3.
128 124
129@menu 125@menu
130* Usage:: How to use the CL package. 126* Usage:: How to use the CL package.
131* Organization:: The package's five component files. 127* Organization:: The package's component files.
132* Naming Conventions:: Notes on CL function names. 128* Naming Conventions:: Notes on CL function names.
133@end menu 129@end menu
134 130
@@ -198,12 +194,9 @@ no such restriction on the use of @code{cl-lib}. New code should use
198@code{cl-lib} rather than @code{cl}. @xref{Naming Conventions}. 194@code{cl-lib} rather than @code{cl}. @xref{Naming Conventions}.
199 195
200There is one more file, @file{cl-compat.el}, which defines some 196There is one more file, @file{cl-compat.el}, which defines some
201routines from the older CL package that are not otherwise 197routines from the older Quiroz CL package that are not otherwise
202present in the new package. This includes internal routines 198present in the new package. This file is obsolete and should not be
203like @code{setelt} and @code{zip-lists}, deprecated features 199used in new code.
204like @code{defkeyword}, and an emulation of the old-style
205multiple-values feature. This file is obsolete and should not be used
206in new code. @xref{Old CL Compatibility}.
207 200
208@node Naming Conventions 201@node Naming Conventions
209@section Naming Conventions 202@section Naming Conventions
@@ -260,10 +253,6 @@ and the @code{cl-eval-when} construct.
260* Time of Evaluation:: The @code{cl-eval-when} construct. 253* Time of Evaluation:: The @code{cl-eval-when} construct.
261@end menu 254@end menu
262 255
263@iftex
264@secno=1
265@end iftex
266
267@node Argument Lists 256@node Argument Lists
268@section Argument Lists 257@section Argument Lists
269 258
@@ -572,16 +561,16 @@ last four would have been equivalent to the corresponding @code{setq}s.
572Note that @code{(cl-eval-when (load eval) @dots{})} is equivalent 561Note that @code{(cl-eval-when (load eval) @dots{})} is equivalent
573to @code{(progn @dots{})} in all contexts. The compiler treats 562to @code{(progn @dots{})} in all contexts. The compiler treats
574certain top-level forms, like @code{defmacro} (sort-of) and 563certain top-level forms, like @code{defmacro} (sort-of) and
575@code{require}, as if they were wrapped in @code{(eval-when 564@code{require}, as if they were wrapped in @code{(cl-eval-when
576(compile load eval) @dots{})}. 565(compile load eval) @dots{})}.
577@end defspec 566@end defspec
578 567
579Emacs includes two special forms related to @code{cl-eval-when}. 568Emacs includes two special forms related to @code{cl-eval-when}.
580One of these, @code{eval-when-compile}, is not quite equivalent to 569One of these, @code{eval-when-compile}, is not quite equivalent to
581any @code{eval-when} construct and is described below. 570any @code{cl-eval-when} construct and is described below.
582 571
583The other form, @code{(eval-and-compile @dots{})}, is exactly 572The other form, @code{(eval-and-compile @dots{})}, is exactly
584equivalent to @samp{(eval-when (compile load eval) @dots{})} and 573equivalent to @samp{(cl-eval-when (compile load eval) @dots{})} and
585so is not itself defined by this package. 574so is not itself defined by this package.
586 575
587@defspec eval-when-compile forms... 576@defspec eval-when-compile forms...
@@ -653,10 +642,6 @@ facts are true or false.
653@node Type Predicates 642@node Type Predicates
654@section Type Predicates 643@section Type Predicates
655 644
656@noindent
657The @code{CL} package defines a version of the Common Lisp @code{typep}
658predicate.
659
660@defun cl-typep object type 645@defun cl-typep object type
661Check if @var{object} is of type @var{type}, where @var{type} is a 646Check if @var{object} is of type @var{type}, where @var{type} is a
662(quoted) type name of the sort used by Common Lisp. For example, 647(quoted) type name of the sort used by Common Lisp. For example,
@@ -737,7 +722,7 @@ related to @code{cl-typep}.
737@defun cl-coerce object type 722@defun cl-coerce object type
738This function attempts to convert @var{object} to the specified 723This function attempts to convert @var{object} to the specified
739@var{type}. If @var{object} is already of that type as determined by 724@var{type}. If @var{object} is already of that type as determined by
740@code{typep}, it is simply returned. Otherwise, certain types of 725@code{cl-typep}, it is simply returned. Otherwise, certain types of
741conversions will be made: If @var{type} is any sequence type 726conversions will be made: If @var{type} is any sequence type
742(@code{string}, @code{list}, etc.) then @var{object} will be 727(@code{string}, @code{list}, etc.) then @var{object} will be
743converted to that type if possible. If @var{type} is 728converted to that type if possible. If @var{type} is
@@ -1109,7 +1094,8 @@ does, which means the above form is @emph{not} equivalent to the
1109``obvious'' expansion, 1094``obvious'' expansion,
1110 1095
1111@example 1096@example
1112(setf (aref vec (cl-incf i)) (1+ (aref vec (cl-incf i)))) ; Wrong! 1097(setf (aref vec (cl-incf i))
1098 (1+ (aref vec (cl-incf i)))) ; wrong!
1113@end example 1099@end example
1114 1100
1115@noindent 1101@noindent
@@ -1134,6 +1120,7 @@ This macro decrements the number stored in @var{place} by one, or
1134by @var{x} if specified. 1120by @var{x} if specified.
1135@end defspec 1121@end defspec
1136 1122
1123@c FIXME move to lispref, add generalized variables.
1137@defspec pop place 1124@defspec pop place
1138This macro removes and returns the first element of the list stored 1125This macro removes and returns the first element of the list stored
1139in @var{place}. It is analogous to @code{(prog1 (car @var{place}) 1126in @var{place}. It is analogous to @code{(prog1 (car @var{place})
@@ -1141,17 +1128,18 @@ in @var{place}. It is analogous to @code{(prog1 (car @var{place})
1141to evaluate all subforms only once. 1128to evaluate all subforms only once.
1142@end defspec 1129@end defspec
1143 1130
1131@c FIXME move to lispref, add generalized variables.
1144@defspec push x place 1132@defspec push x place
1145This macro inserts @var{x} at the front of the list stored in 1133This macro inserts @var{x} at the front of the list stored in
1146@var{place}. It is analogous to @code{(setf @var{place} (cons 1134@var{place}. It is analogous to @code{(setf @var{place} (cons
1147@var{x} @var{place}))}, except for evaluation of the subforms. 1135@var{x} @var{place}))}, except for evaluation of the subforms.
1148@end defspec 1136@end defspec
1149 1137
1150@defspec pushnew x place @t{&key :test :test-not :key} 1138@defspec cl-pushnew x place @t{&key :test :test-not :key}
1151This macro inserts @var{x} at the front of the list stored in 1139This macro inserts @var{x} at the front of the list stored in
1152@var{place}, but only if @var{x} was not @code{eql} to any 1140@var{place}, but only if @var{x} was not @code{eql} to any
1153existing element of the list. The optional keyword arguments 1141existing element of the list. The optional keyword arguments
1154are interpreted in the same way as for @code{adjoin}. 1142are interpreted in the same way as for @code{cl-adjoin}.
1155@xref{Lists as Sets}. 1143@xref{Lists as Sets}.
1156@end defspec 1144@end defspec
1157 1145
@@ -1175,9 +1163,9 @@ except that the subforms of @var{a}, @var{b}, and @var{c} are actually
1175evaluated only once each and in the apparent order. 1163evaluated only once each and in the apparent order.
1176@end defspec 1164@end defspec
1177 1165
1178@defspec rotatef place@dots{} 1166@defspec cl-rotatef place@dots{}
1179This macro rotates the @var{place}s left by one in circular fashion. 1167This macro rotates the @var{place}s left by one in circular fashion.
1180Thus, @code{(rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to 1168Thus, @code{(cl-rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to
1181 1169
1182@example 1170@example
1183(psetf @var{a} @var{b} 1171(psetf @var{a} @var{b}
@@ -1187,8 +1175,8 @@ Thus, @code{(rotatef @var{a} @var{b} @var{c} @var{d})} is equivalent to
1187@end example 1175@end example
1188 1176
1189@noindent 1177@noindent
1190except for the evaluation of subforms. @code{rotatef} always 1178except for the evaluation of subforms. @code{cl-rotatef} always
1191returns @code{nil}. Note that @code{(rotatef @var{a} @var{b})} 1179returns @code{nil}. Note that @code{(cl-rotatef @var{a} @var{b})}
1192conveniently exchanges @var{a} and @var{b}. 1180conveniently exchanges @var{a} and @var{b}.
1193@end defspec 1181@end defspec
1194 1182
@@ -1247,40 +1235,40 @@ If the symbol is not bound on entry, it is simply made unbound by
1247@code{makunbound} or @code{fmakunbound} on exit. 1235@code{makunbound} or @code{fmakunbound} on exit.
1248@end defspec 1236@end defspec
1249 1237
1250@defspec letf* (bindings@dots{}) forms@dots{} 1238@defspec cl-letf* (bindings@dots{}) forms@dots{}
1251This macro is to @code{letf} what @code{let*} is to @code{let}: 1239This macro is to @code{letf} what @code{let*} is to @code{let}:
1252It does the bindings in sequential rather than parallel order. 1240It does the bindings in sequential rather than parallel order.
1253@end defspec 1241@end defspec
1254 1242
1255@defspec callf @var{function} @var{place} @var{args}@dots{} 1243@defspec cl-callf @var{function} @var{place} @var{args}@dots{}
1256This is the ``generic'' modify macro. It calls @var{function}, 1244This is the ``generic'' modify macro. It calls @var{function},
1257which should be an unquoted function name, macro name, or lambda. 1245which should be an unquoted function name, macro name, or lambda.
1258It passes @var{place} and @var{args} as arguments, and assigns the 1246It passes @var{place} and @var{args} as arguments, and assigns the
1259result back to @var{place}. For example, @code{(cl-incf @var{place} 1247result back to @var{place}. For example, @code{(cl-incf @var{place}
1260@var{n})} is the same as @code{(callf + @var{place} @var{n})}. 1248@var{n})} is the same as @code{(cl-callf + @var{place} @var{n})}.
1261Some more examples: 1249Some more examples:
1262 1250
1263@example 1251@example
1264(callf abs my-number) 1252(cl-callf abs my-number)
1265(callf concat (buffer-name) "<" (int-to-string n) ">") 1253(cl-callf concat (buffer-name) "<" (number-to-string n) ">")
1266(callf union happy-people (list joe bob) :test 'same-person) 1254(cl-callf cl-union happy-people (list joe bob) :test 'same-person)
1267@end example 1255@end example
1268 1256
1269@xref{Customizing Setf}, for @code{define-modify-macro}, a way 1257@xref{Customizing Setf}, for @code{define-modify-macro}, a way
1270to create even more concise notations for modify macros. Note 1258to create even more concise notations for modify macros. Note
1271again that @code{callf} is an extension to standard Common Lisp. 1259again that @code{cl-callf} is an extension to standard Common Lisp.
1272@end defspec 1260@end defspec
1273 1261
1274@defspec callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{} 1262@defspec cl-callf2 @var{function} @var{arg1} @var{place} @var{args}@dots{}
1275This macro is like @code{callf}, except that @var{place} is 1263This macro is like @code{cl-callf}, except that @var{place} is
1276the @emph{second} argument of @var{function} rather than the 1264the @emph{second} argument of @var{function} rather than the
1277first. For example, @code{(push @var{x} @var{place})} is 1265first. For example, @code{(push @var{x} @var{place})} is
1278equivalent to @code{(callf2 cons @var{x} @var{place})}. 1266equivalent to @code{(cl-callf2 cons @var{x} @var{place})}.
1279@end defspec 1267@end defspec
1280 1268
1281The @code{callf} and @code{callf2} macros serve as building 1269The @code{cl-callf} and @code{cl-callf2} macros serve as building
1282blocks for other macros like @code{cl-incf}, @code{pushnew}, and 1270blocks for other macros like @code{cl-incf}, @code{cl-pushnew}, and
1283@code{define-modify-macro}. The @code{letf} and @code{letf*} 1271@code{define-modify-macro}. The @code{letf} and @code{cl-letf*}
1284macros are used in the processing of symbol macros; 1272macros are used in the processing of symbol macros;
1285@pxref{Macro Bindings}. 1273@pxref{Macro Bindings}.
1286 1274
@@ -1494,10 +1482,6 @@ or otherwise declared; in newer Common Lisps, this would not be
1494an error since the function @code{(setf @var{func})} might be 1482an error since the function @code{(setf @var{func})} might be
1495defined later. 1483defined later.
1496 1484
1497@iftex
1498@secno=4
1499@end iftex
1500
1501@node Variable Bindings 1485@node Variable Bindings
1502@section Variable Bindings 1486@section Variable Bindings
1503 1487
@@ -1530,7 +1514,7 @@ set of variables computed at run-time. The expressions
1530of symbols and values, respectively. The symbols are bound to the 1514of symbols and values, respectively. The symbols are bound to the
1531corresponding values for the duration of the body @var{form}s. 1515corresponding values for the duration of the body @var{form}s.
1532If @var{values} is shorter than @var{symbols}, the last few symbols 1516If @var{values} is shorter than @var{symbols}, the last few symbols
1533are made unbound (as if by @code{makunbound}) inside the body. 1517are bound to @code{nil}.
1534If @var{symbols} is shorter than @var{values}, the excess values 1518If @var{symbols} is shorter than @var{values}, the excess values
1535are ignored. 1519are ignored.
1536@end defspec 1520@end defspec
@@ -1661,7 +1645,7 @@ This form establishes @code{let}-style bindings on the function
1661cells of symbols rather than on the value cells. Each @var{binding} 1645cells of symbols rather than on the value cells. Each @var{binding}
1662must be a list of the form @samp{(@var{name} @var{arglist} 1646must be a list of the form @samp{(@var{name} @var{arglist}
1663@var{forms}@dots{})}, which defines a function exactly as if 1647@var{forms}@dots{})}, which defines a function exactly as if
1664it were a @code{defun*} form. The function @var{name} is defined 1648it were a @code{cl-defun} form. The function @var{name} is defined
1665accordingly for the duration of the body of the @code{flet}; then 1649accordingly for the duration of the body of the @code{flet}; then
1666the old function definition, or lack thereof, is restored. 1650the old function definition, or lack thereof, is restored.
1667 1651
@@ -1729,7 +1713,7 @@ function, or a use of its name quoted by @code{quote} or
1729@subsection Macro Bindings 1713@subsection Macro Bindings
1730 1714
1731@noindent 1715@noindent
1732These forms create local macros and ``symbol macros.'' 1716These forms create local macros and ``symbol macros''.
1733 1717
1734@defspec cl-macrolet (bindings@dots{}) forms@dots{} 1718@defspec cl-macrolet (bindings@dots{}) forms@dots{}
1735This form is analogous to @code{flet}, but for macros instead of 1719This form is analogous to @code{flet}, but for macros instead of
@@ -1765,7 +1749,7 @@ I.e., @code{(setq foo 4)} in the above would be equivalent to
1765@code{(setf foo 4)}, which in turn expands to @code{(setf (car bar) 4)}. 1749@code{(setf foo 4)}, which in turn expands to @code{(setf (car bar) 4)}.
1766 1750
1767Likewise, a @code{let} or @code{let*} binding a symbol macro is 1751Likewise, a @code{let} or @code{let*} binding a symbol macro is
1768treated like a @code{letf} or @code{letf*}. This differs from true 1752treated like a @code{letf} or @code{cl-letf*}. This differs from true
1769Common Lisp, where the rules of lexical scoping cause a @code{let} 1753Common Lisp, where the rules of lexical scoping cause a @code{let}
1770binding to shadow a @code{cl-symbol-macrolet} binding. In this package, 1754binding to shadow a @code{cl-symbol-macrolet} binding. In this package,
1771only @code{lexical-let} and @code{lexical-let*} will shadow a symbol 1755only @code{lexical-let} and @code{lexical-let*} will shadow a symbol
@@ -1779,8 +1763,9 @@ expansion of another macro:
1779(cl-defmacro my-dolist ((x list) &rest body) 1763(cl-defmacro my-dolist ((x list) &rest body)
1780 (let ((var (gensym))) 1764 (let ((var (gensym)))
1781 (list 'cl-loop 'for var 'on list 'do 1765 (list 'cl-loop 'for var 'on list 'do
1782 (cl-list* 'cl-symbol-macrolet (list (list x (list 'car var))) 1766 (cl-list* 'cl-symbol-macrolet
1783 body)))) 1767 (list (list x (list 'car var)))
1768 body))))
1784 1769
1785(setq mylist '(1 2 3 4)) 1770(setq mylist '(1 2 3 4))
1786(my-dolist (x mylist) (cl-incf x)) 1771(my-dolist (x mylist) (cl-incf x))
@@ -1834,7 +1819,7 @@ of the form
1834where @var{keylist} is a list of key values. If there is exactly 1819where @var{keylist} is a list of key values. If there is exactly
1835one value, and it is not a cons cell or the symbol @code{nil} or 1820one value, and it is not a cons cell or the symbol @code{nil} or
1836@code{t}, then it can be used by itself as a @var{keylist} without 1821@code{t}, then it can be used by itself as a @var{keylist} without
1837being enclosed in a list. All key values in the @code{case} form 1822being enclosed in a list. All key values in the @code{cl-case} form
1838must be distinct. The final clauses may use @code{t} in place of 1823must be distinct. The final clauses may use @code{t} in place of
1839a @var{keylist} to indicate a default clause that should be taken 1824a @var{keylist} to indicate a default clause that should be taken
1840if none of the other clauses match. (The symbol @code{otherwise} 1825if none of the other clauses match. (The symbol @code{otherwise}
@@ -2005,7 +1990,7 @@ evaluated, then each @var{var} is set to the associated @var{step}
2005expression (as if by a @code{cl-psetq} form) and the next iteration 1990expression (as if by a @code{cl-psetq} form) and the next iteration
2006begins. Once the @var{end-test} becomes true, the @var{result} 1991begins. Once the @var{end-test} becomes true, the @var{result}
2007forms are evaluated (with the @var{var}s still bound to their 1992forms are evaluated (with the @var{var}s still bound to their
2008values) to produce the result returned by @code{do}. 1993values) to produce the result returned by @code{cl-do}.
2009 1994
2010The entire @code{cl-do} loop is enclosed in an implicit @code{nil} 1995The entire @code{cl-do} loop is enclosed in an implicit @code{nil}
2011block, so that you can use @code{(cl-return)} to break out of the 1996block, so that you can use @code{(cl-return)} to break out of the
@@ -2013,7 +1998,7 @@ loop at any time.
2013 1998
2014If there are no @var{result} forms, the loop returns @code{nil}. 1999If there are no @var{result} forms, the loop returns @code{nil}.
2015If a given @var{var} has no @var{step} form, it is bound to its 2000If a given @var{var} has no @var{step} form, it is bound to its
2016@var{init} value but not otherwise modified during the @code{do} 2001@var{init} value but not otherwise modified during the @code{cl-do}
2017loop (unless the code explicitly modifies it); this case is just 2002loop (unless the code explicitly modifies it); this case is just
2018a shorthand for putting a @code{(let ((@var{var} @var{init})) @dots{})} 2003a shorthand for putting a @code{(let ((@var{var} @var{init})) @dots{})}
2019around the loop. If @var{init} is also omitted it defaults to 2004around the loop. If @var{init} is also omitted it defaults to
@@ -2105,7 +2090,7 @@ that they are either too simple and limited, such as Common Lisp's
2105obscure, like Common Lisp's @code{do} loop. 2090obscure, like Common Lisp's @code{do} loop.
2106 2091
2107To remedy this, recent versions of Common Lisp have added a new 2092To remedy this, recent versions of Common Lisp have added a new
2108construct called the ``Loop Facility'' or ``@code{loop} macro,'' 2093construct called the ``Loop Facility'' or ``@code{loop} macro'',
2109with an easy-to-use but very powerful and expressive syntax. 2094with an easy-to-use but very powerful and expressive syntax.
2110 2095
2111@menu 2096@menu
@@ -2167,7 +2152,7 @@ them to return a value by using an accumulation clause like
2167@code{collect}, an end-test clause like @code{always}, or an 2152@code{collect}, an end-test clause like @code{always}, or an
2168explicit @code{return} clause to jump out of the implicit block. 2153explicit @code{return} clause to jump out of the implicit block.
2169(Because the loop body is enclosed in an implicit block, you can 2154(Because the loop body is enclosed in an implicit block, you can
2170also use regular Lisp @code{return} or @code{return-from} to 2155also use regular Lisp @code{cl-return} or @code{cl-return-from} to
2171break out of the loop.) 2156break out of the loop.)
2172@end defspec 2157@end defspec
2173 2158
@@ -2191,7 +2176,7 @@ language.
2191 2176
2192@noindent 2177@noindent
2193This loop iterates over all Emacs buffers, using the list 2178This loop iterates over all Emacs buffers, using the list
2194returned by @code{buffer-list}. For each buffer @code{buf}, 2179returned by @code{buffer-list}. For each buffer @var{buf},
2195it calls @code{buffer-file-name} and collects the results into 2180it calls @code{buffer-file-name} and collects the results into
2196a list, which is then returned from the @code{cl-loop} construct. 2181a list, which is then returned from the @code{cl-loop} construct.
2197The result is a list of the file names of all the buffers in 2182The result is a list of the file names of all the buffers in
@@ -2824,6 +2809,7 @@ Of course, @code{return} is generally used inside an @code{if} or
2824the loop would never get to ``loop'' more than once. 2809the loop would never get to ``loop'' more than once.
2825 2810
2826The clause @samp{return @var{form}} is equivalent to 2811The clause @samp{return @var{form}} is equivalent to
2812@c FIXME cl-do, cl-return?
2827@samp{do (return @var{form})} (or @code{return-from} if the loop 2813@samp{do (return @var{form})} (or @code{return-from} if the loop
2828was named). The @code{return} clause is implemented a bit more 2814was named). The @code{return} clause is implemented a bit more
2829efficiently, though. 2815efficiently, though.
@@ -2875,13 +2861,6 @@ It then sets the @var{var}s to these respective values, as if by
2875in @code{cl-multiple-value-bind}. 2861in @code{cl-multiple-value-bind}.
2876@end defspec 2862@end defspec
2877 2863
2878The older Quiroz package attempted a more faithful (but still
2879imperfect) emulation of Common Lisp multiple values. The old
2880method ``usually'' simulated true multiple values quite well,
2881but under certain circumstances would leave spurious return
2882values in memory where a later, unrelated @code{cl-multiple-value-bind}
2883form would see them.
2884
2885Since a perfect emulation is not feasible in Emacs Lisp, this 2864Since a perfect emulation is not feasible in Emacs Lisp, this
2886package opts to keep it as simple and predictable as possible. 2865package opts to keep it as simple and predictable as possible.
2887 2866
@@ -3074,7 +3053,8 @@ and declare it inline all at once.
3074 3053
3075@example 3054@example
3076(cl-declaim (inline foo bar)) 3055(cl-declaim (inline foo bar))
3077(cl-eval-when (compile load eval) (cl-proclaim '(inline foo bar))) 3056(cl-eval-when (compile load eval)
3057 (cl-proclaim '(inline foo bar)))
3078(defsubst foo (...) ...) ; instead of defun 3058(defsubst foo (...) ...) ; instead of defun
3079@end example 3059@end example
3080 3060
@@ -3104,16 +3084,15 @@ The word @code{optimize} is followed by any number of lists like
3104@code{(speed 3)} or @code{(safety 2)}. Common Lisp defines several 3084@code{(speed 3)} or @code{(safety 2)}. Common Lisp defines several
3105optimization ``qualities''; this package ignores all but @code{speed} 3085optimization ``qualities''; this package ignores all but @code{speed}
3106and @code{safety}. The value of a quality should be an integer from 3086and @code{safety}. The value of a quality should be an integer from
31070 to 3, with 0 meaning ``unimportant'' and 3 meaning ``very important.'' 30870 to 3, with 0 meaning ``unimportant'' and 3 meaning ``very important''.
3108The default level for both qualities is 1. 3088The default level for both qualities is 1.
3109 3089
3110In this package, with the optimizing compiler, the 3090In this package, with the optimizing compiler, the
3111@c FIXME does not exist? 3091@code{speed} quality is tied to the @code{byte-optimize}
3112@code{speed} quality is tied to the @code{byte-compile-optimize}
3113flag, which is set to @code{nil} for @code{(speed 0)} and to 3092flag, which is set to @code{nil} for @code{(speed 0)} and to
3114@code{t} for higher settings; and the @code{safety} quality is 3093@code{t} for higher settings; and the @code{safety} quality is
3115tied to the @code{byte-compile-delete-errors} flag, which is 3094tied to the @code{byte-compile-delete-errors} flag, which is
3116set to @code{t} for @code{(safety 3)} and to @code{nil} for all 3095set to @code{nil} for @code{(safety 3)} and to @code{t} for all
3117lower settings. (The latter flag controls whether the compiler 3096lower settings. (The latter flag controls whether the compiler
3118is allowed to optimize out code whose only side-effect could 3097is allowed to optimize out code whose only side-effect could
3119be to signal an error, e.g., rewriting @code{(progn foo bar)} to 3098be to signal an error, e.g., rewriting @code{(progn foo bar)} to
@@ -3138,7 +3117,7 @@ automatically be unset after the enclosing form is done.)
3138This declaration controls what sorts of warnings are generated 3117This declaration controls what sorts of warnings are generated
3139by the byte compiler. Again, only the optimizing compiler 3118by the byte compiler. Again, only the optimizing compiler
3140generates warnings. The word @code{warn} is followed by any 3119generates warnings. The word @code{warn} is followed by any
3141number of ``warning qualities,'' similar in form to optimization 3120number of ``warning qualities'', similar in form to optimization
3142qualities. The currently supported warning types are 3121qualities. The currently supported warning types are
3143@code{redefine}, @code{callargs}, @code{unresolved}, and 3122@code{redefine}, @code{callargs}, @code{unresolved}, and
3144@code{free-vars}; in the current system, a value of 0 will 3123@code{free-vars}; in the current system, a value of 0 will
@@ -3240,10 +3219,6 @@ whereas if it occurs later, this simply uses @code{setcdr} to splice
3240out the property and value cells. 3219out the property and value cells.
3241@end defspec 3220@end defspec
3242 3221
3243@iftex
3244@secno=2
3245@end iftex
3246
3247@node Creating Symbols 3222@node Creating Symbols
3248@section Creating Symbols 3223@section Creating Symbols
3249 3224
@@ -3282,12 +3257,11 @@ exists, the function keeps incrementing the counter and trying
3282again until a new symbol is generated. 3257again until a new symbol is generated.
3283@end defun 3258@end defun
3284 3259
3285The Quiroz @file{cl.el} package also defined a @code{defkeyword} 3260This package automatically creates all keywords that are called for by
3286form for creating self-quoting keyword symbols. This package 3261@code{&key} argument specifiers, and discourages the use of keywords
3287automatically creates all keywords that are called for by 3262as data unrelated to keyword arguments, so the related function
3288@code{&key} argument specifiers, and discourages the use of 3263@code{defkeyword} (to create self-quoting keyword symbols) is not
3289keywords as data unrelated to keyword arguments, so the 3264provided.
3290@code{defkeyword} form has been discontinued.
3291 3265
3292@node Numbers 3266@node Numbers
3293@chapter Numbers 3267@chapter Numbers
@@ -3303,10 +3277,6 @@ which were left out of Emacs Lisp.
3303* Implementation Parameters:: @code{cl-most-positive-float}. 3277* Implementation Parameters:: @code{cl-most-positive-float}.
3304@end menu 3278@end menu
3305 3279
3306@iftex
3307@secno=1
3308@end iftex
3309
3310@node Predicates on Numbers 3280@node Predicates on Numbers
3311@section Predicates on Numbers 3281@section Predicates on Numbers
3312 3282
@@ -3340,10 +3310,6 @@ number. On systems that support floating-point, this is equivalent
3340to @code{floatp}. On other systems, this always returns @code{nil}. 3310to @code{floatp}. On other systems, this always returns @code{nil}.
3341@end defun 3311@end defun
3342 3312
3343@iftex
3344@secno=3
3345@end iftex
3346
3347@node Numerical Functions 3313@node Numerical Functions
3348@section Numerical Functions 3314@section Numerical Functions
3349 3315
@@ -3426,17 +3392,6 @@ This function returns the same value as the second return value
3426of @code{cl-truncate}. 3392of @code{cl-truncate}.
3427@end defun 3393@end defun
3428 3394
3429@c FIXME this stuff is probably no longer of interest to anyone.
3430These definitions are compatible with those in the Quiroz
3431@file{cl.el} package, except that
3432@c this package appends @samp{*} to certain function names to avoid
3433@c conflicts with existing Emacs functions, and that
3434the mechanism for returning multiple values is different.
3435
3436@iftex
3437@secno=8
3438@end iftex
3439
3440@node Random Numbers 3395@node Random Numbers
3441@section Random Numbers 3396@section Random Numbers
3442 3397
@@ -3454,7 +3409,7 @@ The @var{state} argument should be a @code{random-state} object
3454which holds the state of the random number generator. The 3409which holds the state of the random number generator. The
3455function modifies this state object as a side effect. If 3410function modifies this state object as a side effect. If
3456@var{state} is omitted, it defaults to the variable 3411@var{state} is omitted, it defaults to the variable
3457@code{*random-state*}, which contains a pre-initialized 3412@code{cl--random-state}, which contains a pre-initialized
3458@code{random-state} object. 3413@code{random-state} object.
3459@end defun 3414@end defun
3460 3415
@@ -3704,7 +3659,7 @@ just like @code{cl-mapcar}, but it returns a sequence of type
3704@var{result-type} rather than a list. @var{result-type} must 3659@var{result-type} rather than a list. @var{result-type} must
3705be one of the following symbols: @code{vector}, @code{string}, 3660be one of the following symbols: @code{vector}, @code{string},
3706@code{list} (in which case the effect is the same as for 3661@code{list} (in which case the effect is the same as for
3707@code{mapcar*}), or @code{nil} (in which case the results are 3662@code{cl-mapcar}), or @code{nil} (in which case the results are
3708thrown away and @code{cl-map} returns @code{nil}). 3663thrown away and @code{cl-map} returns @code{nil}).
3709@end defun 3664@end defun
3710 3665
@@ -3935,9 +3890,10 @@ by returning a changed copy of the sequence.
3935@findex cl-substitute-if-not 3890@findex cl-substitute-if-not
3936@findex cl-nsubstitute-if 3891@findex cl-nsubstitute-if
3937@findex cl-nsubstitute-if-not 3892@findex cl-nsubstitute-if-not
3938The @code{cl-substitute-if}, @code{cl-substitute-if-not}, @code{cl-nsubstitute-if}, 3893The functions @code{cl-substitute-if}, @code{cl-substitute-if-not},
3939and @code{cl-nsubstitute-if-not} functions are defined similarly. For 3894@code{cl-nsubstitute-if}, and @code{cl-nsubstitute-if-not} are defined
3940these, a @var{predicate} is given in place of the @var{old} argument. 3895similarly. For these, a @var{predicate} is given in place of the
3896@var{old} argument.
3941 3897
3942@node Searching Sequences 3898@node Searching Sequences
3943@section Searching Sequences 3899@section Searching Sequences
@@ -4166,10 +4122,6 @@ specified test. The @code{:key} function, if specified, is
4166applied to the elements of both trees. @xref{Sequences}. 4122applied to the elements of both trees. @xref{Sequences}.
4167@end defun 4123@end defun
4168 4124
4169@iftex
4170@secno=3
4171@end iftex
4172
4173@node Substitution of Expressions 4125@node Substitution of Expressions
4174@section Substitution of Expressions 4126@section Substitution of Expressions
4175 4127
@@ -4405,7 +4357,7 @@ You can create a new @code{person} by calling @code{make-person},
4405which takes keyword arguments @code{:name}, @code{:age}, and 4357which takes keyword arguments @code{:name}, @code{:age}, and
4406@code{:sex} to specify the initial values of these slots in the 4358@code{:sex} to specify the initial values of these slots in the
4407new object. (Omitting any of these arguments leaves the corresponding 4359new object. (Omitting any of these arguments leaves the corresponding
4408slot ``undefined,'' according to the Common Lisp standard; in Emacs 4360slot ``undefined'', according to the Common Lisp standard; in Emacs
4409Lisp, such uninitialized slots are filled with @code{nil}.) 4361Lisp, such uninitialized slots are filled with @code{nil}.)
4410 4362
4411Given a @code{person}, @code{(copy-person @var{p})} makes a new 4363Given a @code{person}, @code{(copy-person @var{p})} makes a new
@@ -4486,10 +4438,6 @@ enclosed in lists.)
4486The following structure options are recognized. 4438The following structure options are recognized.
4487 4439
4488@table @code 4440@table @code
4489@iftex
4490@itemmax=0 in
4491@advance@leftskip-.5@tableindent
4492@end iftex
4493@item :conc-name 4441@item :conc-name
4494The argument is a symbol whose print name is used as the prefix for 4442The argument is a symbol whose print name is used as the prefix for
4495the names of slot accessor functions. The default is the name of 4443the names of slot accessor functions. The default is the name of
@@ -4529,7 +4477,8 @@ option.
4529(cl-defstruct 4477(cl-defstruct
4530 (person 4478 (person
4531 (:constructor nil) ; no default constructor 4479 (:constructor nil) ; no default constructor
4532 (:constructor new-person (name sex &optional (age 0))) 4480 (:constructor new-person
4481 (name sex &optional (age 0)))
4533 (:constructor new-hound (&key (name "Rover") 4482 (:constructor new-hound (&key (name "Rover")
4534 (dog-years 0) 4483 (dog-years 0)
4535 &aux (age (* 7 dog-years)) 4484 &aux (age (* 7 dog-years))
@@ -4540,7 +4489,7 @@ option.
4540The first constructor here takes its arguments positionally rather 4489The first constructor here takes its arguments positionally rather
4541than by keyword. (In official Common Lisp terminology, constructors 4490than by keyword. (In official Common Lisp terminology, constructors
4542that work By Order of Arguments instead of by keyword are called 4491that work By Order of Arguments instead of by keyword are called
4543``BOA constructors.'' No, I'm not making this up.) For example, 4492``BOA constructors''. No, I'm not making this up.) For example,
4544@code{(new-person "Jane" 'female)} generates a person whose slots 4493@code{(new-person "Jane" 'female)} generates a person whose slots
4545are @code{"Jane"}, 0, and @code{female}, respectively. 4494are @code{"Jane"}, 0, and @code{female}, respectively.
4546 4495
@@ -4566,7 +4515,7 @@ ever generated.)
4566 4515
4567In true Common Lisp, @code{typep} is always able to recognize a 4516In true Common Lisp, @code{typep} is always able to recognize a
4568structure object even if @code{:predicate} was used. In this 4517structure object even if @code{:predicate} was used. In this
4569package, @code{typep} simply looks for a function called 4518package, @code{cl-typep} simply looks for a function called
4570@code{@var{typename}-p}, so it will work for structure types 4519@code{@var{typename}-p}, so it will work for structure types
4571only if they used the default predicate name. 4520only if they used the default predicate name.
4572 4521
@@ -4752,18 +4701,6 @@ must be a @var{place} suitable for use by @code{setf}, because
4752user to modify @var{place}. 4701user to modify @var{place}.
4753@end defspec 4702@end defspec
4754 4703
4755The following error-related macro is also defined:
4756
4757@c FIXME standard for some time.
4758@defspec ignore-errors forms@dots{}
4759This executes @var{forms} exactly like a @code{progn}, except that
4760errors are ignored during the @var{forms}. More precisely, if
4761an error is signaled then @code{ignore-errors} immediately
4762aborts execution of the @var{forms} and returns @code{nil}.
4763If the @var{forms} complete successfully, @code{ignore-errors}
4764returns the result of the last @var{form}.
4765@end defspec
4766
4767@node Efficiency Concerns 4704@node Efficiency Concerns
4768@appendix Efficiency Concerns 4705@appendix Efficiency Concerns
4769 4706
@@ -4811,7 +4748,7 @@ This function takes a single Lisp form as an argument and inserts
4811a nicely formatted copy of it in the current buffer (which must be 4748a nicely formatted copy of it in the current buffer (which must be
4812in Lisp mode so that indentation works properly). It also expands 4749in Lisp mode so that indentation works properly). It also expands
4813all Lisp macros which appear in the form. The easiest way to use 4750all Lisp macros which appear in the form. The easiest way to use
4814this function is to go to the @code{*scratch*} buffer and type, say, 4751this function is to go to the @file{*scratch*} buffer and type, say,
4815 4752
4816@example 4753@example
4817(cl-prettyexpand '(loop for x below 10 collect x)) 4754(cl-prettyexpand '(loop for x below 10 collect x))
@@ -4971,110 +4908,6 @@ special, distinct type. Also, the @code{:type} slot option is ignored.
4971 4908
4972The second argument of @code{cl-check-type} is treated differently. 4909The second argument of @code{cl-check-type} is treated differently.
4973 4910
4974@c FIXME Time to remove this?
4975@node Old CL Compatibility
4976@appendix Old CL Compatibility
4977
4978@noindent
4979Following is a list of all known incompatibilities between this package
4980and the older Quiroz @file{cl.el} package.
4981
4982This package's emulation of multiple return values in functions is
4983incompatible with that of the older package. That package attempted
4984to come as close as possible to true Common Lisp multiple return
4985values; unfortunately, it could not be 100% reliable and so was prone
4986to occasional surprises if used freely. This package uses a simpler
4987method, namely replacing multiple values with lists of values, which
4988is more predictable though more noticeably different from Common Lisp.
4989
4990The @code{defkeyword} form and @code{keywordp} function are not
4991implemented in this package.
4992
4993@ignore
4994The @code{member}, @code{floor}, @code{ceiling}, @code{truncate},
4995@code{round}, @code{mod}, and @code{rem} functions are suffixed
4996by @samp{*} in this package to avoid collision with existing
4997functions in Emacs. The older package simply
4998redefined these functions, overwriting the built-in meanings and
4999causing serious portability problems. (Some more
5000recent versions of the Quiroz package changed the names to
5001@code{cl-member}, etc.; this package defines the latter names as
5002aliases for @code{member*}, etc.)
5003@end ignore
5004
5005Certain functions in the old package which were buggy or inconsistent
5006with the Common Lisp standard are incompatible with the conforming
5007versions in this package. For example, @code{eql} and @code{member}
5008were synonyms for @code{eq} and @code{memq} in that package, @code{setf}
5009failed to preserve correct order of evaluation of its arguments, etc.
5010
5011Finally, unlike the older package, this package is careful to
5012prefix all of its internal names with @code{cl--}. Except for a
5013few functions which are explicitly defined as additional features
5014(such as @code{cl-floatp-safe} and @code{letf}), this package does not
5015export any non-@samp{cl-} symbols which are not also part of Common
5016Lisp.
5017
5018@ifinfo
5019@example
5020
5021@end example
5022@end ifinfo
5023@appendixsec The @code{cl-compat} package
5024
5025@noindent
5026The @code{CL} package includes emulations of some features of the
5027old @file{cl.el}, in the form of a compatibility package
5028@code{cl-compat}. This file is obsolete and may be removed in future,
5029so it should not be used in new code.
5030
5031The old package defined a number of internal routines without
5032@code{cl-} prefixes or other annotations. Call to these routines
5033may have crept into existing Lisp code. @code{cl-compat}
5034provides emulations of the following internal routines:
5035@code{pair-with-newsyms}, @code{zip-lists}, @code{unzip-lists},
5036@code{reassemble-arglists}, @code{duplicate-symbols-p},
5037@code{safe-idiv}.
5038
5039Some @code{setf} forms translated into calls to internal
5040functions that user code might call directly. The functions
5041@code{setnth}, @code{setnthcdr}, and @code{setelt} fall in
5042this category; they are defined by @code{cl-compat}, but the
5043best fix is to change to use @code{setf} properly.
5044
5045The @code{cl-compat} file defines the keyword functions
5046@code{keywordp}, @code{keyword-of}, and @code{defkeyword},
5047which are not defined by the new @code{CL} package because the
5048use of keywords as data is discouraged.
5049
5050The @code{build-klist} mechanism for parsing keyword arguments
5051is emulated by @code{cl-compat}; the @code{with-keyword-args}
5052macro is not, however, and in any case it's best to change to
5053use the more natural keyword argument processing offered by
5054@code{defun*}.
5055
5056Multiple return values are treated differently by the two
5057Common Lisp packages. The old package's method was more
5058compatible with true Common Lisp, though it used heuristics
5059that caused it to report spurious multiple return values in
5060certain cases. The @code{cl-compat} package defines a set
5061of multiple-value macros that are compatible with the old
5062CL package; again, they are heuristic in nature, but they
5063are guaranteed to work in any case where the old package's
5064macros worked. To avoid name collision with the ``official''
5065multiple-value facilities, the ones in @code{cl-compat} have
5066capitalized names: @code{Values}, @code{Values-list},
5067@code{Multiple-value-bind}, etc.
5068
5069The functions @code{cl-floor}, @code{cl-ceiling}, @code{cl-truncate},
5070and @code{cl-round} are defined by @code{cl-compat} to use the
5071old-style multiple-value mechanism, just as they did in the old
5072package. The newer @code{floor*} and friends return their two
5073results in a list rather than as multiple values. Note that
5074older versions of the old package used the unadorned names
5075@code{floor}, @code{ceiling}, etc.; @code{cl-compat} cannot use
5076these names because they conflict with Emacs built-ins.
5077
5078@node Porting Common Lisp 4911@node Porting Common Lisp
5079@appendix Porting Common Lisp 4912@appendix Porting Common Lisp
5080 4913
@@ -5135,8 +4968,8 @@ in @code{map-odd-elements} by the time the @code{(+ a x)} function
5135is called. 4968is called.
5136 4969
5137(This package avoids such problems in its own mapping functions 4970(This package avoids such problems in its own mapping functions
5138by using names like @code{cl-x} instead of @code{x} internally; 4971by using names like @code{cl--x} instead of @code{x} internally;
5139as long as you don't use the @code{cl-} prefix for your own 4972as long as you don't use this prefix for your own
5140variables no collision can occur.) 4973variables no collision can occur.)
5141 4974
5142@xref{Lexical Bindings}, for a description of the @code{lexical-let} 4975@xref{Lexical Bindings}, for a description of the @code{lexical-let}
@@ -5181,7 +5014,7 @@ Lisp, they are totally distinct in Emacs Lisp. Common Lisp
5181programs which refer to a symbol by the full name sometimes 5014programs which refer to a symbol by the full name sometimes
5182and the short name other times will not port cleanly to Emacs. 5015and the short name other times will not port cleanly to Emacs.
5183 5016
5184Emacs Lisp does have a concept of ``obarrays,'' which are 5017Emacs Lisp does have a concept of ``obarrays'', which are
5185package-like collections of symbols, but this feature is not 5018package-like collections of symbols, but this feature is not
5186strong enough to be used as a true package mechanism. 5019strong enough to be used as a true package mechanism.
5187 5020
@@ -5201,10 +5034,10 @@ codes provide such features as paragraph filling, case
5201conversion, and even loops and conditionals. 5034conversion, and even loops and conditionals.
5202 5035
5203While it would have been possible to implement most of Common 5036While it would have been possible to implement most of Common
5204Lisp @code{format} in this package (under the name @code{format*}, 5037Lisp @code{format} in this package (under the name @code{cl-format},
5205of course), it was not deemed worthwhile. It would have required 5038of course), it was not deemed worthwhile. It would have required
5206a huge amount of code to implement even a decent subset of 5039a huge amount of code to implement even a decent subset of
5207@code{format*}, yet the functionality it would provide over 5040@code{cl-format}, yet the functionality it would provide over
5208Emacs Lisp's @code{format} would rarely be useful. 5041Emacs Lisp's @code{format} would rarely be useful.
5209 5042
5210@item 5043@item