aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-21 15:42:45 +0000
committerKaroly Lorentey2005-06-21 15:42:45 +0000
commita3fbb8977ddcc3f913058d323af6034cb70561a9 (patch)
treed5b0488432b505d2a36ee2890f8727c8ac7506f5 /lispref
parentef85512e51f043d73788f00a2aed13cccde0682c (diff)
parent0ff13af938126dca16ec0e1e80e3ac38e177e5d3 (diff)
downloademacs-a3fbb8977ddcc3f913058d323af6034cb70561a9.tar.gz
emacs-a3fbb8977ddcc3f913058d323af6034cb70561a9.zip
Merged from miles@gnu.org--gnu-2005 (patch 423-434)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-423 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-424 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425 Remove "-face" suffix from gnus faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-426 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-427 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-428 Remove "-face" suffix from MH-E faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-429 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-430 Remove "-face" suffix from cc-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431 Remove "-face" suffix from eshell faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-432 Remove "-face" suffix from ediff faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-433 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-434 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-351
Diffstat (limited to 'lispref')
-rw-r--r--lispref/ChangeLog74
-rw-r--r--lispref/anti.texi7
-rw-r--r--lispref/backups.texi8
-rw-r--r--lispref/compile.texi2
-rw-r--r--lispref/customize.texi3
-rw-r--r--lispref/debugging.texi15
-rw-r--r--lispref/display.texi31
-rw-r--r--lispref/edebug.texi54
-rw-r--r--lispref/elisp.texi10
-rw-r--r--lispref/errors.texi2
-rw-r--r--lispref/files.texi10
-rw-r--r--lispref/frames.texi18
-rw-r--r--lispref/functions.texi37
-rw-r--r--lispref/help.texi18
-rw-r--r--lispref/keymaps.texi8
-rw-r--r--lispref/lists.texi91
-rw-r--r--lispref/minibuf.texi141
-rw-r--r--lispref/modes.texi11
-rw-r--r--lispref/nonascii.texi16
-rw-r--r--lispref/os.texi18
-rw-r--r--lispref/processes.texi425
-rw-r--r--lispref/searching.texi36
-rw-r--r--lispref/strings.texi7
-rw-r--r--lispref/syntax.texi9
-rw-r--r--lispref/text.texi32
-rw-r--r--lispref/variables.texi84
26 files changed, 868 insertions, 299 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index c565e8bdb5f..50bfc91479f 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,75 @@
12005-06-19 Luc Teirlinck <teirllm@auburn.edu>
2
3 * lists.texi (Rings): Various minor clarifications and corrections.
4
52005-06-18 Richard M. Stallman <rms@gnu.org>
6
7 * functions.texi (Obsolete Functions): Simplify.
8
9 * variables.texi (Variable Aliases): Simplify.
10
11 * anti.texi, backups.texi, compile.texi, customization.texi:
12 * debugging.texi, display.texi, edebug.texi, errors.texi, frames.texi:
13 * functions.texi, help.texi, keymaps.texi, modes.texi, nonascii.texi:
14 * os.texi, processes.texi, searching.texi, strings.texi, text.texi:
15 * variables.texi: Fix formatting ugliness.
16
17 * elisp.texi: Add links to Rings and Byte Packing.
18 Update version and copyright years.
19
20 * minibuf.texi: Fix formatting ugliness.
21 (Completion Commands): Move keymap vars to the end
22 and vars completing-read binds to the top.
23
242005-06-17 Luc Teirlinck <teirllm@auburn.edu>
25
26 * processes.texi: Fix typos.
27 (Bindat Spec): Correct Texinfo error.
28 (Byte Packing): Fix ungrammatical sentence.
29
302005-06-17 Thien-Thi Nguyen <ttn@gnu.org>
31
32 * lists.texi (Rings): New node.
33 (Lists): Add it to menu.
34
35 * processes.texi (Byte Packing): New node.
36 (Processes): Add it to menu.
37
382005-06-17 Richard M. Stallman <rms@gnu.org>
39
40 * syntax.texi (Parsing Expressions): Fix texinfo usage.
41
42 * help.texi (Documentation Basics): Explain the xref to
43 Documentation Tips.
44
45 * debugging.texi (Debugger Commands): Minor fix.
46
472005-06-16 Luc Teirlinck <teirllm@auburn.edu>
48
49 * edebug.texi (Instrumenting): Eliminate duplicate link.
50 (Specification List): Replace references to "below", referring to
51 a later node, with one @ref to that node.
52
53 * os.texi (Timers): Timers should save and restore the match data
54 if they change it.
55
56 * debugging.texi (Debugger Commands): Mention that the Lisp
57 debugger can not step through primitive functions.
58
592005-06-16 Juanma Barranquero <lekktu@gmail.com>
60
61 * functions.texi (Obsolete Functions): Update argument names of
62 `make-obsolete' and `define-obsolete-function-alias'.
63
64 * variables.texi (Variable Aliases): Update argument names of
65 `defvaralias', `make-obsolete-variable' and
66 `define-obsolete-variable-alias'.
67
682005-06-15 Kim F. Storm <storm@cua.dk>
69
70 * searching.texi (Entire Match Data): Rephrase warnings about
71 evaporate arg to match-data and set-match-data.
72
12005-06-14 Luc Teirlinck <teirllm@auburn.edu> 732005-06-14 Luc Teirlinck <teirllm@auburn.edu>
2 74
3 * elisp.texi (Top): Update detailed menu. 75 * elisp.texi (Top): Update detailed menu.
@@ -50,7 +122,7 @@
50 122
512005-06-10 Luc Teirlinck <teirllm@auburn.edu> 1232005-06-10 Luc Teirlinck <teirllm@auburn.edu>
52 124
53 * syntax.texi (Parsing Exprssions): Fix Texinfo error. 125 * syntax.texi (Parsing Expressions): Fix Texinfo error.
54 126
552005-06-10 Stefan Monnier <monnier@iro.umontreal.ca> 1272005-06-10 Stefan Monnier <monnier@iro.umontreal.ca>
56 128
diff --git a/lispref/anti.texi b/lispref/anti.texi
index 46375f3f157..c7a72f04df8 100644
--- a/lispref/anti.texi
+++ b/lispref/anti.texi
@@ -164,9 +164,10 @@ the sentinel.
164@item 164@item
165Many programming shortcuts have been deleted, to provide you with the 165Many programming shortcuts have been deleted, to provide you with the
166enjoyment of ``rolling your own''. The macros @code{while-no-input}, 166enjoyment of ``rolling your own''. The macros @code{while-no-input},
167@code{with-local-quit}, @code{with-selected-window}, 167@code{with-local-quit}, and @code{with-selected-window}, along with
168@code{dynamic-completion-table}, and @code{lazy-completion-table} no 168@code{dynamic-completion-table} and @code{lazy-completion-table} no
169longer exist. Also, there are no built-in progress reporters. 169longer exist. Also, there are no built-in progress reporters;
170with Emacs, you can take progress for granted.
170 171
171@item 172@item
172Variable aliases are no longer supported. Aliases are for functions, 173Variable aliases are no longer supported. Aliases are for functions,
diff --git a/lispref/backups.texi b/lispref/backups.texi
index 8db24665a54..1ba7ed1b931 100644
--- a/lispref/backups.texi
+++ b/lispref/backups.texi
@@ -589,10 +589,10 @@ This function auto-saves all buffers that need to be auto-saved. It
589saves all buffers for which auto-saving is enabled and that have been 589saves all buffers for which auto-saving is enabled and that have been
590changed since the previous auto-save. 590changed since the previous auto-save.
591 591
592Normally, if any buffers are auto-saved, a message that says 592If any buffers are auto-saved, @code{do-auto-save} normally displays a
593@samp{Auto-saving...} is displayed in the echo area while auto-saving is 593message saying @samp{Auto-saving...} in the echo area while
594going on. However, if @var{no-message} is non-@code{nil}, the message 594auto-saving is going on. However, if @var{no-message} is
595is inhibited. 595non-@code{nil}, the message is inhibited.
596 596
597If @var{current-only} is non-@code{nil}, only the current buffer 597If @var{current-only} is non-@code{nil}, only the current buffer
598is auto-saved. 598is auto-saved.
diff --git a/lispref/compile.texi b/lispref/compile.texi
index 91c0661a99e..951a090e0da 100644
--- a/lispref/compile.texi
+++ b/lispref/compile.texi
@@ -426,7 +426,7 @@ to what @code{eval-when-compile} does.
426@section Compiler Errors 426@section Compiler Errors
427@cindex compiler errors 427@cindex compiler errors
428 428
429 Byte compilation writes errors and warnings into the buffer 429 Byte compilation outputs all errors and warnings into the buffer
430@samp{*Compile-Log*}. The messages include file names and line 430@samp{*Compile-Log*}. The messages include file names and line
431numbers that identify the location of the problem. The usual Emacs 431numbers that identify the location of the problem. The usual Emacs
432commands for operating on compiler diagnostics work properly on 432commands for operating on compiler diagnostics work properly on
diff --git a/lispref/customize.texi b/lispref/customize.texi
index 53c9fa92c32..baaceae47f0 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -658,7 +658,8 @@ means you should always list the most specific types first, and the
658most general last. Here's an example of proper usage: 658most general last. Here's an example of proper usage:
659 659
660@example 660@example
661(choice (const :tag "Off" nil) symbol (sexp :tag "Other")) 661(choice (const :tag "Off" nil)
662 symbol (sexp :tag "Other"))
662@end example 663@end example
663 664
664@noindent 665@noindent
diff --git a/lispref/debugging.texi b/lispref/debugging.texi
index 739dd1fe298..66663aad131 100644
--- a/lispref/debugging.texi
+++ b/lispref/debugging.texi
@@ -350,7 +350,8 @@ structures of an interpreted function, but cannot do so in a
350byte-compiled function. If you would like to step through a 350byte-compiled function. If you would like to step through a
351byte-compiled function, replace it with an interpreted definition of 351byte-compiled function, replace it with an interpreted definition of
352the same function. (To do this, visit the source for the function and 352the same function. (To do this, visit the source for the function and
353type @kbd{C-M-x} on its definition.) 353type @kbd{C-M-x} on its definition.) You cannot use the Lisp debugger
354to step through a primitive function.
354 355
355 Here is a list of Debugger mode commands: 356 Here is a list of Debugger mode commands:
356 357
@@ -470,15 +471,15 @@ entered--entering a function:} as a line of text at the top of the
470buffer. 471buffer.
471 472
472@item debug 473@item debug
473@code{debug} as first argument indicates a call to @code{debug} 474@code{debug} as first argument means @code{debug} was called because
474because of entry to a function that was set to debug on entry. The 475of entry to a function that was set to debug on entry. The debugger
475debugger displays @samp{Debugger entered--entering a function:}, just 476displays the string @samp{Debugger entered--entering a function:},
476as in the @code{lambda} case. It also marks the stack frame for that 477just as in the @code{lambda} case. It also marks the stack frame for
477function so that it will invoke the debugger when exited. 478that function so that it will invoke the debugger when exited.
478 479
479@item t 480@item t
480When the first argument is @code{t}, this indicates a call to 481When the first argument is @code{t}, this indicates a call to
481@code{debug} due to evaluation of a list form when 482@code{debug} due to evaluation of a function call form when
482@code{debug-on-next-call} is non-@code{nil}. The debugger displays 483@code{debug-on-next-call} is non-@code{nil}. The debugger displays
483@samp{Debugger entered--beginning evaluation of function call form:} 484@samp{Debugger entered--beginning evaluation of function call form:}
484as the top line in the buffer. 485as the top line in the buffer.
diff --git a/lispref/display.texi b/lispref/display.texi
index 87520fb4d4f..930f8aa31bc 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -547,15 +547,15 @@ remaining time and clearly see that Emacs is busy working, not hung.
547reporting operation progress. Here is a working example that does 547reporting operation progress. Here is a working example that does
548nothing useful: 548nothing useful:
549 549
550@example 550@smallexample
551(let ((progress-reporter 551(let ((progress-reporter
552 (make-progress-reporter "Collecting some mana for Emacs..." 552 (make-progress-reporter "Collecting mana for Emacs..."
553 0 500))) 553 0 500)))
554 (dotimes (k 500) 554 (dotimes (k 500)
555 (sit-for 0.01) 555 (sit-for 0.01)
556 (progress-reporter-update progress-reporter k)) 556 (progress-reporter-update progress-reporter k))
557 (progress-reporter-done progress-reporter)) 557 (progress-reporter-done progress-reporter))
558@end example 558@end smallexample
559 559
560@defun make-progress-reporter message min-value max-value &optional current-value min-change min-time 560@defun make-progress-reporter message min-value max-value &optional current-value min-change min-time
561This function creates and returns a @dfn{progress reporter}---an 561This function creates and returns a @dfn{progress reporter}---an
@@ -1296,8 +1296,8 @@ A cons cell of the form @code{(foreground-color . @var{color-name})} or
1296@code{(background-color . @var{color-name})}. These elements specify 1296@code{(background-color . @var{color-name})}. These elements specify
1297just the foreground color or just the background color. 1297just the foreground color or just the background color.
1298 1298
1299@code{(foreground-color . @var{color-name})} is equivalent to 1299@code{(foreground-color . @var{color-name})} has the same effect as
1300@code{(:foreground @var{color-name})}, and likewise for the background. 1300@code{(:foreground @var{color-name})}; likewise for the background.
1301@end itemize 1301@end itemize
1302 1302
1303@item mouse-face 1303@item mouse-face
@@ -2757,10 +2757,9 @@ For instance, this changes the default fontset to use a font of which
2757registry name is @samp{JISX0208.1983} for all characters belonging to 2757registry name is @samp{JISX0208.1983} for all characters belonging to
2758the charset @code{japanese-jisx0208}. 2758the charset @code{japanese-jisx0208}.
2759 2759
2760@example 2760@smallexample
2761(set-fontset-font nil 'japanese-jisx0208 '(nil . "JISX0208.1983")) 2761(set-fontset-font nil 'japanese-jisx0208 '(nil . "JISX0208.1983"))
2762@end example 2762@end smallexample
2763
2764@end defun 2763@end defun
2765 2764
2766@defun char-displayable-p char 2765@defun char-displayable-p char
@@ -3137,7 +3136,7 @@ single unit. By contrast, characters that have similar but distinct
3137Lisp objects as their @code{display} properties are handled 3136Lisp objects as their @code{display} properties are handled
3138separately. Here's a function that illustrates this point: 3137separately. Here's a function that illustrates this point:
3139 3138
3140@example 3139@smallexample
3141(defun foo () 3140(defun foo ()
3142 (goto-char (point-min)) 3141 (goto-char (point-min))
3143 (dotimes (i 5) 3142 (dotimes (i 5)
@@ -3146,7 +3145,7 @@ separately. Here's a function that illustrates this point:
3146 (forward-char 1) 3145 (forward-char 1)
3147 (put-text-property (point) (1+ (point)) 'display string) 3146 (put-text-property (point) (1+ (point)) 'display string)
3148 (forward-char 1)))) 3147 (forward-char 1))))
3149@end example 3148@end smallexample
3150 3149
3151@noindent 3150@noindent
3152It gives each of the first ten characters in the buffer string 3151It gives each of the first ten characters in the buffer string
@@ -3158,7 +3157,7 @@ Likewise for each following pair of characters. Thus, the ten
3158characters appear as five A's. This function would have the same 3157characters appear as five A's. This function would have the same
3159results: 3158results:
3160 3159
3161@example 3160@smallexample
3162(defun foo () 3161(defun foo ()
3163 (goto-char (point-min)) 3162 (goto-char (point-min))
3164 (dotimes (i 5) 3163 (dotimes (i 5)
@@ -3166,7 +3165,7 @@ results:
3166 (put-text-property (point) (2+ (point)) 'display string) 3165 (put-text-property (point) (2+ (point)) 'display string)
3167 (put-text-property (point) (1+ (point)) 'display string) 3166 (put-text-property (point) (1+ (point)) 'display string)
3168 (forward-char 2)))) 3167 (forward-char 2))))
3169@end example 3168@end smallexample
3170 3169
3171@noindent 3170@noindent
3172This illustrates that what matters is the property value for 3171This illustrates that what matters is the property value for
@@ -3262,18 +3261,20 @@ as an absolute number of pixels.
3262 3261
3263 The following expressions are supported: 3262 The following expressions are supported:
3264 3263
3265@example 3264@smallexample
3266@group 3265@group
3267 @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | @var{image} | @var{form} 3266 @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | @var{image} | @var{form}
3268 @var{num} ::= @var{integer} | @var{float} | @var{symbol} 3267 @var{num} ::= @var{integer} | @var{float} | @var{symbol}
3269 @var{unit} ::= in | mm | cm | width | height 3268 @var{unit} ::= in | mm | cm | width | height
3269@end group
3270@group
3270 @var{elem} ::= left-fringe | right-fringe | left-margin | right-margin 3271 @var{elem} ::= left-fringe | right-fringe | left-margin | right-margin
3271 | scroll-bar | text 3272 | scroll-bar | text
3272 @var{pos} ::= left | center | right 3273 @var{pos} ::= left | center | right
3273 @var{form} ::= (@var{num} . @var{expr}) | (@var{op} @var{expr} ...) 3274 @var{form} ::= (@var{num} . @var{expr}) | (@var{op} @var{expr} ...)
3274 @var{op} ::= + | - 3275 @var{op} ::= + | -
3275@end group 3276@end group
3276@end example 3277@end smallexample
3277 3278
3278 The form @var{num} specifies a fraction of the default frame font 3279 The form @var{num} specifies a fraction of the default frame font
3279height or width. The form @code{(@var{num})} specifies an absolute 3280height or width. The form @code{(@var{num})} specifies an absolute
@@ -3331,7 +3332,7 @@ in the @code{display} text property.
3331Display @var{string} instead of the text that has this property. 3332Display @var{string} instead of the text that has this property.
3332 3333
3333@item (image . @var{image-props}) 3334@item (image . @var{image-props})
3334This display specification is an image descriptor (@pxref{Images}). 3335This kind of display specification is an image descriptor (@pxref{Images}).
3335When used as a display specification, it means to display the image 3336When used as a display specification, it means to display the image
3336instead of the text that has the display specification. 3337instead of the text that has the display specification.
3337 3338
diff --git a/lispref/edebug.texi b/lispref/edebug.texi
index 981afbb894c..f074cf3dbd5 100644
--- a/lispref/edebug.texi
+++ b/lispref/edebug.texi
@@ -203,14 +203,13 @@ function.
203@code{interactive} forms with an expression argument, anonymous lambda 203@code{interactive} forms with an expression argument, anonymous lambda
204expressions, and other defining forms. However, Edebug cannot determine 204expressions, and other defining forms. However, Edebug cannot determine
205on its own what a user-defined macro will do with the arguments of a 205on its own what a user-defined macro will do with the arguments of a
206macro call, so you must provide that information; see @ref{Edebug and 206macro call, so you must provide that information using Edebug
207Macros}, for details. 207specifications; see @ref{Edebug and Macros}, for details.
208 208
209 When Edebug is about to instrument code for the first time in a 209 When Edebug is about to instrument code for the first time in a
210session, it runs the hook @code{edebug-setup-hook}, then sets it to 210session, it runs the hook @code{edebug-setup-hook}, then sets it to
211@code{nil}. You can use this to load Edebug specifications 211@code{nil}. You can use this to load Edebug specifications
212(@pxref{Edebug and Macros}) associated with a package you are 212associated with a package you are using, but only when you use Edebug.
213using, but only when you use Edebug.
214 213
215@findex eval-expression @r{(Edebug)} 214@findex eval-expression @r{(Edebug)}
216 To remove instrumentation from a definition, simply re-evaluate its 215 To remove instrumentation from a definition, simply re-evaluate its
@@ -331,7 +330,7 @@ program to stop.
331Proceed to the stop point near where point is (@code{edebug-goto-here}). 330Proceed to the stop point near where point is (@code{edebug-goto-here}).
332 331
333@item f 332@item f
334Run the program forward over one expression 333Run the program for one expression
335(@code{edebug-forward-sexp}). 334(@code{edebug-forward-sexp}).
336 335
337@item o 336@item o
@@ -463,9 +462,9 @@ point (@code{edebug-unset-breakpoint}).
463 462
464@item x @var{condition} @key{RET} 463@item x @var{condition} @key{RET}
465Set a conditional breakpoint which stops the program only if 464Set a conditional breakpoint which stops the program only if
466@var{condition} evaluates to a non-@code{nil} value 465evaluating @var{condition} produces a non-@code{nil} value
467(@code{edebug-set-conditional-breakpoint}). With a prefix argument, the 466(@code{edebug-set-conditional-breakpoint}). With a prefix argument,
468breakpoint is temporary. 467the breakpoint is temporary.
469 468
470@item B 469@item B
471Move point to the next breakpoint in the current definition 470Move point to the next breakpoint in the current definition
@@ -586,8 +585,8 @@ effect outside of Edebug.
586 585
587@table @kbd 586@table @kbd
588@item v 587@item v
589View the outside window configuration (@code{edebug-view-outside}). 588Switch to viewing the outside window configuration
590Type @kbd{C-x X w} to return to Edebug. 589(@code{edebug-view-outside}). Type @kbd{C-x X w} to return to Edebug.
591 590
592@item p 591@item p
593Temporarily display the outside current buffer with point at its 592Temporarily display the outside current buffer with point at its
@@ -1036,11 +1035,12 @@ saves (and later restores) these additional data:
1036The current match data. @xref{Match Data}. 1035The current match data. @xref{Match Data}.
1037 1036
1038@item 1037@item
1039@code{last-command}, @code{this-command}, @code{last-command-char}, 1038The variables @code{last-command}, @code{this-command},
1040@code{last-input-char}, @code{last-input-event}, 1039@code{last-command-char}, @code{last-input-char},
1041@code{last-command-event}, @code{last-event-frame}, 1040@code{last-input-event}, @code{last-command-event},
1042@code{last-nonmenu-event}, and @code{track-mouse}. Commands used within 1041@code{last-event-frame}, @code{last-nonmenu-event}, and
1043Edebug do not affect these variables outside of Edebug. 1042@code{track-mouse}. Commands used within Edebug do not affect these
1043variables outside of Edebug.
1044 1044
1045The key sequence returned by @code{this-command-keys} is changed by 1045The key sequence returned by @code{this-command-keys} is changed by
1046executing commands within Edebug and there is no way to reset 1046executing commands within Edebug and there is no way to reset
@@ -1100,13 +1100,13 @@ macro. To do this, add a @code{debug} declaration to the macro
1100definition. Here is a simple example that shows the specification for 1100definition. Here is a simple example that shows the specification for
1101the @code{for} example macro (@pxref{Argument Evaluation}). 1101the @code{for} example macro (@pxref{Argument Evaluation}).
1102 1102
1103@example 1103@smallexample
1104(defmacro for (var from init to final do &rest body) 1104(defmacro for (var from init to final do &rest body)
1105 "Execute a simple \"for\" loop. 1105 "Execute a simple \"for\" loop.
1106For example, (for i from 1 to 10 do (print i))." 1106For example, (for i from 1 to 10 do (print i))."
1107 (declare (debug (symbolp "from" form "to" form "do" &rest form))) 1107 (declare (debug (symbolp "from" form "to" form "do" &rest form)))
1108 ...) 1108 ...)
1109@end example 1109@end smallexample
1110 1110
1111 The Edebug specification says which parts of a call to the macro are 1111 The Edebug specification says which parts of a call to the macro are
1112forms to be evaluated. For simple macros, the @var{specification} 1112forms to be evaluated. For simple macros, the @var{specification}
@@ -1185,7 +1185,8 @@ balanced parentheses, recursive processing of forms, and recursion via
1185indirect specifications. 1185indirect specifications.
1186 1186
1187Here's a table of the possible elements of a specification list, with 1187Here's a table of the possible elements of a specification list, with
1188their meanings: 1188their meanings (see @ref{Specification Examples}, for the referenced
1189examples):
1189 1190
1190@table @code 1191@table @code
1191@item sexp 1192@item sexp
@@ -1221,7 +1222,7 @@ as one does not match, Edebug stops matching at this level.
1221To make just a few elements optional followed by non-optional elements, 1222To make just a few elements optional followed by non-optional elements,
1222use @code{[&optional @var{specs}@dots{}]}. To specify that several 1223use @code{[&optional @var{specs}@dots{}]}. To specify that several
1223elements must all match or none, use @code{&optional 1224elements must all match or none, use @code{&optional
1224[@var{specs}@dots{}]}. See the @code{defun} example below. 1225[@var{specs}@dots{}]}. See the @code{defun} example.
1225 1226
1226@item &rest 1227@item &rest
1227@c @kindex &rest @r{(Edebug)} 1228@c @kindex &rest @r{(Edebug)}
@@ -1262,15 +1263,14 @@ a list specification.
1262@item nil 1263@item nil
1263This is successful when there are no more arguments to match at the 1264This is successful when there are no more arguments to match at the
1264current argument list level; otherwise it fails. See sublist 1265current argument list level; otherwise it fails. See sublist
1265specifications and the backquote example below. 1266specifications and the backquote example.
1266 1267
1267@item gate 1268@item gate
1268@cindex preventing backtracking 1269@cindex preventing backtracking
1269No argument is matched but backtracking through the gate is disabled 1270No argument is matched but backtracking through the gate is disabled
1270while matching the remainder of the specifications at this level. This 1271while matching the remainder of the specifications at this level. This
1271is primarily used to generate more specific syntax error messages. See 1272is primarily used to generate more specific syntax error messages. See
1272@ref{Backtracking}, for more details. Also see the @code{let} example 1273@ref{Backtracking}, for more details. Also see the @code{let} example.
1273below.
1274 1274
1275@item @var{other-symbol} 1275@item @var{other-symbol}
1276@cindex indirect specifications 1276@cindex indirect specifications
@@ -1281,7 +1281,7 @@ If the symbol has an Edebug specification, this @dfn{indirect
1281specification} should be either a list specification that is used in 1281specification} should be either a list specification that is used in
1282place of the symbol, or a function that is called to process the 1282place of the symbol, or a function that is called to process the
1283arguments. The specification may be defined with @code{def-edebug-spec} 1283arguments. The specification may be defined with @code{def-edebug-spec}
1284just as for macros. See the @code{defun} example below. 1284just as for macros. See the @code{defun} example.
1285 1285
1286Otherwise, the symbol should be a predicate. The predicate is called 1286Otherwise, the symbol should be a predicate. The predicate is called
1287with the argument and the specification fails if the predicate returns 1287with the argument and the specification fails if the predicate returns
@@ -1302,7 +1302,7 @@ of @var{symbol} is the @var{string}, but the string form is preferred.
1302 1302
1303@item (vector @var{elements}@dots{}) 1303@item (vector @var{elements}@dots{})
1304The argument should be a vector whose elements must match the 1304The argument should be a vector whose elements must match the
1305@var{elements} in the specification. See the backquote example below. 1305@var{elements} in the specification. See the backquote example.
1306 1306
1307@item (@var{elements}@dots{}) 1307@item (@var{elements}@dots{})
1308Any other list is a @dfn{sublist specification} and the argument must be 1308Any other list is a @dfn{sublist specification} and the argument must be
@@ -1315,7 +1315,7 @@ dotted list specification may be another sublist specification (via a
1315grouping or an indirect specification, e.g., @code{(spec . [(more 1315grouping or an indirect specification, e.g., @code{(spec . [(more
1316specs@dots{})])}) whose elements match the non-dotted list arguments. 1316specs@dots{})])}) whose elements match the non-dotted list arguments.
1317This is useful in recursive specifications such as in the backquote 1317This is useful in recursive specifications such as in the backquote
1318example below. Also see the description of a @code{nil} specification 1318example. Also see the description of a @code{nil} specification
1319above for terminating such recursion. 1319above for terminating such recursion.
1320 1320
1321Note that a sublist specification written as @code{(specs . nil)} 1321Note that a sublist specification written as @code{(specs . nil)}
@@ -1327,7 +1327,7 @@ sublist-elements@dots{})}.
1327@c Need to document extensions with &symbol and :symbol 1327@c Need to document extensions with &symbol and :symbol
1328 1328
1329Here is a list of additional specifications that may appear only after 1329Here is a list of additional specifications that may appear only after
1330@code{&define}. See the @code{defun} example below. 1330@code{&define}. See the @code{defun} example.
1331 1331
1332@table @code 1332@table @code
1333@item name 1333@item name
@@ -1364,7 +1364,7 @@ The argument is a single, highest-level form in a definition. This is
1364like @code{def-body}, except use this to match a single form rather than 1364like @code{def-body}, except use this to match a single form rather than
1365a list of forms. As a special case, @code{def-form} also means that 1365a list of forms. As a special case, @code{def-form} also means that
1366tracing information is not output when the form is executed. See the 1366tracing information is not output when the form is executed. See the
1367@code{interactive} example below. 1367@code{interactive} example.
1368@end table 1368@end table
1369 1369
1370@node Backtracking 1370@node Backtracking
diff --git a/lispref/elisp.texi b/lispref/elisp.texi
index 4be680969a1..0a4849c236b 100644
--- a/lispref/elisp.texi
+++ b/lispref/elisp.texi
@@ -6,7 +6,7 @@
6 6
7@c Version of the manual and of Emacs. 7@c Version of the manual and of Emacs.
8@c Please remember to update the edition number in README as well. 8@c Please remember to update the edition number in README as well.
9@set VERSION 2.9 9@set VERSION 2.7
10@set EMACSVER 22.0.50 10@set EMACSVER 22.0.50
11 11
12@dircategory Emacs 12@dircategory Emacs
@@ -34,8 +34,8 @@ Published by the Free Software Foundation
3459 Temple Place, Suite 330 3459 Temple Place, Suite 330
35Boston, MA 02111-1307 USA 35Boston, MA 02111-1307 USA
36 36
37Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2005,@* 37Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, @*
38 2000, 2002 Free Software Foundation, Inc. 38 2000, 2002, 2003, 2004, 2005, Free Software Foundation, Inc.
39 39
40Permission is granted to copy, distribute and/or modify this document 40Permission is granted to copy, distribute and/or modify this document
41under the terms of the GNU Free Documentation License, Version 1.1 or 41under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -60,7 +60,7 @@ Software Foundation raise funds for GNU development.''
60@page 60@page
61@vskip 0pt plus 1filll 61@vskip 0pt plus 1filll
62Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@* 62Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,@*
631999, 2000, 2002 Free Software Foundation, Inc. 631999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
64 64
65@sp 2 65@sp 2
66Edition @value{VERSION} @* 66Edition @value{VERSION} @*
@@ -288,6 +288,7 @@ Lists
288* Modifying Lists:: Storing new pieces into an existing list. 288* Modifying Lists:: Storing new pieces into an existing list.
289* Sets And Lists:: A list can represent a finite mathematical set. 289* Sets And Lists:: A list can represent a finite mathematical set.
290* Association Lists:: A list can represent a finite relation or mapping. 290* Association Lists:: A list can represent a finite relation or mapping.
291* Rings:: Managing a fixed-size ring of objects.
291 292
292Modifying Existing List Structure 293Modifying Existing List Structure
293 294
@@ -983,6 +984,7 @@ Processes
983* Datagrams:: UDP network connections. 984* Datagrams:: UDP network connections.
984* Low-Level Network:: Lower-level but more general function 985* Low-Level Network:: Lower-level but more general function
985 to create connections and servers. 986 to create connections and servers.
987* Byte Packing:: Using bindat to pack and unpack binary data.
986 988
987Receiving Output from Processes 989Receiving Output from Processes
988 990
diff --git a/lispref/errors.texi b/lispref/errors.texi
index 8591fb9a45f..a246539b8fd 100644
--- a/lispref/errors.texi
+++ b/lispref/errors.texi
@@ -63,7 +63,7 @@ See @code{/} and @code{%} in @ref{Numbers}.
63@xref{Function Indirection}. 63@xref{Function Indirection}.
64 64
65@item cyclic-variable-indirection 65@item cyclic-variable-indirection
66@code{"Symbol's chain of variable indirections contains a loop"}@* 66@code{"Symbol's chain of variable indirections\@* contains a loop"}@*
67@xref{Variable Aliases}. 67@xref{Variable Aliases}.
68 68
69@item end-of-buffer 69@item end-of-buffer
diff --git a/lispref/files.texi b/lispref/files.texi
index 766220aa882..93c104e6ccd 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -98,9 +98,9 @@ new buffer and reading the file into it. It also returns that buffer.
98Aside from some technical details, the body of the @code{find-file} 98Aside from some technical details, the body of the @code{find-file}
99function is basically equivalent to: 99function is basically equivalent to:
100 100
101@example 101@smallexample
102(switch-to-buffer (find-file-noselect filename nil nil wildcards)) 102(switch-to-buffer (find-file-noselect filename nil nil wildcards))
103@end example 103@end smallexample
104 104
105@noindent 105@noindent
106(See @code{switch-to-buffer} in @ref{Displaying Buffers}.) 106(See @code{switch-to-buffer} in @ref{Displaying Buffers}.)
@@ -2731,9 +2731,9 @@ This function tests whether @var{filename} is a remote file. If
2731If @var{filename} is indeed remote, the return value is a string that 2731If @var{filename} is indeed remote, the return value is a string that
2732identifies the remote system. 2732identifies the remote system.
2733 2733
2734This identifier string may include a host name, a user name, and 2734This identifier string can include a host name and a user name, as
2735characters designating the method used to access the remote system. 2735well as characters designating the method used to access the remote
2736For example, the remote identifier string for the filename 2736system. For example, the remote identifier string for the filename
2737@code{/ssh:user@@host:/some/file} is @code{/ssh:user@@host:}. 2737@code{/ssh:user@@host:/some/file} is @code{/ssh:user@@host:}.
2738 2738
2739If @code{file-remote-p} returns the same identifier for two different 2739If @code{file-remote-p} returns the same identifier for two different
diff --git a/lispref/frames.texi b/lispref/frames.texi
index ffcc16f6289..10035b76f9f 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -1550,13 +1550,13 @@ clients. It takes two optional arguments, @var{type} and
1550The @var{data-type} argument specifies the form of data conversion to 1550The @var{data-type} argument specifies the form of data conversion to
1551use, to convert the raw data obtained from another X client into Lisp 1551use, to convert the raw data obtained from another X client into Lisp
1552data. Meaningful values include @code{TEXT}, @code{STRING}, 1552data. Meaningful values include @code{TEXT}, @code{STRING},
1553@code{UTF8_STRING}, 1553@code{UTF8_STRING}, @code{TARGETS}, @code{LENGTH}, @code{DELETE},
1554@code{TARGETS}, @code{LENGTH}, @code{DELETE}, @code{FILE_NAME}, 1554@code{FILE_NAME}, @code{CHARACTER_POSITION}, @code{NAME},
1555@code{CHARACTER_POSITION}, @code{LINE_NUMBER}, @code{COLUMN_NUMBER}, 1555@code{LINE_NUMBER}, @code{COLUMN_NUMBER}, @code{OWNER_OS},
1556@code{OWNER_OS}, @code{HOST_NAME}, @code{USER}, @code{CLASS}, 1556@code{HOST_NAME}, @code{USER}, @code{CLASS}, @code{ATOM}, and
1557@code{NAME}, @code{ATOM}, and @code{INTEGER}. (These are symbols with 1557@code{INTEGER}. (These are symbols with upper-case names in accord
1558upper-case names in accord with X conventions.) The default for 1558with X conventions.) The default for @var{data-type} is
1559@var{data-type} is @code{STRING}. 1559@code{STRING}.
1560@end defun 1560@end defun
1561 1561
1562@cindex cut buffer 1562@cindex cut buffer
@@ -1822,8 +1822,8 @@ xterm.vt100.background: yellow
1822@end example 1822@end example
1823 1823
1824@noindent 1824@noindent
1825in in your X resources file (usually named @file{~/.Xdefaults} or 1825in in your X resources file (whose name is usually @file{~/.Xdefaults}
1826@file{~/.Xresources}). Then: 1826or @file{~/.Xresources}). Then:
1827 1827
1828@example 1828@example
1829@group 1829@group
diff --git a/lispref/functions.texi b/lispref/functions.texi
index bcdfc95cc1c..f58cad69bb7 100644
--- a/lispref/functions.texi
+++ b/lispref/functions.texi
@@ -525,9 +525,9 @@ defines the symbol @var{name} as a function that looks like this:
525@var{name}. It returns the value @var{name}, but usually we ignore this 525@var{name}. It returns the value @var{name}, but usually we ignore this
526value. 526value.
527 527
528As described previously (@pxref{Lambda Expressions}), 528As described previously, @var{argument-list} is a list of argument
529@var{argument-list} is a list of argument names and may include the 529names and may include the keywords @code{&optional} and @code{&rest}
530keywords @code{&optional} and @code{&rest}. Also, the first two of the 530(@pxref{Lambda Expressions}). Also, the first two of the
531@var{body-forms} may be a documentation string and an interactive 531@var{body-forms} may be a documentation string and an interactive
532declaration. 532declaration.
533 533
@@ -1157,13 +1157,14 @@ a function defined by another package, it is cleaner to use
1157You can use @code{make-obsolete} to declare a function obsolete. This 1157You can use @code{make-obsolete} to declare a function obsolete. This
1158indicates that the function may be removed at some stage in the future. 1158indicates that the function may be removed at some stage in the future.
1159 1159
1160@defun make-obsolete function new &optional when 1160@defun make-obsolete obsolete-name current-name &optional when
1161This function makes the byte compiler warn that the function 1161This function makes the byte compiler warn that the function
1162@var{function} is obsolete. If @var{new} is a symbol, the warning 1162@var{obsolete-name} is obsolete. If @var{current-name} is a symbol, the
1163message says to use @var{new} instead of @var{function}. @var{new} 1163warning message says to use @var{current-name} instead of
1164does not need to be an alias for @var{function}; it can be a different 1164@var{obsolete-name}. @var{current-name} does not need to be an alias for
1165function with similar functionality. If @var{new} is a string, it is 1165@var{obsolete-name}; it can be a different function with similar
1166the warning message. 1166functionality. If @var{current-name} is a string, it is the warning
1167message.
1167 1168
1168If provided, @var{when} should be a string indicating when the function 1169If provided, @var{when} should be a string indicating when the function
1169was first made obsolete---for example, a date or a release number. 1170was first made obsolete---for example, a date or a release number.
@@ -1172,20 +1173,14 @@ was first made obsolete---for example, a date or a release number.
1172You can define a function as an alias and declare it obsolete at the 1173You can define a function as an alias and declare it obsolete at the
1173same time using the macro @code{define-obsolete-function-alias}. 1174same time using the macro @code{define-obsolete-function-alias}.
1174 1175
1175@defmac define-obsolete-function-alias function new &optional when docstring 1176@defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring
1176This macro marks the function @var{function} obsolete and also defines 1177This macro marks the function @var{obsolete-name} obsolete and also
1177it as an alias for the function @var{new}. A typical call has the form: 1178defines it as an alias for the function @var{current-name}. It is
1179equivalent to the following:
1178 1180
1179@example 1181@example
1180(define-obsolete-function-alias 'old-fun 'new-fun "22.1" "Doc.") 1182(defalias @var{obsolete-name} @var{current-name} @var{docstring})
1181@end example 1183(make-obsolete @var{obsolete-name} @var{current-name} @var{when})
1182
1183@noindent
1184which is equivalent to the following two lines of code:
1185
1186@example
1187(defalias 'old-fun 'new-fun "Doc.")
1188(make-obsolete 'old-fun 'new-fun "22.1")
1189@end example 1184@end example
1190@end defmac 1185@end defmac
1191 1186
diff --git a/lispref/help.texi b/lispref/help.texi
index dfbc6c220f3..2dbea2038cc 100644
--- a/lispref/help.texi
+++ b/lispref/help.texi
@@ -47,13 +47,15 @@ of a function or variable. In a function definition, the documentation
47string follows the argument list. In a variable definition, the 47string follows the argument list. In a variable definition, the
48documentation string follows the initial value of the variable. 48documentation string follows the initial value of the variable.
49 49
50 When you write a documentation string, make the first line a complete 50 When you write a documentation string, make the first line a
51sentence (or two complete sentences) since some commands, such as 51complete sentence (or two complete sentences) since some commands,
52@code{apropos}, show only the first line of a multi-line documentation 52such as @code{apropos}, show only the first line of a multi-line
53string. Also, you should not indent the second line of a documentation 53documentation string. Also, you should not indent the second line of
54string, if it has one, because that looks odd when you use @kbd{C-h f} 54a documentation string, if it has one, because that looks odd when you
55(@code{describe-function}) or @kbd{C-h v} (@code{describe-variable}) to 55use @kbd{C-h f} (@code{describe-function}) or @kbd{C-h v}
56view the documentation string. @xref{Documentation Tips}. 56(@code{describe-variable}) to view the documentation string. There
57are many other conventions for doc strings; see @ref{Documentation
58Tips}.
57 59
58 Documentation strings can contain several special substrings, which 60 Documentation strings can contain several special substrings, which
59stand for key bindings to be looked up in the current keymaps when the 61stand for key bindings to be looked up in the current keymaps when the
@@ -117,7 +119,7 @@ retrieves the text from a file if the value calls for that. If the
117property value isn't @code{nil}, isn't a string, and doesn't refer to 119property value isn't @code{nil}, isn't a string, and doesn't refer to
118text in a file, then it is evaluated to obtain a string. 120text in a file, then it is evaluated to obtain a string.
119 121
120Finally, @code{documentation-property} passes the string through 122The last thing this function does is pass the string through
121@code{substitute-command-keys} to substitute actual key bindings, 123@code{substitute-command-keys} to substitute actual key bindings,
122unless @var{verbatim} is non-@code{nil}. 124unless @var{verbatim} is non-@code{nil}.
123 125
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index 63832ced1b4..79cbe478ea2 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -1335,10 +1335,10 @@ a key binding.
1335instead of @code{kill-line} and @code{kill-word}. It can establish 1335instead of @code{kill-line} and @code{kill-word}. It can establish
1336this by making these two command-remapping bindings in its keymap: 1336this by making these two command-remapping bindings in its keymap:
1337 1337
1338@example 1338@smallexample
1339(define-key my-mode-map [remap kill-line] 'my-kill-line) 1339(define-key my-mode-map [remap kill-line] 'my-kill-line)
1340(define-key my-mode-map [remap kill-word] 'my-kill-word) 1340(define-key my-mode-map [remap kill-word] 'my-kill-word)
1341@end example 1341@end smallexample
1342 1342
1343Whenever @code{my-mode-map} is an active keymap, if the user types 1343Whenever @code{my-mode-map} is an active keymap, if the user types
1344@kbd{C-k}, Emacs will find the standard global binding of 1344@kbd{C-k}, Emacs will find the standard global binding of
@@ -1349,10 +1349,10 @@ so instead of running @code{kill-line}, Emacs runs
1349 1349
1350Remapping only works through a single level. In other words, 1350Remapping only works through a single level. In other words,
1351 1351
1352@example 1352@smallexample
1353(define-key my-mode-map [remap kill-line] 'my-kill-line) 1353(define-key my-mode-map [remap kill-line] 'my-kill-line)
1354(define-key my-mode-map [remap my-kill-line] 'my-other-kill-line) 1354(define-key my-mode-map [remap my-kill-line] 'my-other-kill-line)
1355@end example 1355@end smallexample
1356 1356
1357@noindent 1357@noindent
1358does not have the effect of remapping @code{kill-line} into 1358does not have the effect of remapping @code{kill-line} into
diff --git a/lispref/lists.texi b/lispref/lists.texi
index ab7d496e461..a5a2c33bcce 100644
--- a/lispref/lists.texi
+++ b/lispref/lists.texi
@@ -24,6 +24,7 @@ the whole list.
24* Modifying Lists:: Storing new pieces into an existing list. 24* Modifying Lists:: Storing new pieces into an existing list.
25* Sets And Lists:: A list can represent a finite mathematical set. 25* Sets And Lists:: A list can represent a finite mathematical set.
26* Association Lists:: A list can represent a finite relation or mapping. 26* Association Lists:: A list can represent a finite relation or mapping.
27* Rings:: Managing a fixed-size ring of objects.
27@end menu 28@end menu
28 29
29@node Cons Cells 30@node Cons Cells
@@ -714,7 +715,7 @@ Some examples:
714primitives @code{setcar} and @code{setcdr}. We call these ``destructive'' 715primitives @code{setcar} and @code{setcdr}. We call these ``destructive''
715operations because they change existing list structure. 716operations because they change existing list structure.
716 717
717@cindex CL note---@code{rplaca} vrs @code{setcar} 718@cindex CL note---@code{rplaca} vs @code{setcar}
718@quotation 719@quotation
719@findex rplaca 720@findex rplaca
720@findex rplacd 721@findex rplacd
@@ -1676,6 +1677,94 @@ compares the @sc{cdr} of each @var{alist} association instead of the
1676@sc{car}. 1677@sc{car}.
1677@end defun 1678@end defun
1678 1679
1680@node Rings
1681@section Managing a Fixed-Size Ring of Objects
1682
1683@cindex ring data structure
1684 This section describes functions for operating on rings. A
1685@dfn{ring} is a fixed-size data structure that supports insertion,
1686deletion, rotation, and modulo-indexed reference and traversal.
1687
1688@defun make-ring size
1689This returns a new ring capable of holding @var{size} objects.
1690@var{size} should be an integer.
1691@end defun
1692
1693@defun ring-p object
1694This returns @code{t} if @var{object} is a ring, @code{nil} otherwise.
1695@end defun
1696
1697@defun ring-size ring
1698This returns the maximum capacity of the @var{ring}.
1699@end defun
1700
1701@defun ring-length ring
1702This returns the number of objects that @var{ring} currently contains.
1703The value will never exceed that returned by @code{ring-size}.
1704@end defun
1705
1706@defun ring-elements ring
1707This returns a list of the objects in @var{ring}, in no particular
1708order.
1709@end defun
1710
1711@defun ring-copy ring
1712This returns a new ring which is a copy of @var{ring}.
1713The new ring contains the same (@code{eq}) objects as @var{ring}.
1714@end defun
1715
1716@defun ring-empty-p ring
1717This returns @code{t} if @var{ring} is empty, @code{nil} otherwise.
1718@end defun
1719
1720 The newest element in the ring always has index 0. Higher indices
1721correspond to older elements. Indices are computed modulo the ring
1722length. Index @minus{}1 corresponds to the oldest element, @minus{}2
1723to the next-oldest, and so forth.
1724
1725@defun ring-ref ring index
1726This returns the object in @var{ring} found at index @var{index}.
1727@var{index} may be negative or greater than the ring length. If
1728@var{ring} is empty, @code{ring-ref} signals an error.
1729@end defun
1730
1731@defun ring-insert ring object
1732This inserts @var{object} into @var{ring}, making it the newest
1733element, and returns @var{object}.
1734
1735If the ring is full, insertion removes the oldest element to
1736make room for the new element.
1737@end defun
1738
1739@defun ring-remove ring &optional index
1740Remove an object from @var{ring}, and return that object. The
1741argument @var{index} specifies which item to remove; if it is
1742@code{nil}, that means to remove the oldest item. If @var{ring} is
1743empty, @code{ring-remove} signals an error.
1744@end defun
1745
1746@defun ring-insert-at-beginning ring object
1747This inserts @var{object} into @var{ring}, treating it as the oldest
1748element. The return value is not significant.
1749
1750If the ring is full, this function removes the newest element to make
1751room for the inserted element.
1752@end defun
1753
1754@cindex fifo data structure
1755 If you are careful not to exceed the ring size, you can
1756use the ring as a first-in-first-out queue. For example:
1757
1758@lisp
1759(let ((fifo (make-ring 5)))
1760 (mapc (lambda (obj) (ring-insert fifo obj))
1761 '(0 one "two"))
1762 (list (ring-remove fifo) t
1763 (ring-remove fifo) t
1764 (ring-remove fifo)))
1765 @result{} (0 t one t "two")
1766@end lisp
1767
1679@ignore 1768@ignore
1680 arch-tag: 31fb8a4e-4aa8-4a74-a206-aa00451394d4 1769 arch-tag: 31fb8a4e-4aa8-4a74-a206-aa00451394d4
1681@end ignore 1770@end ignore
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index cdba210b625..a6153fdaca2 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -414,10 +414,9 @@ symbol, not a list; it is a variable whose value is a list of strings
414inputs. It's the Lisp programmer's job to specify the right history 414inputs. It's the Lisp programmer's job to specify the right history
415list for each use of the minibuffer. 415list for each use of the minibuffer.
416 416
417 The basic minibuffer input functions @code{read-from-minibuffer} and 417 You specify the history list with the optional @var{hist} argument
418@code{completing-read} both accept an optional argument named @var{hist} 418to either @code{read-from-minibuffer} or @code{completing-read}. Here
419which is how you specify the history list. Here are the possible 419are the possible values for it:
420values:
421 420
422@table @asis 421@table @asis
423@item @var{variable} 422@item @var{variable}
@@ -587,10 +586,11 @@ for reading certain kinds of names with completion.
587@node Basic Completion 586@node Basic Completion
588@subsection Basic Completion Functions 587@subsection Basic Completion Functions
589 588
590 The functions @code{try-completion}, @code{all-completions} and 589 The completion functions @code{try-completion},
591@code{test-completion} have nothing in themselves to do with 590@code{all-completions} and @code{test-completion} have nothing in
592minibuffers. We describe them in this chapter so as to keep them near 591themselves to do with minibuffers. We describe them in this chapter
593the higher-level completion features that do use the minibuffer. 592so as to keep them near the higher-level completion features that do
593use the minibuffer.
594 594
595@defun try-completion string collection &optional predicate 595@defun try-completion string collection &optional predicate
596This function returns the longest common substring of all possible 596This function returns the longest common substring of all possible
@@ -788,12 +788,12 @@ value @var{fun} returns becomes the permanent value of @var{var}.
788 788
789Here are two examples of use: 789Here are two examples of use:
790 790
791@example 791@smallexample
792(defvar foo (lazy-completion-table foo make-my-alist 'global)) 792(defvar foo (lazy-completion-table foo make-my-alist 'global))
793 793
794(make-local-variable 'bar) 794(make-local-variable 'bar)
795(setq bar (lazy-completion-table foo make-my-alist 'local) 795(setq bar (lazy-completion-table foo make-my-alist 'local)
796@end example 796@end smallexample
797@end defmac 797@end defmac
798 798
799@node Minibuffer Completion 799@node Minibuffer Completion
@@ -879,12 +879,9 @@ Complete a foo: fo@point{}
879If the user then types @kbd{@key{DEL} @key{DEL} b @key{RET}}, 879If the user then types @kbd{@key{DEL} @key{DEL} b @key{RET}},
880@code{completing-read} returns @code{barfoo}. 880@code{completing-read} returns @code{barfoo}.
881 881
882The @code{completing-read} function binds three variables to pass 882The @code{completing-read} function binds variables to pass
883information to the commands that actually do completion. These 883information to the commands that actually do completion.
884variables are @code{minibuffer-completion-table}, 884They are described in the following section.
885@code{minibuffer-completion-predicate} and
886@code{minibuffer-completion-confirm}. For more information about them,
887see @ref{Completion Commands}.
888@end defun 885@end defun
889 886
890@node Completion Commands 887@node Completion Commands
@@ -898,55 +895,6 @@ some of the commands described below. @xref{Completion Options,,,
898emacs, The GNU Emacs Manual}, for a short description of Partial 895emacs, The GNU Emacs Manual}, for a short description of Partial
899Completion mode. 896Completion mode.
900 897
901@defvar minibuffer-local-completion-map
902@code{completing-read} uses this value as the local keymap when an
903exact match of one of the completions is not required. By default, this
904keymap makes the following bindings:
905
906@table @asis
907@item @kbd{?}
908@code{minibuffer-completion-help}
909
910@item @key{SPC}
911@code{minibuffer-complete-word}
912
913@item @key{TAB}
914@code{minibuffer-complete}
915@end table
916
917@noindent
918with other characters bound as in @code{minibuffer-local-map}
919(@pxref{Definition of minibuffer-local-map}).
920@end defvar
921
922@defvar minibuffer-local-must-match-map
923@code{completing-read} uses this value as the local keymap when an
924exact match of one of the completions is required. Therefore, no keys
925are bound to @code{exit-minibuffer}, the command that exits the
926minibuffer unconditionally. By default, this keymap makes the following
927bindings:
928
929@table @asis
930@item @kbd{?}
931@code{minibuffer-completion-help}
932
933@item @key{SPC}
934@code{minibuffer-complete-word}
935
936@item @key{TAB}
937@code{minibuffer-complete}
938
939@item @kbd{C-j}
940@code{minibuffer-complete-and-exit}
941
942@item @key{RET}
943@code{minibuffer-complete-and-exit}
944@end table
945
946@noindent
947with other characters bound as in @code{minibuffer-local-map}.
948@end defvar
949
950@defvar minibuffer-completion-table 898@defvar minibuffer-completion-table
951The value of this variable is the collection used for completion in 899The value of this variable is the collection used for completion in
952the minibuffer. This is the global variable that contains what 900the minibuffer. This is the global variable that contains what
@@ -960,6 +908,13 @@ passes to @code{try-completion}. The variable is also used by the other
960minibuffer completion functions. 908minibuffer completion functions.
961@end defvar 909@end defvar
962 910
911@defvar minibuffer-completion-confirm
912When the value of this variable is non-@code{nil}, Emacs asks for
913confirmation of a completion before exiting the minibuffer.
914@code{completing-read} binds this variable, and the function
915@code{minibuffer-complete-and-exit} checks the value before exiting.
916@end defvar
917
963@deffn Command minibuffer-complete-word 918@deffn Command minibuffer-complete-word
964This function completes the minibuffer contents by at most a single 919This function completes the minibuffer contents by at most a single
965word. Even if the minibuffer contents have only one completion, 920word. Even if the minibuffer contents have only one completion,
@@ -980,13 +935,6 @@ immediately---the command is programmed to work without confirmation
980when run twice in succession. 935when run twice in succession.
981@end deffn 936@end deffn
982 937
983@defvar minibuffer-completion-confirm
984When the value of this variable is non-@code{nil}, Emacs asks for
985confirmation of a completion before exiting the minibuffer. The
986function @code{minibuffer-complete-and-exit} checks the value of this
987variable before it exits.
988@end defvar
989
990@deffn Command minibuffer-completion-help 938@deffn Command minibuffer-completion-help
991This function creates a list of the possible completions of the 939This function creates a list of the possible completions of the
992current minibuffer contents. It works by calling @code{all-completions} 940current minibuffer contents. It works by calling @code{all-completions}
@@ -1025,6 +973,55 @@ automatically display a list of possible completions whenever nothing
1025can be completed because the next character is not uniquely determined. 973can be completed because the next character is not uniquely determined.
1026@end defopt 974@end defopt
1027 975
976@defvar minibuffer-local-completion-map
977@code{completing-read} uses this value as the local keymap when an
978exact match of one of the completions is not required. By default, this
979keymap makes the following bindings:
980
981@table @asis
982@item @kbd{?}
983@code{minibuffer-completion-help}
984
985@item @key{SPC}
986@code{minibuffer-complete-word}
987
988@item @key{TAB}
989@code{minibuffer-complete}
990@end table
991
992@noindent
993with other characters bound as in @code{minibuffer-local-map}
994(@pxref{Definition of minibuffer-local-map}).
995@end defvar
996
997@defvar minibuffer-local-must-match-map
998@code{completing-read} uses this value as the local keymap when an
999exact match of one of the completions is required. Therefore, no keys
1000are bound to @code{exit-minibuffer}, the command that exits the
1001minibuffer unconditionally. By default, this keymap makes the following
1002bindings:
1003
1004@table @asis
1005@item @kbd{?}
1006@code{minibuffer-completion-help}
1007
1008@item @key{SPC}
1009@code{minibuffer-complete-word}
1010
1011@item @key{TAB}
1012@code{minibuffer-complete}
1013
1014@item @kbd{C-j}
1015@code{minibuffer-complete-and-exit}
1016
1017@item @key{RET}
1018@code{minibuffer-complete-and-exit}
1019@end table
1020
1021@noindent
1022with other characters bound as in @code{minibuffer-local-map}.
1023@end defvar
1024
1028@node High-Level Completion 1025@node High-Level Completion
1029@subsection High-Level Completion Functions 1026@subsection High-Level Completion Functions
1030 1027
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 2366fca5b96..ac13e30b90c 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -395,7 +395,7 @@ setting up a buffer-local value for the variable
395@item 395@item
396The mode should specify how Imenu should find the definitions or 396The mode should specify how Imenu should find the definitions or
397sections of a buffer, by setting up a buffer-local value for the 397sections of a buffer, by setting up a buffer-local value for the
398variable @code{imenu-generic-expression}, for the pair of variables 398variable @code{imenu-generic-expression}, for the two variables
399@code{imenu-prev-index-position-function} and 399@code{imenu-prev-index-position-function} and
400@code{imenu-extract-index-name-function}, or for the variable 400@code{imenu-extract-index-name-function}, or for the variable
401@code{imenu-create-index-function} (@pxref{Imenu}). 401@code{imenu-create-index-function} (@pxref{Imenu}).
@@ -2290,8 +2290,8 @@ A nested sub-alist element looks like this:
2290It creates the submenu @var{menu-title} specified by @var{sub-alist}. 2290It creates the submenu @var{menu-title} specified by @var{sub-alist}.
2291 2291
2292The default value of @code{imenu-create-index-function} is 2292The default value of @code{imenu-create-index-function} is
2293@code{imenu-default-create-index-function}. This function uses 2293@code{imenu-default-create-index-function}. This function calls the
2294@code{imenu-prev-index-position-function} and 2294value of @code{imenu-prev-index-position-function} and the value of
2295@code{imenu-extract-index-name-function} to produce the index alist. 2295@code{imenu-extract-index-name-function} to produce the index alist.
2296However, if either of these two variables is @code{nil}, the default 2296However, if either of these two variables is @code{nil}, the default
2297function uses @code{imenu-generic-expression} instead. 2297function uses @code{imenu-generic-expression} instead.
@@ -2456,7 +2456,7 @@ highlighted (instead of the entire text that @var{matcher} matched).
2456@end example 2456@end example
2457 2457
2458If you use @code{regexp-opt} to produce the regular expression 2458If you use @code{regexp-opt} to produce the regular expression
2459@var{matcher}, then you can use @code{regexp-opt-depth} (@pxref{Regexp 2459@var{matcher}, you can use @code{regexp-opt-depth} (@pxref{Regexp
2460Functions}) to calculate the value for @var{subexp}. 2460Functions}) to calculate the value for @var{subexp}.
2461 2461
2462@item (@var{matcher} . @var{facespec}) 2462@item (@var{matcher} . @var{facespec})
@@ -2657,8 +2657,7 @@ non-@code{nil} value, they are added at the end of
2657Some modes provide specialized support you can use in additional 2657Some modes provide specialized support you can use in additional
2658highlighting patterns. See the variables 2658highlighting patterns. See the variables
2659@code{c-font-lock-extra-types}, @code{c++-font-lock-extra-types}, 2659@code{c-font-lock-extra-types}, @code{c++-font-lock-extra-types},
2660@code{objc-font-lock-extra-types} and 2660and @code{java-font-lock-extra-types}, for example.
2661@code{java-font-lock-extra-types}, for example.
2662 2661
2663@strong{Warning:} major mode functions must not call 2662@strong{Warning:} major mode functions must not call
2664@code{font-lock-add-keywords} under any circumstances, either directly 2663@code{font-lock-add-keywords} under any circumstances, either directly
diff --git a/lispref/nonascii.texi b/lispref/nonascii.texi
index aaa23e90a48..9683156541d 100644
--- a/lispref/nonascii.texi
+++ b/lispref/nonascii.texi
@@ -1067,11 +1067,11 @@ for decoding (in case @var{operation} does decoding), and
1067@var{encoding-system} is the coding system for encoding (in case 1067@var{encoding-system} is the coding system for encoding (in case
1068@var{operation} does encoding). 1068@var{operation} does encoding).
1069 1069
1070The argument @var{operation} should be a symbol, one of 1070The argument @var{operation} should be a symbol, any one of
1071@code{insert-file-contents}, @code{write-region}, @code{call-process}, 1071@code{insert-file-contents}, @code{write-region},
1072@code{call-process-region}, @code{start-process}, or 1072@code{start-process}, @code{call-process}, @code{call-process-region},
1073@code{open-network-stream}. These are the names of the Emacs I/O primitives 1073or @code{open-network-stream}. These are the names of the Emacs I/O
1074that can do coding system conversion. 1074primitives that can do coding system conversion.
1075 1075
1076The remaining arguments should be the same arguments that might be given 1076The remaining arguments should be the same arguments that might be given
1077to that I/O primitive. Depending on the primitive, one of those 1077to that I/O primitive. Depending on the primitive, one of those
@@ -1081,9 +1081,9 @@ name is the target. For subprocess primitives, the process name is the
1081target. For @code{open-network-stream}, the target is the service name 1081target. For @code{open-network-stream}, the target is the service name
1082or port number. 1082or port number.
1083 1083
1084This function looks up the target in @code{file-coding-system-alist}, 1084Depending on @var{operation}, this function looks up the target in
1085@code{process-coding-system-alist}, or 1085@code{file-coding-system-alist}, @code{process-coding-system-alist},
1086@code{network-coding-system-alist}, depending on @var{operation}. 1086or @code{network-coding-system-alist}.
1087@end defun 1087@end defun
1088 1088
1089@node Specifying Coding Systems 1089@node Specifying Coding Systems
diff --git a/lispref/os.texi b/lispref/os.texi
index a1de8f09c36..7bc76799210 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -91,10 +91,10 @@ name is usually @file{site-start.el}.
91@cindex @file{site-start.el} 91@cindex @file{site-start.el}
92 92
93@item 93@item
94It loads your init file (usually @file{~/.emacs}), unless @samp{-q} 94It loads your init file (usually @file{~/.emacs}), unless the option
95(or @samp{--no-init-file}), @samp{-Q}, or @samp{--batch} was specified 95@samp{-q} (or @samp{--no-init-file}), @samp{-Q}, or @samp{--batch} was
96on the command line. The @samp{-u} option can specify another user 96specified on the command line. The @samp{-u} option can specify
97whose home directory should be used instead of @file{~}. 97another user whose home directory should be used instead of @file{~}.
98 98
99@item 99@item
100It loads the library @file{default} (if any), unless 100It loads the library @file{default} (if any), unless
@@ -606,9 +606,10 @@ through various functions. These variables include the name of the
606system, the user's @acronym{UID}, and so on. 606system, the user's @acronym{UID}, and so on.
607 607
608@defvar system-configuration 608@defvar system-configuration
609This variable holds the GNU configuration name for the hardware/software 609This variable holds the standard GNU configuration name for the
610configuration of your system, as a string. The convenient way to test 610hardware/software configuration of your system, as a string. The
611parts of this string is with @code{string-match}. 611convenient way to test parts of this string is with
612@code{string-match}.
612@end defvar 613@end defvar
613 614
614@defvar system-type 615@defvar system-type
@@ -1375,6 +1376,9 @@ both before and after changing the buffer, to separate the timer's
1375changes from user commands' changes and prevent a single undo entry 1376changes from user commands' changes and prevent a single undo entry
1376from growing to be quite large. 1377from growing to be quite large.
1377 1378
1379 If a timer function calls functions that can change the match data,
1380it should save and restore the match data. @xref{Saving Match Data}.
1381
1378@deffn Command run-at-time time repeat function &rest args 1382@deffn Command run-at-time time repeat function &rest args
1379This sets up a timer that calls the function @var{function} with 1383This sets up a timer that calls the function @var{function} with
1380arguments @var{args} at time @var{time}. If @var{repeat} is a number 1384arguments @var{args} at time @var{time}. If @var{repeat} is a number
diff --git a/lispref/processes.texi b/lispref/processes.texi
index 07a72886355..f88b2c46159 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -52,6 +52,7 @@ This function returns @code{t} if @var{object} is a process,
52* Datagrams:: UDP network connections. 52* Datagrams:: UDP network connections.
53* Low-Level Network:: Lower-level but more general function 53* Low-Level Network:: Lower-level but more general function
54 to create connections and servers. 54 to create connections and servers.
55* Byte Packing:: Using bindat to pack and unpack binary data.
55@end menu 56@end menu
56 57
57@node Subprocess Creation 58@node Subprocess Creation
@@ -168,7 +169,7 @@ function.
168(shell-quote-argument "foo > bar") 169(shell-quote-argument "foo > bar")
169 @result{} "foo\\ \\>\\ bar" 170 @result{} "foo\\ \\>\\ bar"
170 171
171;; @r{This example shows the behavior on MS-DOS and MS-Windows systems.} 172;; @r{This example shows the behavior on MS-DOS and MS-Windows.}
172(shell-quote-argument "foo > bar") 173(shell-quote-argument "foo > bar")
173 @result{} "\"foo > bar\"" 174 @result{} "\"foo > bar\""
174@end example 175@end example
@@ -766,9 +767,9 @@ specify the process to send input to, and the input data to send. The
766data appears on the ``standard input'' of the subprocess. 767data appears on the ``standard input'' of the subprocess.
767 768
768 Some operating systems have limited space for buffered input in a 769 Some operating systems have limited space for buffered input in a
769@acronym{PTY}. On these systems, Emacs sends an @acronym{EOF} periodically amidst 770@acronym{PTY}. On these systems, Emacs sends an @acronym{EOF}
770the other characters, to force them through. For most programs, 771periodically amidst the other characters, to force them through. For
771these @acronym{EOF}s do no harm. 772most programs, these @acronym{EOF}s do no harm.
772 773
773 Subprocess input is normally encoded using a coding system before the 774 Subprocess input is normally encoded using a coding system before the
774subprocess receives it, much like text written into a file. You can use 775subprocess receives it, much like text written into a file. You can use
@@ -972,7 +973,7 @@ primitive that waits.
972@defvar process-adaptive-read-buffering 973@defvar process-adaptive-read-buffering
973On some systems, when Emacs reads the output from a subprocess, the 974On some systems, when Emacs reads the output from a subprocess, the
974output data is read in very small blocks, potentially resulting in 975output data is read in very small blocks, potentially resulting in
975very poor performance. This behaviour can be remedied to some extent 976very poor performance. This behavior can be remedied to some extent
976by setting the variable @var{process-adaptive-read-buffering} to a 977by setting the variable @var{process-adaptive-read-buffering} to a
977non-@code{nil} value (the default), as it will automatically delay reading 978non-@code{nil} value (the default), as it will automatically delay reading
978from such processes, thus allowing them to produce more output before 979from such processes, thus allowing them to produce more output before
@@ -1559,7 +1560,7 @@ back to listening for more connection requests.
1559keyword/argument pairs, for example @code{:server t} to create a 1560keyword/argument pairs, for example @code{:server t} to create a
1560server process, or @code{:type 'datagram} to create a datagram 1561server process, or @code{:type 'datagram} to create a datagram
1561connection. @xref{Low-Level Network}, for details. You can also use 1562connection. @xref{Low-Level Network}, for details. You can also use
1562the @code{open-network-stream} function descibed below. 1563the @code{open-network-stream} function described below.
1563 1564
1564 You can distinguish process objects representing network connections 1565 You can distinguish process objects representing network connections
1565and servers from those representing subprocesses with the 1566and servers from those representing subprocesses with the
@@ -1823,7 +1824,8 @@ If you don't specify this keyword at all, the default
1823is to determine the coding systems from the data. 1824is to determine the coding systems from the data.
1824 1825
1825@item :noquery @var{query-flag} 1826@item :noquery @var{query-flag}
1826Initialize the process query flag to @var{query-flag}. @xref{Query Before Exit}. 1827Initialize the process query flag to @var{query-flag}.
1828@xref{Query Before Exit}.
1827 1829
1828@item :filter @var{filter} 1830@item :filter @var{filter}
1829Initialize the process filter to @var{filter}. 1831Initialize the process filter to @var{filter}.
@@ -1938,7 +1940,8 @@ and @var{remote-address} arguments to @code{make-network-process}.
1938 1940
1939@defun network-interface-info ifname 1941@defun network-interface-info ifname
1940This function returns information about the network interface named 1942This function returns information about the network interface named
1941@var{ifname}. The value is a list of the form @code{(@var{addr} @var{bcast} @var{netmask} @var{hwaddr} @var{flags})}. 1943@var{ifname}. The value is a list of the form
1944@code{(@var{addr} @var{bcast} @var{netmask} @var{hwaddr} @var{flags})}.
1942 1945
1943@table @var 1946@table @var
1944@item addr 1947@item addr
@@ -2015,7 +2018,411 @@ That particular network option is supported by
2015@code{make-network-process} and @code{set-network-process-option}. 2018@code{make-network-process} and @code{set-network-process-option}.
2016@end table 2019@end table
2017 2020
2021@node Byte Packing
2022@section Packing and Unpacking Byte Arrays
2023
2024 This section describes how to pack and unpack arrays of bytes,
2025usually for binary network protocols. These functions convert byte arrays
2026to alists, and vice versa. The byte array can be represented as a
2027unibyte string or as a vector of integers, while the alist associates
2028symbols either with fixed-size objects or with recursive sub-alists.
2029
2030@cindex serializing
2031@cindex deserializing
2032@cindex packing
2033@cindex unpacking
2034 Conversion from byte arrays to nested alists is also known as
2035@dfn{deserializing} or @dfn{unpacking}, while going in the opposite
2036direction is also known as @dfn{serializing} or @dfn{packing}.
2037
2038@menu
2039* Bindat Spec:: Describing data layout.
2040* Bindat Functions:: Doing the unpacking and packing.
2041* Bindat Examples:: Samples of what bindat.el can do for you!
2042@end menu
2043
2044@node Bindat Spec
2045@subsection Describing Data Layout
2046
2047 To control unpacking and packing, you write a @dfn{data layout
2048specification}, a special nested list describing named and typed
2049@dfn{fields}. This specification controls length of each field to be
2050processed, and how to pack or unpack it.
2051
2052@cindex endianness
2053@cindex big endian
2054@cindex little endian
2055@cindex network byte ordering
2056 A field's @dfn{type} describes the size (in bytes) of the object
2057that the field represents and, in the case of multibyte fields, how
2058the bytes are ordered within the field. The two possible orderings
2059are ``big endian'' (also known as ``network byte ordering'') and
2060``little endian''. For instance, the number @code{#x23cd} (decimal
20619165) in big endian would be the two bytes @code{#x23} @code{#xcd};
2062and in little endian, @code{#xcd} @code{#x23}. Here are the possible
2063type values:
2064
2065@table @code
2066@item u8
2067@itemx byte
2068Unsigned byte, with length 1.
2069
2070@item u16
2071@itemx word
2072@itemx short
2073Unsigned integer in network byte order, with length 2.
2074
2075@item u24
2076Unsigned integer in network byte order, with length 3.
2077
2078@item u32
2079@itemx dword
2080@itemx long
2081Unsigned integer in network byte order, with length 4.
2082Note: These values may be limited by Emacs' integer implementation limits.
2083
2084@item u16r
2085@itemx u24r
2086@itemx u32r
2087Unsigned integer in little endian order, with length 2, 3 and 4, respectively.
2088
2089@item str @var{len}
2090String of length @var{len}.
2091
2092@item strz @var{len}
2093Zero-terminated string of length @var{len}.
2094
2095@item vec @var{len}
2096Vector of @var{len} bytes.
2097
2098@item ip
2099Four-byte vector representing an Internet address. For example:
2100@code{[127 0 0 1]} for localhost.
2101
2102@item bits @var{len}
2103List of set bits in @var{len} bytes. The bytes are taken in big
2104endian order and the bits are numbered starting with @code{8 *
2105@var{len} @minus{} 1} and ending with zero. For example: @code{bits
21062} unpacks @code{#x28} @code{#x1c} to @code{(2 3 4 11 13)} and
2107@code{#x1c} @code{#x28} to @code{(3 5 10 11 12)}.
2108
2109@item (eval @var{form})
2110@var{form} is a Lisp expression evaluated at the moment the field is
2111unpacked or packed. The result of the evaluation should be one of the
2112above-listed type specifications.
2113@end table
2114
2115A field specification generally has the form @code{([@var{name}]
2116@var{handler})}. The square braces indicate that @var{name} is
2117optional. (Don't use names that are symbols meaningful as type
2118specifications (above) or handler specifications (below), since that
2119would be ambiguous.) @var{name} can be a symbol or the expression
2120@code{(eval @var{form})}, in which case @var{form} should evaluate to
2121a symbol.
2122
2123@var{handler} describes how to unpack or pack the field and can be one
2124of the following:
2125
2126@table @code
2127@item @var{type}
2128Unpack/pack this field according to the type specification @var{type}.
2129
2130@item eval @var{form}
2131Evaluate @var{form}, a Lisp expression, for side-effect only. If the
2132field name is specified, the value is bound to that field name.
2133@var{form} can access and update these dynamically bound variables:
2134
2135@table @code
2136@item raw-data
2137The data as a byte array.
2138
2139@item pos
2140Current position of the unpacking or packing operation.
2141
2142@item struct
2143Alist.
2144
2145@item last
2146Value of the last field processed.
2147@end table
2148
2149@item fill @var{len}
2150Skip @var{len} bytes. In packing, this leaves them unchanged,
2151which normally means they remain zero. In unpacking, this means
2152they are ignored.
2153
2154@item align @var{len}
2155Skip to the next multiple of @var{len} bytes.
2156
2157@item struct @var{spec-name}
2158Process @var{spec-name} as a sub-specification. This describes a
2159structure nested within another structure.
2160
2161@item union @var{form} (@var{tag} @var{spec})@dots{}
2162@c ??? I don't see how one would actually use this.
2163@c ??? what kind of expression would be useful for @var{form}?
2164Evaluate @var{form}, a Lisp expression, find the first @var{tag}
2165that matches it, and process its associated data layout specification
2166@var{spec}. Matching can occur in one of three ways:
2167
2168@itemize
2169@item
2170If a @var{tag} has the form @code{(eval @var{expr})}, evaluate
2171@var{expr} with the variable @code{tag} dynamically bound to the value
2172of @var{form}. A non-@code{nil} result indicates a match.
2173
2174@item
2175@var{tag} matches if it is @code{equal} to the value of @var{form}.
2176
2177@item
2178@var{tag} matches unconditionally if it is @code{t}.
2179@end itemize
2180
2181@item repeat @var{count} @var{field-spec}@dots{}
2182@var{count} may be an integer, or a list of one element naming a
2183previous field. For correct operation, each @var{field-spec} must
2184include a name.
2185@c ??? What does it MEAN?
2186@end table
2187
2188@node Bindat Functions
2189@subsection Functions to Unpack and Pack Bytes
2190
2191 In the following documentation, @var{spec} refers to a data layout
2192specification, @code{raw-data} to a byte array, and @var{struct} to an
2193alist representing unpacked field data.
2194
2195@defun bindat-unpack spec raw-data &optional pos
2196This function unpacks data from the byte array @code{raw-data}
2197according to @var{spec}. Normally this starts unpacking at the
2198beginning of the byte array, but if @var{pos} is non-@code{nil}, it
2199specifies a zero-based starting position to use instead.
2200
2201The value is an alist or nested alist in which each element describes
2202one unpacked field.
2203@end defun
2204
2205@defun bindat-get-field struct &rest name
2206This function selects a field's data from the nested alist
2207@var{struct}. Usually @var{struct} was returned by
2208@code{bindat-unpack}. If @var{name} corresponds to just one argument,
2209that means to extract a top-level field value. Multiple @var{name}
2210arguments specify repeated lookup of sub-structures. An integer name
2211acts as an array index.
2212
2213For example, if @var{name} is @code{(a b 2 c)}, that means to find
2214field @code{c} in the second element of subfield @code{b} of field
2215@code{a}. (This corresponds to @code{struct.a.b[2].c} in C.)
2216@end defun
2217
2218@defun bindat-length spec struct
2219@c ??? I don't understand this at all -- rms
2220This function returns the length in bytes of @var{struct}, according
2221to @var{spec}.
2222@end defun
2223
2224@defun bindat-pack spec struct &optional raw-data pos
2225This function returns a byte array packed according to @var{spec} from
2226the data in the alist @var{struct}. Normally it creates and fills a
2227new byte array starting at the beginning. However, if @var{raw-data}
2228is non-@code{nil}, it specifies a pre-allocated string or vector to
2229pack into. If @var{pos} is non-@code{nil}, it specifies the starting
2230offset for packing into @code{raw-data}.
2231
2232@c ??? Isn't this a bug? Shouldn't it always be unibyte?
2233Note: The result is a multibyte string; use @code{string-make-unibyte}
2234on it to make it unibyte if necessary.
2235@end defun
2236
2237@defun bindat-ip-to-string ip
2238Convert the Internet address vector @var{ip} to a string in the usual
2239dotted notation.
2240
2241@example
2242(bindat-ip-to-string [127 0 0 1])
2243 @result{} "127.0.0.1"
2244@end example
2245@end defun
2246
2247@node Bindat Examples
2248@subsection Examples of Byte Unpacking and Packing
2249
2250 Here is a complete example of byte unpacking and packing:
2251
2252@lisp
2253(defvar fcookie-index-spec
2254 '((:version u32)
2255 (:count u32)
2256 (:longest u32)
2257 (:shortest u32)
2258 (:flags u32)
2259 (:delim u8)
2260 (:ignored fill 3)
2261 (:offset repeat (:count)
2262 (:foo u32)))
2263 "Description of a fortune cookie index file's contents.")
2264
2265(defun fcookie (cookies &optional index)
2266 "Display a random fortune cookie from file COOKIES.
2267Optional second arg INDEX specifies the associated index
2268filename, which is by default constructed by appending
2269\".dat\" to COOKIES. Display cookie text in possibly
2270new buffer \"*Fortune Cookie: BASENAME*\" where BASENAME
2271is COOKIES without the directory part."
2272 (interactive "fCookies file: ")
2273 (let* ((info (with-temp-buffer
2274 (insert-file-contents-literally
2275 (or index (concat cookies ".dat")))
2276 (bindat-unpack fcookie-index-spec
2277 (buffer-string))))
2278 (sel (random (bindat-get-field info :count)))
2279 (beg (cdar (bindat-get-field info :offset sel)))
2280 (end (or (cdar (bindat-get-field info
2281 :offset (1+ sel)))
2282 (nth 7 (file-attributes cookies)))))
2283 (switch-to-buffer
2284 (get-buffer-create
2285 (format "*Fortune Cookie: %s*"
2286 (file-name-nondirectory cookies))))
2287 (erase-buffer)
2288 (insert-file-contents-literally
2289 cookies nil beg (- end 3))))
2290
2291(defun fcookie-create-index (cookies &optional index delim)
2292 "Scan file COOKIES, and write out its index file.
2293Optional second arg INDEX specifies the index filename,
2294which is by default constructed by appending \".dat\" to
2295COOKIES. Optional third arg DELIM specifies the unibyte
2296character which, when found on a line of its own in
2297COOKIES, indicates the border between entries."
2298 (interactive "fCookies file: ")
2299 (setq delim (or delim ?%))
2300 (let ((delim-line (format "\n%c\n" delim))
2301 (count 0)
2302 (max 0)
2303 min p q len offsets)
2304 (unless (= 3 (string-bytes delim-line))
2305 (error "Delimiter cannot be represented in one byte"))
2306 (with-temp-buffer
2307 (insert-file-contents-literally cookies)
2308 (while (and (setq p (point))
2309 (search-forward delim-line (point-max) t)
2310 (setq len (- (point) 3 p)))
2311 (setq count (1+ count)
2312 max (max max len)
2313 min (min (or min max) len)
2314 offsets (cons (1- p) offsets))))
2315 (with-temp-buffer
2316 (set-buffer-multibyte nil)
2317 (insert
2318 (string-make-unibyte
2319 (bindat-pack
2320 fcookie-index-spec
2321 `((:version . 2)
2322 (:count . ,count)
2323 (:longest . ,max)
2324 (:shortest . ,min)
2325 (:flags . 0)
2326 (:delim . ,delim)
2327 (:offset . ,(mapcar (lambda (o)
2328 (list (cons :foo o)))
2329 (nreverse offsets)))))))
2330 (let ((coding-system-for-write 'raw-text-unix))
2331 (write-file (or index (concat cookies ".dat")))))))
2332@end lisp
2333
2334Following is an example of defining and unpacking a complex structure.
2335Consider the following C structures:
2336
2337@example
2338struct header @{
2339 unsigned long dest_ip;
2340 unsigned long src_ip;
2341 unsigned short dest_port;
2342 unsigned short src_port;
2343@};
2344
2345struct data @{
2346 unsigned char type;
2347 unsigned char opcode;
2348 unsigned long length; /* In little endian order */
2349 unsigned char id[8]; /* null-terminated string */
2350 unsigned char data[/* (length + 3) & ~3 */];
2351@};
2352
2353struct packet @{
2354 struct header header;
2355 unsigned char items;
2356 unsigned char filler[3];
2357 struct data item[/* items */];
2358
2359@};
2360@end example
2361
2362The corresponding data layout specification:
2363
2364@lisp
2365(setq header-spec
2366 '((dest-ip ip)
2367 (src-ip ip)
2368 (dest-port u16)
2369 (src-port u16)))
2370
2371(setq data-spec
2372 '((type u8)
2373 (opcode u8)
2374 (length u16r) ;; little endian order
2375 (id strz 8)
2376 (data vec (length))
2377 (align 4)))
2378
2379(setq packet-spec
2380 '((header struct header-spec)
2381 (items u8)
2382 (fill 3)
2383 (item repeat (items)
2384 (struct data-spec))))
2385@end lisp
2386
2387A binary data representation:
2388
2389@lisp
2390(setq binary-data
2391 [ 192 168 1 100 192 168 1 101 01 28 21 32 2 0 0 0
2392 2 3 5 0 ?A ?B ?C ?D ?E ?F 0 0 1 2 3 4 5 0 0 0
2393 1 4 7 0 ?B ?C ?D ?E ?F ?G 0 0 6 7 8 9 10 11 12 0 ])
2394@end lisp
2395
2396The corresponding decoded structure:
2397
2398@lisp
2399(setq decoded (bindat-unpack packet-spec binary-data))
2400 @result{}
2401((header
2402 (dest-ip . [192 168 1 100])
2403 (src-ip . [192 168 1 101])
2404 (dest-port . 284)
2405 (src-port . 5408))
2406 (items . 2)
2407 (item ((data . [1 2 3 4 5])
2408 (id . "ABCDEF")
2409 (length . 5)
2410 (opcode . 3)
2411 (type . 2))
2412 ((data . [6 7 8 9 10 11 12])
2413 (id . "BCDEFG")
2414 (length . 7)
2415 (opcode . 4)
2416 (type . 1))))
2417@end lisp
2418
2419Fetching data from this structure:
2420
2421@lisp
2422(bindat-get-field decoded 'item 1 'id)
2423 @result{} "BCDEFG"
2424@end lisp
2425
2018@ignore 2426@ignore
2019 arch-tag: ba9da253-e65f-4e7f-b727-08fba0a1df7a 2427 arch-tag: ba9da253-e65f-4e7f-b727-08fba0a1df7a
2020@end ignore 2428@end ignore
2021
diff --git a/lispref/searching.texi b/lispref/searching.texi
index 15037068dd2..f2f21458506 100644
--- a/lispref/searching.texi
+++ b/lispref/searching.texi
@@ -244,16 +244,15 @@ first tries to match all three @samp{a}s; but the rest of the pattern is
244The next alternative is for @samp{a*} to match only two @samp{a}s. With 244The next alternative is for @samp{a*} to match only two @samp{a}s. With
245this choice, the rest of the regexp matches successfully.@refill 245this choice, the rest of the regexp matches successfully.@refill
246 246
247Nested repetition operators can be extremely slow or loop infinitely 247Nested repetition operators take a long time, or even forever, if they
248if they use repetition operators inside repetition operators. For 248lead to ambiguous matching. For example, trying to match the regular
249example, it could take hours for the regular expression 249expression @samp{\(x+y*\)*a} against the string
250@samp{\(x+y*\)*a} to try to match the sequence 250@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could take hours before it
251@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}, before it ultimately 251ultimately fails. Emacs must try each way of grouping the 35
252fails. Emacs must try each way of grouping the 35 @samp{x}s before 252@samp{x}s before concluding that none of them can work. Even worse,
253concluding that none of them can work. Even worse, @samp{\(x*\)*} can 253@samp{\(x*\)*} can match the null string in infinitely many ways, so
254match the null string in infinitely many ways, so it causes an 254it causes an infinite loop. To avoid these problems, check nested
255infinite loop. To avoid these problems, check nested repetitions 255repetitions carefully.
256carefully.
257 256
258@item @samp{+} 257@item @samp{+}
259@cindex @samp{+} in regexp 258@cindex @samp{+} in regexp
@@ -347,9 +346,10 @@ different characters.
347 346
348@item @samp{[^ @dots{} ]} 347@item @samp{[^ @dots{} ]}
349@cindex @samp{^} in regexp 348@cindex @samp{^} in regexp
350@samp{[^} begins a @dfn{complemented character alternative}, which matches any 349@samp{[^} begins a @dfn{complemented character alternative}. This
351character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches 350matches any character except the ones specified. Thus,
352all characters @emph{except} letters and digits. 351@samp{[^a-z0-9A-Z]} matches all characters @emph{except} letters and
352digits.
353 353
354@samp{^} is not special in a character alternative unless it is the first 354@samp{^} is not special in a character alternative unless it is the first
355character. The character following the @samp{^} is treated as if it 355character. The character following the @samp{^} is treated as if it
@@ -1531,8 +1531,9 @@ are reseated to point to nowhere, and if the value is @code{evaporate},
1531the markers are put back on the free list. 1531the markers are put back on the free list.
1532 1532
1533@strong{Warning:} When @code{evaporate} is specified for @var{reseat}, 1533@strong{Warning:} When @code{evaporate} is specified for @var{reseat},
1534no other references to the markers on the @var{reuse} list; otherwise, 1534you must ensure that no other references to the markers on the
1535Emacs may crash during the next garbage collection. 1535@var{reuse} list exists; otherwise, Emacs may crash during the next
1536garbage collection.
1536 1537
1537As always, there must be no possibility of intervening searches between 1538As always, there must be no possibility of intervening searches between
1538the call to a search function and the call to @code{match-data} that is 1539the call to a search function and the call to @code{match-data} that is
@@ -1563,8 +1564,9 @@ are reseated to point to nowhere, and if the value is @code{evaporate},
1563the markers are put back on the free list. 1564the markers are put back on the free list.
1564 1565
1565@strong{Warning:} When @code{evaporate} is specified for @var{reseat}, 1566@strong{Warning:} When @code{evaporate} is specified for @var{reseat},
1566no other references to the markers on the @var{match-list} list; otherwise, 1567you must ensure that no other references to the markers on the
1567Emacs may crash during the next garbage collection. 1568@var{match-list} list exists; otherwise, Emacs may crash during the
1569next garbage collection.
1568 1570
1569@findex store-match-data 1571@findex store-match-data
1570@code{store-match-data} is a semi-obsolete alias for @code{set-match-data}. 1572@code{store-match-data} is a semi-obsolete alias for @code{set-match-data}.
diff --git a/lispref/strings.texi b/lispref/strings.texi
index b70e8d9f9d4..d0504684f82 100644
--- a/lispref/strings.texi
+++ b/lispref/strings.texi
@@ -298,7 +298,8 @@ useful. If you need such a result, use an explicit value for
298@var{separators}: 298@var{separators}:
299 299
300@example 300@example
301(split-string " two words " split-string-default-separators) 301(split-string " two words "
302 split-string-default-separators)
302 @result{} ("" "two" "words" "") 303 @result{} ("" "two" "words" "")
303@end example 304@end example
304 305
@@ -353,8 +354,8 @@ practice:
353@end defun 354@end defun
354 355
355@defvar split-string-default-separators 356@defvar split-string-default-separators
356The default value of @var{separators} for @code{split-string}, initially 357The default value of @var{separators} for @code{split-string}. Its
357@w{@samp{"[ \f\t\n\r\v]+"}}. 358usual value is @w{@samp{"[ \f\t\n\r\v]+"}}.
358@end defvar 359@end defvar
359 360
360@node Modifying Strings 361@node Modifying Strings
diff --git a/lispref/syntax.texi b/lispref/syntax.texi
index e8707709fe2..282cbca794d 100644
--- a/lispref/syntax.texi
+++ b/lispref/syntax.texi
@@ -754,10 +754,11 @@ necessary to flush the cache manually.
754@end defun 754@end defun
755 755
756@defvar syntax-begin-function 756@defvar syntax-begin-function
757If this is non-nil, it should be a function that moves to an earlier 757If this is non-@code{nil}, it should be a function that moves to an
758buffer position where the parser state is equivalent to @code{nil}, 758earlier buffer position where the parser state is equivalent to
759i.e., a position outside of any comment, string, or parenthesis. 759@code{nil}---in other words, a position outside of any comment,
760@code{syntax-ppss} uses it to supplement its cache. 760string, or parenthesis. @code{syntax-ppss} uses it to supplement its
761cache.
761@end defvar 762@end defvar
762 763
763@defun scan-lists from count depth 764@defun scan-lists from count depth
diff --git a/lispref/text.texi b/lispref/text.texi
index cddeeb8fbde..5a4d743ab75 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -1497,10 +1497,10 @@ of justification. It can be @code{left}, @code{right}, @code{full},
1497follow specified justification style (see @code{current-justification}, 1497follow specified justification style (see @code{current-justification},
1498below). @code{nil} means to do full justification. 1498below). @code{nil} means to do full justification.
1499 1499
1500If @var{eop} is non-@code{nil}, that means do left-justification if 1500If @var{eop} is non-@code{nil}, that means do only left-justification
1501@code{current-justification} specifies full justification. This is used 1501if @code{current-justification} specifies full justification. This is
1502for the last line of a paragraph; even if the paragraph as a whole is 1502used for the last line of a paragraph; even if the paragraph as a
1503fully justified, the last line should not be. 1503whole is fully justified, the last line should not be.
1504 1504
1505If @var{nosqueeze} is non-@code{nil}, that means do not change interior 1505If @var{nosqueeze} is non-@code{nil}, that means do not change interior
1506whitespace. 1506whitespace.
@@ -1727,12 +1727,11 @@ Adaptive Fill mode matches this regular expression against the text
1727starting after the left margin whitespace (if any) on a line; the 1727starting after the left margin whitespace (if any) on a line; the
1728characters it matches are that line's candidate for the fill prefix. 1728characters it matches are that line's candidate for the fill prefix.
1729 1729
1730The default value of this variable is 1730@w{@samp{"[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the
1731@w{@samp{"[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}}. This 1731default value. This matches a number enclosed in parentheses or
1732matches a number enclosed in parentheses or followed by a period, 1732followed by a period, or certain punctuation characters, or any
1733or certain punctuation characters, or any sequence of these 1733sequence of these intermingled with whitespace. In particular, it
1734intermingled with whitespace. In particular, it matches a sequence of 1734matches a sequence of whitespace, possibly empty.
1735whitespace, possibly empty.
1736@end defopt 1735@end defopt
1737 1736
1738@defopt adaptive-fill-first-line-regexp 1737@defopt adaptive-fill-first-line-regexp
@@ -2969,7 +2968,8 @@ A cons cell of the form @code{(foreground-color . @var{color-name})} or
2969just the foreground color or just the background color. 2968just the foreground color or just the background color.
2970 2969
2971@code{(foreground-color . @var{color-name})} is equivalent to 2970@code{(foreground-color . @var{color-name})} is equivalent to
2972@code{(:foreground @var{color-name})}, and likewise for the background. 2971specifying @code{(:foreground @var{color-name})}, and likewise for the
2972background.
2973@end itemize 2973@end itemize
2974 2974
2975You can use Font Lock Mode (@pxref{Font Lock Mode}), to dynamically 2975You can use Font Lock Mode (@pxref{Font Lock Mode}), to dynamically
@@ -3561,9 +3561,9 @@ The action code is always @code{t}.
3561 3561
3562For example, here is how Info mode handles @key{Mouse-1}: 3562For example, here is how Info mode handles @key{Mouse-1}:
3563 3563
3564@example 3564@smallexample
3565(define-key Info-mode-map [follow-link] 'mouse-face) 3565(define-key Info-mode-map [follow-link] 'mouse-face)
3566@end example 3566@end smallexample
3567 3567
3568@item a function 3568@item a function
3569If the condition is a valid function, @var{func}, then a position 3569If the condition is a valid function, @var{func}, then a position
@@ -3574,11 +3574,11 @@ action code.
3574For example, here is how pcvs enables @key{Mouse-1} to follow links on 3574For example, here is how pcvs enables @key{Mouse-1} to follow links on
3575file names only: 3575file names only:
3576 3576
3577@example 3577@smallexample
3578(define-key map [follow-link] 3578(define-key map [follow-link]
3579 (lambda (pos) 3579 (lambda (pos)
3580 (if (eq (get-char-property pos 'face) 'cvs-filename-face) t))) 3580 (eq (get-char-property pos 'face) 'cvs-filename-face)))
3581@end example 3581@end smallexample
3582 3582
3583@item anything else 3583@item anything else
3584If the condition value is anything else, then the position is inside a 3584If the condition value is anything else, then the position is inside a
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 27f0f4a7029..8ee941892c9 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1722,24 +1722,24 @@ be called later, or an expression that would be executed later, simply
1722visiting a file could take over your Emacs. To prevent this, Emacs 1722visiting a file could take over your Emacs. To prevent this, Emacs
1723takes care not to allow to set such file local variables. 1723takes care not to allow to set such file local variables.
1724 1724
1725 For one thing, any variable whose name ends in @samp{-command}, 1725 For one thing, any variable whose name ends in any of
1726@samp{-frame-alist}, @samp{-function}, @samp{-functions}, 1726@samp{-command}, @samp{-frame-alist}, @samp{-function},
1727@samp{-hook}, @samp{-hooks}, @samp{-form}, @samp{-forms}, @samp{-map}, 1727@samp{-functions}, @samp{-hook}, @samp{-hooks}, @samp{-form},
1728@samp{-map-alist}, @samp{-mode-alist}, @samp{-program}, or 1728@samp{-forms}, @samp{-map}, @samp{-map-alist}, @samp{-mode-alist},
1729@samp{-predicate} cannot be given a file local value. In general, 1729@samp{-program}, or @samp{-predicate} cannot be given a file local
1730you should use such a name whenever it is appropriate for the 1730value. In general, you should use such a name whenever it is
1731variable's meaning. The variables @samp{font-lock-keywords}, 1731appropriate for the variable's meaning. The variables
1732@samp{font-lock-keywords-[0-9]}, and 1732@samp{font-lock-keywords}, @samp{font-lock-keywords} followed by a
1733@samp{font-lock-syntactic-keywords} cannot be given file local values either. 1733digit, and @samp{font-lock-syntactic-keywords} cannot be given file
1734These rules can be overridden by giving the variable's 1734local values either. These rules can be overridden by giving the
1735name a non-@code{nil} @code{safe-local-variable} property. If one 1735variable's name a non-@code{nil} @code{safe-local-variable} property.
1736gives it a @code{safe-local-variable} property of @code{t}, then one 1736If one gives it a @code{safe-local-variable} property of @code{t},
1737can give the variable any file local value. One can also give any 1737then one can give the variable any file local value. One can also
1738symbol, including the above, a @code{safe-local-variable} property 1738give any symbol, including the above, a @code{safe-local-variable}
1739that is a function taking exactly one argument. In that case, giving 1739property that is a function taking exactly one argument. In that
1740a variable with that name a file local value is only allowed if the 1740case, giving a variable with that name a file local value is only
1741function returns non-@code{nil} when called with that value as 1741allowed if the function returns non-@code{nil} when called with that
1742argument. 1742value as argument.
1743 1743
1744 In addition, any variable whose name has a non-@code{nil} 1744 In addition, any variable whose name has a non-@code{nil}
1745@code{risky-local-variable} property is also ignored. So are all 1745@code{risky-local-variable} property is also ignored. So are all
@@ -1785,19 +1785,19 @@ chosen, or because its meaning has partly changed---it can be useful
1785to keep the old name as an @emph{alias} of the new one for 1785to keep the old name as an @emph{alias} of the new one for
1786compatibility. You can do this with @code{defvaralias}. 1786compatibility. You can do this with @code{defvaralias}.
1787 1787
1788@defun defvaralias alias-var base-var &optional docstring 1788@defun defvaralias new-alias base-variable &optional docstring
1789This function defines the symbol @var{alias-var} as a variable alias 1789This function defines the symbol @var{new-alias} as a variable alias
1790for symbol @var{base-var}. This means that retrieving the value of 1790for symbol @var{base-variable}. This means that retrieving the value of
1791@var{alias-var} returns the value of @var{base-var}, and changing the 1791@var{new-alias} returns the value of @var{base-variable}, and changing the
1792value of @var{alias-var} changes the value of @var{base-var}. 1792value of @var{new-alias} changes the value of @var{base-variable}.
1793 1793
1794If the @var{docstring} argument is non-@code{nil}, it specifies the 1794If the @var{docstring} argument is non-@code{nil}, it specifies the
1795documentation for @var{alias-var}; otherwise, the alias gets the same 1795documentation for @var{new-alias}; otherwise, the alias gets the same
1796documentation as @var{base-var} has, if any, unless @var{base-var} is 1796documentation as @var{base-variable} has, if any, unless
1797itself an alias, in which case @var{alias-var} gets the documentation 1797@var{base-variable} is itself an alias, in which case @var{new-alias} gets
1798of the variable at the end of the chain of aliases. 1798the documentation of the variable at the end of the chain of aliases.
1799 1799
1800This function returns @var{base-var}. 1800This function returns @var{base-variable}.
1801@end defun 1801@end defun
1802 1802
1803 Variable aliases are convenient for replacing an old name for a 1803 Variable aliases are convenient for replacing an old name for a
@@ -1805,12 +1805,12 @@ variable with a new name. @code{make-obsolete-variable} declares that
1805the old name is obsolete and therefore that it may be removed at some 1805the old name is obsolete and therefore that it may be removed at some
1806stage in the future. 1806stage in the future.
1807 1807
1808@defun make-obsolete-variable variable new &optional when 1808@defun make-obsolete-variable obsolete-name current-name &optional when
1809This function makes the byte-compiler warn that the variable 1809This function makes the byte-compiler warn that the variable
1810@var{variable} is obsolete. If @var{new} is a symbol, it is the 1810@var{obsolete-name} is obsolete. If @var{current-name} is a symbol, it is
1811variable's new name; then the warning message says to use @var{new} 1811the variable's new name; then the warning message says to use
1812instead of @var{variable}. If @var{new} is a string, this is the 1812@var{current-name} instead of @var{obsolete-name}. If @var{current-name}
1813message and there is no replacement variable. 1813is a string, this is the message and there is no replacement variable.
1814 1814
1815If provided, @var{when} should be a string indicating when the 1815If provided, @var{when} should be a string indicating when the
1816variable was first made obsolete---for example, a date or a release 1816variable was first made obsolete---for example, a date or a release
@@ -1820,20 +1820,14 @@ number.
1820 You can make two variables synonyms and declare one obsolete at the 1820 You can make two variables synonyms and declare one obsolete at the
1821same time using the macro @code{define-obsolete-variable-alias}. 1821same time using the macro @code{define-obsolete-variable-alias}.
1822 1822
1823@defmac define-obsolete-variable-alias variable new &optional when docstring 1823@defmac define-obsolete-variable-alias obsolete-name current-name &optional when docstring
1824This macro marks the variable @var{variable} as obsolete and also 1824This macro marks the variable @var{obsolete-name} as obsolete and also
1825makes it an alias for the variable @var{new}. A typical call has the form: 1825makes it an alias for the variable @var{current-name}. It is
1826equivalent to the following:
1826 1827
1827@example 1828@example
1828(define-obsolete-variable-alias 'old-var 'new-var "22.1" "Doc.") 1829(defvaralias @var{obsolete-name} @var{current-name} @var{docstring})
1829@end example 1830(make-obsolete-variable @var{obsolete-name} @var{current-name} @var{when})
1830
1831@noindent
1832which is equivalent to the following two lines of code:
1833
1834@example
1835(defvaralias 'oldvar 'newvar "Doc.")
1836(make-obsolete-variable 'old-var 'new-var "22.1")
1837@end example 1831@end example
1838@end defmac 1832@end defmac
1839 1833