aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-26 18:56:56 +0000
committerRichard M. Stallman1998-05-26 18:56:56 +0000
commit1911e6e52c846c4a5bf744d850ec7061ff90c412 (patch)
tree3f4540f345ab889ce4cd820b52d8962518039687
parente197b151dfa8c6c2eae48c4dc2bed2a7d677c9f3 (diff)
downloademacs-1911e6e52c846c4a5bf744d850ec7061ff90c412.tar.gz
emacs-1911e6e52c846c4a5bf744d850ec7061ff90c412.zip
*** empty log message ***
-rw-r--r--lispref/advice.texi119
-rw-r--r--lispref/anti.texi2
-rw-r--r--lispref/backups.texi22
-rw-r--r--lispref/buffers.texi29
-rw-r--r--lispref/calendar.texi4
-rw-r--r--lispref/commands.texi10
-rw-r--r--lispref/customize.texi6
-rw-r--r--lispref/debugging.texi8
-rw-r--r--lispref/display.texi128
-rw-r--r--lispref/edebug.texi59
-rw-r--r--lispref/elisp.texi19
-rw-r--r--lispref/errors.texi2
-rw-r--r--lispref/frames.texi134
-rw-r--r--lispref/help.texi12
-rw-r--r--lispref/intro.texi4
-rw-r--r--lispref/keymaps.texi57
-rw-r--r--lispref/loading.texi8
-rw-r--r--lispref/markers.texi6
-rw-r--r--lispref/minibuf.texi23
-rw-r--r--lispref/modes.texi37
-rw-r--r--lispref/nonascii.texi83
-rw-r--r--lispref/os.texi50
-rw-r--r--lispref/positions.texi21
-rw-r--r--lispref/processes.texi43
-rw-r--r--lispref/searching.texi14
-rw-r--r--lispref/sequences.texi14
-rw-r--r--lispref/streams.texi23
-rw-r--r--lispref/strings.texi6
-rw-r--r--lispref/syntax.texi11
-rw-r--r--lispref/text.texi144
-rw-r--r--lispref/tips.texi8
-rw-r--r--lispref/variables.texi2
-rw-r--r--lispref/windows.texi128
33 files changed, 773 insertions, 463 deletions
diff --git a/lispref/advice.texi b/lispref/advice.texi
index 3d61ae41c38..24ddb628941 100644
--- a/lispref/advice.texi
+++ b/lispref/advice.texi
@@ -12,10 +12,12 @@ function, by @dfn{advising the function}. This is a clean method for a
12library to customize functions defined by other parts of Emacs---cleaner 12library to customize functions defined by other parts of Emacs---cleaner
13than redefining the whole function. 13than redefining the whole function.
14 14
15 Each piece of advice can be enabled or disabled explicitly. The 15@cindex piece of advice
16enabled pieces of advice for any given function actually take effect 16 Each function can have multiple @dfn{pieces of advice}, separately
17when you activate advice for that function, or when that function is 17defined. Each defined piece of advice can be enabled or disabled
18subsequently defined or redefined. 18explicitly. The enabled pieces of advice for any given function
19actually take effect when you @dfn{activate} advice for that function, or when
20that function is subsequently defined or redefined.
19 21
20 @strong{Usage Note:} Advice is useful for altering the behavior of 22 @strong{Usage Note:} Advice is useful for altering the behavior of
21existing calls to an existing function. If you want the new behavior 23existing calls to an existing function. If you want the new behavior
@@ -25,12 +27,13 @@ function (or a new command) which uses the existing function.
25@menu 27@menu
26* Simple Advice:: A simple example to explain the basics of advice. 28* Simple Advice:: A simple example to explain the basics of advice.
27* Defining Advice:: Detailed description of @code{defadvice}. 29* Defining Advice:: Detailed description of @code{defadvice}.
30* Around-Advice:: Wrapping advice around a function's definition.
28* Computed Advice:: ...is to @code{defadvice} as @code{fset} is to @code{defun}. 31* Computed Advice:: ...is to @code{defadvice} as @code{fset} is to @code{defun}.
29* Activation of Advice:: Advice doesn't do anything until you activate it. 32* Activation of Advice:: Advice doesn't do anything until you activate it.
30* Enabling Advice:: You can enable or disable each piece of advice. 33* Enabling Advice:: You can enable or disable each piece of advice.
31* Preactivation:: Preactivation is a way of speeding up the 34* Preactivation:: Preactivation is a way of speeding up the
32 loading of compiled advice. 35 loading of compiled advice.
33* Argument Access:: How advice can access the function's arguments. 36* Argument Access in Advice:: How advice can access the function's arguments.
34* Subr Arguments:: Accessing arguments when advising a primitive. 37* Subr Arguments:: Accessing arguments when advising a primitive.
35* Combined Definition:: How advice is implemented. 38* Combined Definition:: How advice is implemented.
36@end menu 39@end menu
@@ -63,7 +66,6 @@ this:
63 (newline)))) 66 (newline))))
64@end example 67@end example
65 68
66@cindex piece of advice
67 This expression defines a @dfn{piece of advice} for the function 69 This expression defines a @dfn{piece of advice} for the function
68@code{previous-line}. This piece of advice is named 70@code{previous-line}. This piece of advice is named
69@code{next-line-at-end}, and the symbol @code{before} says that it is 71@code{next-line-at-end}, and the symbol @code{before} says that it is
@@ -100,10 +102,12 @@ expression to wrap around the invocation of the base definition.
100 102
101@node Defining Advice 103@node Defining Advice
102@section Defining Advice 104@section Defining Advice
105@cindex defining advice
106@cindex advice, defining
103 107
104 To define a piece of advice, use the macro @code{defadvice}. A call 108 To define a piece of advice, use the macro @code{defadvice}. A call
105to @code{defadvice} has the following syntax, which is based on the 109to @code{defadvice} has the following syntax, which is based on the
106syntax of @code{defun}/@code{defmacro} but adds more: 110syntax of @code{defun} and @code{defmacro}, but adds more:
107 111
108@findex defadvice 112@findex defadvice
109@example 113@example
@@ -132,14 +136,13 @@ wrapped around the execution of the function itself. After-advice and
132around-advice can override the return value by setting 136around-advice can override the return value by setting
133@code{ad-return-value}. 137@code{ad-return-value}.
134 138
135Around-advice specifies where the ``original'' function definition 139@defvar ad-return-value
136should go by means of the special symbol @code{ad-do-it}. Where this 140While advice is executing, after the function's original definition has
137symbol occurs inside the around-advice body, it is replaced with a 141been executed, this variable holds its return value, which will
138@code{progn} containing the forms of the surrounded code. If the 142ultimately be returned to the caller after finishing all the advice.
139around-advice does not use @code{ad-do-it}, then the original function 143After-advice and around-advice can arrange to return some other value
140definition is never run. This provides a way to override the original 144by storing it in this variable.
141definition completely. (It also overrides lower-positioned pieces of 145@end defvar
142around-advice).
143 146
144The argument @var{name} is the name of the advice, a non-@code{nil} 147The argument @var{name} is the name of the advice, a non-@code{nil}
145symbol. The advice name uniquely identifies one piece of advice, within all 148symbol. The advice name uniquely identifies one piece of advice, within all
@@ -152,11 +155,12 @@ definition calls for several different pieces of information.
152 155
153The optional @var{position} specifies where, in the current list of 156The optional @var{position} specifies where, in the current list of
154advice of the specified @var{class}, this new advice should be placed. 157advice of the specified @var{class}, this new advice should be placed.
155It should be either @code{first}, @code{last} or a number that 158It should be either @code{first}, @code{last} or a number that specifies
156specifies a zero-based position (@code{first} is equivalent to 0). If 159a zero-based position (@code{first} is equivalent to 0). If no position
157no position is specified, the default is @code{first}. The 160is specified, the default is @code{first}. Position values outside the
158@var{position} value is ignored when redefining an existing piece of 161range of existing positions in this class are mapped to the beginning or
159advice. 162the end of the range, whichever is closer. The @var{position} value is
163ignored when redefining an existing piece of advice.
160 164
161The optional @var{arglist} can be used to define the argument list for 165The optional @var{arglist} can be used to define the argument list for
162the sake of advice. This becomes the argument list of the combined 166the sake of advice. This becomes the argument list of the combined
@@ -168,12 +172,11 @@ This argument list must be compatible with the argument list of the
168original function, so that it can handle the ways the function is 172original function, so that it can handle the ways the function is
169actually called. If more than one piece of advice specifies an argument 173actually called. If more than one piece of advice specifies an argument
170list, then the first one (the one with the smallest position) found in 174list, then the first one (the one with the smallest position) found in
171the list of all classes of advice is used. Numbers outside the range 175the list of all classes of advice is used.
172are mapped to the beginning or the end, whichever is closer.
173 176
174The remaining elements, @var{flags}, is a list of symbols that specify 177The remaining elements, @var{flags}, are symbols that specify further
175further information about how to use this piece of advice. Here are the 178information about how to use this piece of advice. Here are the valid
176valid symbols and their meanings: 179symbols and their meanings:
177 180
178@table @code 181@table @code
179@item activate 182@item activate
@@ -190,8 +193,8 @@ activate an undefined function's advice. However, defining
190 193
191@item protect 194@item protect
192Protect this piece of advice against non-local exits and errors in 195Protect this piece of advice against non-local exits and errors in
193preceding code and advice. Protecting advice makes it a cleanup in an 196preceding code and advice. Protecting advice places it as a cleanup in
194@code{unwind-protect} form, so that it will execute even if the 197an @code{unwind-protect} form, so that it will execute even if the
195previous code gets an error or uses @code{throw}. @xref{Cleanups}. 198previous code gets an error or uses @code{throw}. @xref{Cleanups}.
196 199
197@item compile 200@item compile
@@ -233,6 +236,38 @@ expanded when a program is compiled, not when a compiled program is run.
233All subroutines used by the advice need to be available when the byte 236All subroutines used by the advice need to be available when the byte
234compiler expands the macro. 237compiler expands the macro.
235 238
239@node Around-Advice
240@section Around-Advice
241
242 Around-advice lets you ``wrap'' a Lisp expression ``around'' the
243original function definition. You specify where the original function
244definition should go by means of the special symbol @code{ad-do-it}.
245Where this symbol occurs inside the around-advice body, it is replaced
246with a @code{progn} containing the forms of the surrounded code. Here
247is an example:
248
249@example
250(defadvice foo (around foo-around)
251 "Ignore case in `foo'."
252 (let ((case-fold-search t))
253 ad-do-it))
254@end example
255
256@noindent
257Its effect is to make sure that case is ignored in
258searches when the original definition of @code{foo} is run.
259
260@defvar ad-do-it
261This is not really a variable, but it is somewhat used like one
262in around-advice. It specifies the place to run the function's
263original definition and other ``earlier'' around-advice.
264@end defvar
265
266If the around-advice does not use @code{ad-do-it}, then it does not run
267the original function definition. This provides a way to override the
268original definition completely. (It also overrides lower-positioned
269pieces of around-advice).
270
236@node Computed Advice 271@node Computed Advice
237@section Computed Advice 272@section Computed Advice
238 273
@@ -270,6 +305,7 @@ replaced with the new one.
270@node Activation of Advice 305@node Activation of Advice
271@section Activation of Advice 306@section Activation of Advice
272@cindex activating advice 307@cindex activating advice
308@cindex advice, activating
273 309
274By default, advice does not take effect when you define it---only when 310By default, advice does not take effect when you define it---only when
275you @dfn{activate} advice for the function that was advised. You can 311you @dfn{activate} advice for the function that was advised. You can
@@ -302,10 +338,13 @@ This command activates the advice for @var{function}.
302 338
303To activate advice for a function whose advice is already active is not 339To activate advice for a function whose advice is already active is not
304a no-op. It is a useful operation which puts into effect any changes in 340a no-op. It is a useful operation which puts into effect any changes in
305advice since the previous activation of that function's advice. 341that function's advice since the previous activation of advice for that
342function.
306 343
307@deffn Command ad-deactivate function 344@deffn Command ad-deactivate function
308This command deactivates the advice for @var{function}. 345This command deactivates the advice for @var{function}.
346@cindex deactivating advice
347@cindex advice, deactivating
309@end deffn 348@end deffn
310 349
311@deffn Command ad-activate-all &optional compile 350@deffn Command ad-activate-all &optional compile
@@ -323,7 +362,7 @@ which has at least one piece of advice that matches @var{regexp}.
323@end deffn 362@end deffn
324 363
325@deffn Command ad-deactivate-regexp regexp 364@deffn Command ad-deactivate-regexp regexp
326This command deactivates the advice for all functions whose names match 365This command deactivates all pieces of advice whose names match
327@var{regexp}. More precisely, it deactivates all advice for any 366@var{regexp}. More precisely, it deactivates all advice for any
328function which has at least one piece of advice that matches 367function which has at least one piece of advice that matches
329@var{regexp}. 368@var{regexp}.
@@ -332,6 +371,7 @@ function which has at least one piece of advice that matches
332@deffn Command ad-update-regexp regexp &optional compile 371@deffn Command ad-update-regexp regexp &optional compile
333This command activates pieces of advice whose names match @var{regexp}, 372This command activates pieces of advice whose names match @var{regexp},
334but only those for functions whose advice is already activated. 373but only those for functions whose advice is already activated.
374@cindex reactivating advice
335 375
336Reactivating a function's advice is useful for putting into effect all 376Reactivating a function's advice is useful for putting into effect all
337the changes that have been made in its advice (including enabling and 377the changes that have been made in its advice (including enabling and
@@ -355,17 +395,20 @@ This variable controls whether to compile the combined definition
355that results from activating advice for a function. 395that results from activating advice for a function.
356@end defopt 396@end defopt
357 397
358 If the advised definition was constructed during ``preactivation'' (see 398 If the advised definition was constructed during ``preactivation''
359below), then that definition must already be compiled, because it was 399(@pxref{Preactivation}), then that definition must already be compiled,
360constructed during byte-compilation of the file that contained the 400because it was constructed during byte-compilation of the file that
361@code{defadvice} with the @code{preactivate} flag. 401contained the @code{defadvice} with the @code{preactivate} flag.
362 402
363@node Enabling Advice 403@node Enabling Advice
364@section Enabling and Disabling Advice 404@section Enabling and Disabling Advice
405@cindex enabling advice
406@cindex advice, enabling and disabling
407@cindex disabling advice
365 408
366 Each piece of advice has a flag that says whether it is enabled or 409 Each piece of advice has a flag that says whether it is enabled or
367not. By enabling or disabling a piece of advice, you can turn it off 410not. By enabling or disabling a piece of advice, you can turn it on
368and on without having to undefine and redefine it. For example, here is 411and off without having to undefine and redefine it. For example, here is
369how to disable a particular piece of advice named @code{my-advice} for 412how to disable a particular piece of advice named @code{my-advice} for
370the function @code{foo}: 413the function @code{foo}:
371 414
@@ -373,7 +416,7 @@ the function @code{foo}:
373(ad-disable-advice 'foo 'before 'my-advice) 416(ad-disable-advice 'foo 'before 'my-advice)
374@end example 417@end example
375 418
376This function by itself only changes the enable flag for a piece of 419 This function by itself only changes the enable flag for a piece of
377advice. To make the change take effect in the advised definition, you 420advice. To make the change take effect in the advised definition, you
378must activate the advice for @code{foo} again: 421must activate the advice for @code{foo} again:
379 422
@@ -408,6 +451,8 @@ This command enables all pieces of advice whose names match
408 451
409@node Preactivation 452@node Preactivation
410@section Preactivation 453@section Preactivation
454@cindex preactivating advice
455@cindex advice, preactivating
411 456
412 Constructing a combined definition to execute advice is moderately 457 Constructing a combined definition to execute advice is moderately
413expensive. When a library advises many functions, this can make loading 458expensive. When a library advises many functions, this can make loading
@@ -486,7 +531,7 @@ for that function.
486 A more robust method is to use macros that are translated into the 531 A more robust method is to use macros that are translated into the
487proper access forms at activation time, i.e., when constructing the 532proper access forms at activation time, i.e., when constructing the
488advised definition. Access macros access actual arguments by position 533advised definition. Access macros access actual arguments by position
489regardless of how these actual argument get distributed onto the 534regardless of how these actual arguments get distributed onto the
490argument variables of a function. This is robust because in Emacs Lisp 535argument variables of a function. This is robust because in Emacs Lisp
491the meaning of an argument is strictly determined by its position in the 536the meaning of an argument is strictly determined by its position in the
492argument list. 537argument list.
diff --git a/lispref/anti.texi b/lispref/anti.texi
index d93e99cf962..d9873088f17 100644
--- a/lispref/anti.texi
+++ b/lispref/anti.texi
@@ -73,7 +73,7 @@ or the strings are not equal.
73or specified padding. 73or specified padding.
74 74
75@item 75@item
76The functions @code{split-string} and @code{concat-chars} no longer exist. 76The functions @code{split-string} and @code{string} no longer exist.
77Neither does @code{store-substring} or @code{sref}. 77Neither does @code{store-substring} or @code{sref}.
78 78
79@item 79@item
diff --git a/lispref/backups.texi b/lispref/backups.texi
index 3cdd88d5c08..e18c2ba7826 100644
--- a/lispref/backups.texi
+++ b/lispref/backups.texi
@@ -588,17 +588,17 @@ about them, you can get rid of them by reading in the previous version
588of the file with the @code{revert-buffer} command. @xref{Reverting, , 588of the file with the @code{revert-buffer} command. @xref{Reverting, ,
589Reverting a Buffer, emacs, The GNU Emacs Manual}. 589Reverting a Buffer, emacs, The GNU Emacs Manual}.
590 590
591@deffn Command revert-buffer &optional check-auto-save noconfirm 591@deffn Command revert-buffer &optional ignore-auto noconfirm
592This command replaces the buffer text with the text of the visited 592This command replaces the buffer text with the text of the visited
593file on disk. This action undoes all changes since the file was visited 593file on disk. This action undoes all changes since the file was visited
594or saved. 594or saved.
595 595
596If the argument @var{check-auto-save} is non-@code{nil}, and the 596By default, if the latest auto-save file is more recent than the visited
597latest auto-save file is more recent than the visited file, 597file, @code{revert-buffer} asks the user whether to use that instead.
598@code{revert-buffer} asks the user whether to use that instead. 598But if the argument @var{ignore-auto} is non-@code{nil}, then only the
599Otherwise, it always uses the text of the visited file itself. 599the visited file itself is used. Interactively, @var{ignore-auto} is
600Interactively, @var{check-auto-save} is set if there is a numeric prefix 600@code{t} unless there is a numeric prefix argument; thus, the
601argument. 601interactive default is to check the auto-save file.
602 602
603Normally, @code{revert-buffer} asks for confirmation before it changes 603Normally, @code{revert-buffer} asks for confirmation before it changes
604the buffer; but if the argument @var{noconfirm} is non-@code{nil}, 604the buffer; but if the argument @var{noconfirm} is non-@code{nil},
@@ -616,6 +616,14 @@ buffer. Preserving any additional markers would be problematical.
616You can customize how @code{revert-buffer} does its work by setting 616You can customize how @code{revert-buffer} does its work by setting
617these variables---typically, as buffer-local variables. 617these variables---typically, as buffer-local variables.
618 618
619@defvar revert-without-query
620This variable holds a list of files that should be reverted without
621query. The value is a list of regular expressions. If a file name
622matches one of these regular expressions, then @code{revert-buffer}
623reverts the file without asking the user for confirmation, if the file
624has changed on disk and the buffer is not modified.
625@end defvar
626
619@defvar revert-buffer-function 627@defvar revert-buffer-function
620The value of this variable is the function to use to revert this buffer. 628The value of this variable is the function to use to revert this buffer.
621If non-@code{nil}, it is called as a function with no arguments to do 629If non-@code{nil}, it is called as a function with no arguments to do
diff --git a/lispref/buffers.texi b/lispref/buffers.texi
index c54f1e6b9b0..f1227d60705 100644
--- a/lispref/buffers.texi
+++ b/lispref/buffers.texi
@@ -213,7 +213,7 @@ If the buffer that used to be current has been killed by the time of
213exit from @code{save-current-buffer}, then it is not made current again, 213exit from @code{save-current-buffer}, then it is not made current again,
214of course. Instead, whichever buffer was current just before exit 214of course. Instead, whichever buffer was current just before exit
215remains current. 215remains current.
216@end defmac 216@end defspec
217 217
218@defmac with-current-buffer buffer body... 218@defmac with-current-buffer buffer body...
219@tindex with-current-buffer 219@tindex with-current-buffer
@@ -427,7 +427,7 @@ the same file name. In such cases, this function returns the first
427such buffer in the buffer list. 427such buffer in the buffer list.
428@end defun 428@end defun
429 429
430@deffn Command set-visited-file-name filename 430@deffn Command set-visited-file-name filename &optional no-query along-with-file
431If @var{filename} is a non-empty string, this function changes the 431If @var{filename} is a non-empty string, this function changes the
432name of the file visited in current buffer to @var{filename}. (If the 432name of the file visited in current buffer to @var{filename}. (If the
433buffer had no visited file, this gives it one.) The @emph{next time} 433buffer had no visited file, this gives it one.) The @emph{next time}
@@ -440,6 +440,13 @@ If @var{filename} is @code{nil} or the empty string, that stands for
440``no visited file''. In this case, @code{set-visited-file-name} marks 440``no visited file''. In this case, @code{set-visited-file-name} marks
441the buffer as having no visited file. 441the buffer as having no visited file.
442 442
443Normally, this function asks the user for confirmation if the specified
444file already exists. If @var{no-query} is non-@code{nil}, that prevents
445asking this question.
446
447If @var{along-with-file} is non-@code{nil}, that means to assume that the
448former visited file has been renamed to @var{filename}.
449
443@c Wordy to avoid overfull hbox. --rjc 16mar92 450@c Wordy to avoid overfull hbox. --rjc 16mar92
444When the function @code{set-visited-file-name} is called interactively, it 451When the function @code{set-visited-file-name} is called interactively, it
445prompts for @var{filename} in the minibuffer. 452prompts for @var{filename} in the minibuffer.
@@ -723,21 +730,21 @@ live buffer.
723@code{buffer-list} frame parameter with @code{modify-frame-parameters} 730@code{buffer-list} frame parameter with @code{modify-frame-parameters}
724(@pxref{Parameter Access}). 731(@pxref{Parameter Access}).
725 732
726@defun other-buffer &optional buffer visible-ok 733@defun other-buffer &optional buffer visible-ok frame
727This function returns the first buffer in the buffer list other than 734This function returns the first buffer in the buffer list other than
728@var{buffer}. Usually this is the buffer selected most recently (in the 735@var{buffer}. Usually this is the buffer selected most recently (in
729currently selected frame), aside from @var{buffer}. Buffers whose names 736frame @var{frame} or else the currently selected frame), aside from
730start with a space are not considered at all. 737@var{buffer}. Buffers whose names start with a space are not considered
738at all.
731 739
732If @var{buffer} is not supplied (or if it is not a buffer), then 740If @var{buffer} is not supplied (or if it is not a buffer), then
733@code{other-buffer} returns the first buffer in the selected frame's 741@code{other-buffer} returns the first buffer in the selected frame's
734buffer list that is not now visible in any window in a visible frame. 742buffer list that is not now visible in any window in a visible frame.
735 743
736If the selected frame has a non-@code{nil} @code{buffer-predicate} 744If @var{frame} has a non-@code{nil} @code{buffer-predicate} parameter,
737parameter, then @code{other-buffer} uses that predicate to decide which 745then @code{other-buffer} uses that predicate to decide which buffers to
738buffers to consider. It calls the predicate once for each buffer, and 746consider. It calls the predicate once for each buffer, and if the value
739if the value is @code{nil}, that buffer is ignored. @xref{Window Frame 747is @code{nil}, that buffer is ignored. @xref{Window Frame Parameters}.
740Parameters}.
741 748
742@c Emacs 19 feature 749@c Emacs 19 feature
743If @var{visible-ok} is @code{nil}, @code{other-buffer} avoids returning 750If @var{visible-ok} is @code{nil}, @code{other-buffer} avoids returning
diff --git a/lispref/calendar.texi b/lispref/calendar.texi
index ff1fec3cffc..171f6a2263a 100644
--- a/lispref/calendar.texi
+++ b/lispref/calendar.texi
@@ -577,7 +577,7 @@ HHeshvan 25 Happy Hebrew birthday!
577 577
578@noindent 578@noindent
579and would appear in the diary for any date that corresponds to Heshvan 25 579and would appear in the diary for any date that corresponds to Heshvan 25
580on the Hebrew calendar. And here is Islamic-date diary entry that matches 580on the Hebrew calendar. And here is an Islamic-date diary entry that matches
581Dhu al-Qada 25: 581Dhu al-Qada 25:
582 582
583@smallexample 583@smallexample
@@ -668,7 +668,7 @@ shown in the fancy diary buffer, set the variable
668@cindex sorting diary entries 668@cindex sorting diary entries
669 If you use the fancy diary display, you can use the normal hook 669 If you use the fancy diary display, you can use the normal hook
670@code{list-diary-entries-hook} to sort each day's diary entries by their 670@code{list-diary-entries-hook} to sort each day's diary entries by their
671time of day. Here's how 671time of day. Here's how:
672 672
673@findex sort-diary-entries 673@findex sort-diary-entries
674@example 674@example
diff --git a/lispref/commands.texi b/lispref/commands.texi
index 49c9d3c16e3..7690b4e1497 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -1589,7 +1589,7 @@ buffer position. Here's how to do that:
1589 (- (point-max) (point-min)))) 1589 (- (point-max) (point-min))))
1590@end example 1590@end example
1591 1591
1592Recall that scroll bar events have two integers forming ratio in place 1592Recall that scroll bar events have two integers forming a ratio, in place
1593of a pair of x and y coordinates. 1593of a pair of x and y coordinates.
1594@end defun 1594@end defun
1595 1595
@@ -1652,7 +1652,8 @@ and such numbers cannot be included in a string.
1652 1652
1653 To support programs with @samp{\M-} in string constants, there are 1653 To support programs with @samp{\M-} in string constants, there are
1654special rules for including certain meta characters in a string. 1654special rules for including certain meta characters in a string.
1655Here are the rules for interpreting keyboard 1655Here are the rules for interpreting a string as a sequence of input
1656characters:
1656 1657
1657@itemize @bullet 1658@itemize @bullet
1658@item 1659@item
@@ -1854,7 +1855,7 @@ If @code{cursor-in-echo-area} is non-@code{nil}, then @code{read-event}
1854moves the cursor temporarily to the echo area, to the end of any message 1855moves the cursor temporarily to the echo area, to the end of any message
1855displayed there. Otherwise @code{read-event} does not move the cursor. 1856displayed there. Otherwise @code{read-event} does not move the cursor.
1856 1857
1857If @code{read-event} gets an event is defined as a help character, in 1858If @code{read-event} gets an event that is defined as a help character, in
1858some cases @code{read-event} processes the event directly without 1859some cases @code{read-event} processes the event directly without
1859returning. @xref{Help Functions}. Certain other events, called 1860returning. @xref{Help Functions}. Certain other events, called
1860@dfn{special events}, are also processed directly within 1861@dfn{special events}, are also processed directly within
@@ -1948,7 +1949,8 @@ What character-@kbd{177}
1948 1949
1949This section describes how to ``peek ahead'' at events without using 1950This section describes how to ``peek ahead'' at events without using
1950them up, how to check for pending input, and how to discard pending 1951them up, how to check for pending input, and how to discard pending
1951input. 1952input. See also the function @code{read-passwd} (@pxref{Reading a
1953Password}).
1952 1954
1953@defvar unread-command-events 1955@defvar unread-command-events
1954@cindex next input 1956@cindex next input
diff --git a/lispref/customize.texi b/lispref/customize.texi
index dffd3de49a3..f581fc42345 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -372,9 +372,9 @@ The value must be a directory name, and you can do completion with
372@item hook 372@item hook
373The value must be a list of functions (or a single function, but that is 373The value must be a list of functions (or a single function, but that is
374obsolete usage). This customization type is used for hook variables. 374obsolete usage). This customization type is used for hook variables.
375You can use the @code{:option} in the @code{defcustom} for a hook 375You can use the @code{:options} keyword in a hook variable's
376variable to specify functions recommended for use in the hook; 376@code{defcustom} to specify a list of functions recommended for use in
377see @ref{Variable Definitions}. 377the hook; see @ref{Variable Definitions}.
378 378
379@item symbol 379@item symbol
380The value must be a symbol. It appears in the customization buffer as 380The value must be a symbol. It appears in the customization buffer as
diff --git a/lispref/debugging.texi b/lispref/debugging.texi
index 8e5ed2834a5..6f46c37c21f 100644
--- a/lispref/debugging.texi
+++ b/lispref/debugging.texi
@@ -124,7 +124,7 @@ the debugger gets a chance.
124If you set @code{debug-on-signal} to a non-@code{nil} value, then the 124If you set @code{debug-on-signal} to a non-@code{nil} value, then the
125debugger gets the first chance at every error; an error will invoke the 125debugger gets the first chance at every error; an error will invoke the
126debugger regardless of any @code{condition-case}, if it fits the 126debugger regardless of any @code{condition-case}, if it fits the
127criterion specified by the values of @code{debug-on-error} and 127criteria specified by the values of @code{debug-on-error} and
128@code{debug-ignored-errors}. 128@code{debug-ignored-errors}.
129 129
130@strong{Warning:} This variable is strong medicine! Various parts of 130@strong{Warning:} This variable is strong medicine! Various parts of
@@ -139,9 +139,9 @@ enter the debugger.
139 139
140 To debug an error that happens during loading of the @file{.emacs} 140 To debug an error that happens during loading of the @file{.emacs}
141file, use the option @samp{--debug-init}, which binds 141file, use the option @samp{--debug-init}, which binds
142@code{debug-on-error} to @code{t} while @file{.emacs} is loaded, and 142@code{debug-on-error} to @code{t} while loading @file{.emacs}, and
143bypasses the @code{condition-case} which normally catches errors in the 143bypasses the @code{condition-case} which normally catches errors in the
144init-file. 144init file.
145 145
146 If your @file{.emacs} file sets @code{debug-on-error}, the effect may 146 If your @file{.emacs} file sets @code{debug-on-error}, the effect may
147not last past the end of loading @file{.emacs}. (This is an undesirable 147not last past the end of loading @file{.emacs}. (This is an undesirable
@@ -737,7 +737,7 @@ the old indentation actually fit the intended nesting of parentheses,
737and you have put back those parentheses, @kbd{C-M-q} should not change 737and you have put back those parentheses, @kbd{C-M-q} should not change
738anything. 738anything.
739 739
740@node Compilation Errors, Edebug, Syntax Errors, Debugging 740@node Compilation Errors
741@section Debugging Problems in Compilation 741@section Debugging Problems in Compilation
742 742
743 When an error happens during byte compilation, it is normally due to 743 When an error happens during byte compilation, it is normally due to
diff --git a/lispref/display.texi b/lispref/display.texi
index 4b09a8b3372..e3680f95815 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -11,7 +11,6 @@ that Emacs presents to the user.
11 11
12@menu 12@menu
13* Refresh Screen:: Clearing the screen and redrawing everything on it. 13* Refresh Screen:: Clearing the screen and redrawing everything on it.
14* Screen Size:: How big is the Emacs screen.
15* Truncation:: Folding or wrapping long text lines. 14* Truncation:: Folding or wrapping long text lines.
16* The Echo Area:: Where messages are displayed. 15* The Echo Area:: Where messages are displayed.
17* Invisible Text:: Hiding part of the buffer text. 16* Invisible Text:: Hiding part of the buffer text.
@@ -33,7 +32,7 @@ that Emacs presents to the user.
33@section Refreshing the Screen 32@section Refreshing the Screen
34 33
35The function @code{redraw-frame} redisplays the entire contents of a 34The function @code{redraw-frame} redisplays the entire contents of a
36given frame. @xref{Frames}. 35given frame (@pxref{Frames}).
37 36
38@c Emacs 19 feature 37@c Emacs 19 feature
39@defun redraw-frame frame 38@defun redraw-frame frame
@@ -65,65 +64,6 @@ has been suspended and resumed. Non-@code{nil} means there is no need
65to redraw, @code{nil} means redrawing is needed. The default is @code{nil}. 64to redraw, @code{nil} means redrawing is needed. The default is @code{nil}.
66@end defvar 65@end defvar
67 66
68@node Screen Size
69@section Screen Size
70@cindex size of screen
71@cindex screen size
72@cindex display lines
73@cindex display columns
74@cindex resize redisplay
75
76 The screen size functions access or specify the height or width of
77the terminal. When you are using multiple frames, they apply to the
78selected frame (@pxref{Frames}).
79
80@defun screen-height
81This function returns the number of lines on the screen that are
82available for display.
83
84@example
85@group
86(screen-height)
87 @result{} 50
88@end group
89@end example
90@end defun
91
92@defun screen-width
93This function returns the number of columns on the screen that are
94available for display.
95
96@example
97@group
98(screen-width)
99 @result{} 80
100@end group
101@end example
102@end defun
103
104@defun set-screen-height lines &optional not-actual-size
105This function declares that the terminal can display @var{lines} lines.
106The sizes of existing windows are altered proportionally to fit.
107
108If @var{not-actual-size} is non-@code{nil}, then Emacs displays
109@var{lines} lines of output, but does not change its value for the
110actual height of the screen. (Knowing the correct actual size may be
111necessary for correct cursor positioning.) Using a smaller height than
112the terminal actually implements may be useful to reproduce behavior
113observed on a smaller screen, or if the terminal malfunctions when using
114its whole screen.
115
116If @var{lines} is different from what it was previously, then the
117entire screen is cleared and redisplayed using the new size.
118
119This function returns @code{nil}.
120@end defun
121
122@defun set-screen-width columns &optional not-actual-size
123This function declares that the terminal can display @var{columns}
124columns. The details are as in @code{set-screen-height}.
125@end defun
126
127@node Truncation 67@node Truncation
128@section Truncation 68@section Truncation
129@cindex line wrapping 69@cindex line wrapping
@@ -173,7 +113,7 @@ a window, that forces truncation.
173 You can override the glyphs that indicate continuation or truncation 113 You can override the glyphs that indicate continuation or truncation
174using the display table; see @ref{Display Tables}. 114using the display table; see @ref{Display Tables}.
175 115
176 If your buffer contains @strong{very} long lines, and you use 116 If your buffer contains @emph{very} long lines, and you use
177continuation to display them, just thinking about them can make Emacs 117continuation to display them, just thinking about them can make Emacs
178redisplay slow. The column computation and indentation functions also 118redisplay slow. The column computation and indentation functions also
179become slow. Then you might find it advisable to set 119become slow. Then you might find it advisable to set
@@ -395,7 +335,7 @@ overlaps the overlay on exit from the search.
395 335
396 During the search, such overlays are made temporarily visible by 336 During the search, such overlays are made temporarily visible by
397temporarily modifying their invisible and intangible properties. If you 337temporarily modifying their invisible and intangible properties. If you
398want this to be done differently for a certain overlays, give it a 338want this to be done differently for a certain overlay, give it a
399@code{isearch-open-invisible-temporary} property which is a function. 339@code{isearch-open-invisible-temporary} property which is a function.
400The function is called with two arguments: the first is the overlay, and 340The function is called with two arguments: the first is the overlay, and
401the second is @code{t} to make the overlay visible, or @code{nil} to 341the second is @code{t} to make the overlay visible, or @code{nil} to
@@ -1093,7 +1033,7 @@ subsequent elements of @var{spec} are never used. Normally
1093@code{t} is used in the last (or only) element of @var{spec}. 1033@code{t} is used in the last (or only) element of @var{spec}.
1094 1034
1095@item a list 1035@item a list
1096If @var{display} is alist, each elements should have the form 1036If @var{display} is a list, each element should have the form
1097@code{(@var{characteristic} @var{value}@dots{})}. Here 1037@code{(@var{characteristic} @var{value}@dots{})}. Here
1098@var{characteristic} specifies a way of classifying frames, and the 1038@var{characteristic} specifies a way of classifying frames, and the
1099@var{value}s are possible classifications which @var{display} should 1039@var{value}s are possible classifications which @var{display} should
@@ -1110,7 +1050,7 @@ What kinds of colors the frame supports---either @code{color},
1110@code{grayscale}, or @code{mono}. 1050@code{grayscale}, or @code{mono}.
1111 1051
1112@item background 1052@item background
1113The kind of background--- either @code{light} or @code{dark}. 1053The kind of background---either @code{light} or @code{dark}.
1114@end table 1054@end table
1115 1055
1116If an element of @var{display} specifies more than one @var{value} for a 1056If an element of @var{display} specifies more than one @var{value} for a
@@ -1139,6 +1079,15 @@ with @code{defface}:
1139with the customization buffer, and @code{face-documentation} for the 1079with the customization buffer, and @code{face-documentation} for the
1140documentation string. 1080documentation string.
1141 1081
1082@tindex frame-background-mode
1083@defopt frame-background-mode
1084This option, if non-@code{nil}, specifies the background type to use for
1085interpreting face definitions. If it is @code{dark}, then Emacs treats
1086all frames as if they had a dark background, regardless of their actual
1087background colors. If it is @code{light}, then Emacs treats all frames
1088as if they had a light background.
1089@end defopt
1090
1142@node Merging Faces 1091@node Merging Faces
1143@subsection Merging Faces for Display 1092@subsection Merging Faces for Display
1144 1093
@@ -1339,6 +1288,12 @@ for more information about Transient Mark mode.
1339Normally, the value is the face number of the face named @code{region}. 1288Normally, the value is the face number of the face named @code{region}.
1340@end defvar 1289@end defvar
1341 1290
1291@tindex frame-update-face-colors
1292@defun frame-update-face-colors frame
1293This function updates the way faces display on @var{frame}, for a change
1294in @var{frame}'s foreground or background color.
1295@end defun
1296
1342@node Blinking 1297@node Blinking
1343@section Blinking Parentheses 1298@section Blinking Parentheses
1344@cindex parenthesis matching 1299@cindex parenthesis matching
@@ -1356,23 +1311,23 @@ The value of @code{blink-paren-function} may be @code{nil}, in which
1356case nothing is done. 1311case nothing is done.
1357@end defvar 1312@end defvar
1358 1313
1359@defvar blink-matching-paren 1314@defopt blink-matching-paren
1360If this variable is @code{nil}, then @code{blink-matching-open} does 1315If this variable is @code{nil}, then @code{blink-matching-open} does
1361nothing. 1316nothing.
1362@end defvar 1317@end defopt
1363 1318
1364@defvar blink-matching-paren-distance 1319@defopt blink-matching-paren-distance
1365This variable specifies the maximum distance to scan for a matching 1320This variable specifies the maximum distance to scan for a matching
1366parenthesis before giving up. 1321parenthesis before giving up.
1367@end defvar 1322@end defopt
1368 1323
1369@defvar blink-matching-paren-delay 1324@defopt blink-matching-delay
1370This variable specifies the number of seconds for the cursor to remain 1325This variable specifies the number of seconds for the cursor to remain
1371at the matching parenthesis. A fraction of a second often gives 1326at the matching parenthesis. A fraction of a second often gives
1372good results, but the default is 1, which works on all systems. 1327good results, but the default is 1, which works on all systems.
1373@end defvar 1328@end defopt
1374 1329
1375@defun blink-matching-open 1330@deffn Command blink-matching-open
1376This function is the default value of @code{blink-paren-function}. It 1331This function is the default value of @code{blink-paren-function}. It
1377assumes that point follows a character with close parenthesis syntax and 1332assumes that point follows a character with close parenthesis syntax and
1378moves the cursor momentarily to the matching opening character. If that 1333moves the cursor momentarily to the matching opening character. If that
@@ -1398,7 +1353,7 @@ Here is an example of calling this function explicitly.
1398 (blink-matching-open))) 1353 (blink-matching-open)))
1399@end group 1354@end group
1400@end smallexample 1355@end smallexample
1401@end defun 1356@end deffn
1402 1357
1403@node Inverse Video 1358@node Inverse Video
1404@section Inverse Video 1359@section Inverse Video
@@ -1655,13 +1610,13 @@ below).
1655 1610
1656 Here are the possible types of elements in the glyph table: 1611 Here are the possible types of elements in the glyph table:
1657 1612
1658@table @var 1613@table @asis
1659@item string 1614@item @var{string}
1660Send the characters in @var{string} to the terminal to output 1615Send the characters in @var{string} to the terminal to output
1661this glyph. This alternative is available on character terminals, 1616this glyph. This alternative is available on character terminals,
1662but not under a window system. 1617but not under a window system.
1663 1618
1664@item integer 1619@item @var{integer}
1665Define this glyph code as an alias for glyph code @var{integer}. You 1620Define this glyph code as an alias for glyph code @var{integer}. You
1666can use an alias to specify a face code for the glyph; see below. 1621can use an alias to specify a face code for the glyph; see below.
1667 1622
@@ -1705,13 +1660,13 @@ It also terminates any keyboard macro currently executing unless
1705This is a synonym for @code{ding}. 1660This is a synonym for @code{ding}.
1706@end defun 1661@end defun
1707 1662
1708@defvar visible-bell 1663@defopt visible-bell
1709This variable determines whether Emacs should flash the screen to 1664This variable determines whether Emacs should flash the screen to
1710represent a bell. Non-@code{nil} means yes, @code{nil} means no. This 1665represent a bell. Non-@code{nil} means yes, @code{nil} means no. This
1711is effective on a window system, and on a character-only terminal 1666is effective on a window system, and on a character-only terminal
1712provided the terminal's Termcap entry defines the visible bell 1667provided the terminal's Termcap entry defines the visible bell
1713capability (@samp{vb}). 1668capability (@samp{vb}).
1714@end defvar 1669@end defopt
1715 1670
1716@defvar ring-bell-function 1671@defvar ring-bell-function
1717@tindex ring-bell-function 1672@tindex ring-bell-function
@@ -1728,11 +1683,20 @@ differently. An Emacs frame is a single window as far as X is
1728concerned; the individual Emacs windows are not known to X at all. 1683concerned; the individual Emacs windows are not known to X at all.
1729 1684
1730@defvar window-system 1685@defvar window-system
1731@cindex X Window System
1732This variable tells Lisp programs what window system Emacs is running 1686This variable tells Lisp programs what window system Emacs is running
1733under. Its value should be a symbol such as @code{x} (if Emacs is 1687under. The possible values are
1734running under X) or @code{nil} (if Emacs is running on an ordinary 1688
1735terminal). 1689@table @code
1690@item x
1691@cindex X Window System
1692Emacs is displaying using X.
1693@item pc
1694Emacs is displaying using MSDOS.
1695@item w32
1696Emacs is displaying using Windows NT or Windows 95.
1697@item nil
1698Emacs is using a character-based terminal.
1699@end table
1736@end defvar 1700@end defvar
1737 1701
1738@defvar window-setup-hook 1702@defvar window-setup-hook
diff --git a/lispref/edebug.texi b/lispref/edebug.texi
index c93330e38ae..03a8a6940f6 100644
--- a/lispref/edebug.texi
+++ b/lispref/edebug.texi
@@ -9,7 +9,7 @@
9 9
10@c , Bugs and Todo List, Top, Top 10@c , Bugs and Todo List, Top, Top
11 11
12@node Edebug,, Compilation Errors, Debugging 12@node Edebug, Syntax Errors, Debugger, Debugging
13@section Edebug 13@section Edebug
14@cindex Edebug mode 14@cindex Edebug mode
15 15
@@ -583,10 +583,12 @@ position (@code{edebug-bounce-point}). With a prefix argument @var{n},
583pause for @var{n} seconds instead. 583pause for @var{n} seconds instead.
584 584
585@item w 585@item w
586Move point back to the current stop point (@code{edebug-where}) in the 586Move point back to the current stop point in the source code buffer
587source code buffer. Also, if you use this command in a different window 587(@code{edebug-where}).
588displaying the same buffer, that window will be used instead to display 588
589the current definition in the future. 589If you use this command in a different window displaying the same
590buffer, that window will be used instead to display the current
591definition in the future.
590 592
591@item W 593@item W
592@c Its function is not simply to forget the saved configuration -- dan 594@c Its function is not simply to forget the saved configuration -- dan
@@ -842,11 +844,10 @@ with @code{(apply 'format @var{format-string} @var{format-args})}.
842It also appends a newline to separate entries. 844It also appends a newline to separate entries.
843@end defun 845@end defun
844 846
845 @code{edebug-tracing} and @code{edebug-trace} insert lines in the trace 847 @code{edebug-tracing} and @code{edebug-trace} insert lines in the
846buffer even if Edebug is not active. 848trace buffer whenever they are called, even if Edebug is not active.
847 849Adding text to the trace buffer also scrolls its window to show the last
848 Adding text to the trace buffer also scrolls its window to show the 850lines inserted.
849last lines inserted.
850 851
851@node Coverage Testing 852@node Coverage Testing
852@subsection Coverage Testing 853@subsection Coverage Testing
@@ -855,18 +856,22 @@ last lines inserted.
855@cindex frequency counts 856@cindex frequency counts
856@cindex performance analysis 857@cindex performance analysis
857Edebug provides rudimentary coverage testing and display of execution 858Edebug provides rudimentary coverage testing and display of execution
858frequency. Coverage testing works by comparing the result of each 859frequency.
859expression with the previous result; coverage is considered OK if two 860
860different results are found. Thus, to sufficiently test the coverage of 861 Coverage testing works by comparing the result of each expression with
861your code, try to execute it under conditions that evaluate all 862the previous result; each form in the program is considered ``covered''
862expressions more than once, and produce different results for each 863if it has returned two different values since you began testing coverage
863expression. Coverage testing makes execution slower, so it is only done 864in the current Emacs session. Thus, to do coverage testing on your
864if @code{edebug-test-coverage} is non-@code{nil}. Whether or not 865program, execute it under various conditions and note whether it behaves
865coverage testing is enabled, frequency counting is performed for all 866correctly; Edebug will tell you when you have tried enough different
866execution of an instrumented function, even if the execution mode is 867conditions that each form has returned two different values.
867Go-nonstop. 868
868 869 Coverage testing makes execution slower, so it is only done if
869Use @kbd{M-x edebug-display-freq-count} to display both the 870@code{edebug-test-coverage} is non-@code{nil}. Whether or not coverage
871testing is enabled, frequency counting is performed for all execution of
872an instrumented function, even if the execution mode is Go-nonstop.
873
874 Use @kbd{M-x edebug-display-freq-count} to display both the
870coverage information and the frequency counts for a definition. 875coverage information and the frequency counts for a definition.
871 876
872@deffn Command edebug-display-freq-count 877@deffn Command edebug-display-freq-count
@@ -882,7 +887,7 @@ count of an earlier expression on the same line.
882 887
883The character @samp{=} following the count for an expression says that 888The character @samp{=} following the count for an expression says that
884the expression has returned the same value each time it was evaluated. 889the expression has returned the same value each time it was evaluated.
885This is the only coverage information that Edebug records. 890In other words, it is not yet ``covered'' for coverage testing purposes.
886 891
887To clear the frequency count and coverage data for a definition, 892To clear the frequency count and coverage data for a definition,
888simply reinstrument it with @code{eval-defun}. 893simply reinstrument it with @code{eval-defun}.
@@ -1073,7 +1078,7 @@ name.
1073@end deffn 1078@end deffn
1074 1079
1075Here is a simple example that defines the specification for the 1080Here is a simple example that defines the specification for the
1076@code{for} example macro (@code{Argument Evaluation}), followed by an 1081@code{for} example macro (@pxref{Argument Evaluation}), followed by an
1077alternative, equivalent specification. 1082alternative, equivalent specification.
1078 1083
1079@example 1084@example
@@ -1143,7 +1148,7 @@ their meanings:
1143 1148
1144@table @code 1149@table @code
1145@item sexp 1150@item sexp
1146A single unevaluated expression, which is not instrumented. 1151A single unevaluated Lisp object, which is not instrumented.
1147@c an "expression" is not necessarily intended for evaluation. 1152@c an "expression" is not necessarily intended for evaluation.
1148 1153
1149@item form 1154@item form
@@ -1180,8 +1185,8 @@ elements must all match or none, use @code{&optional
1180@item &rest 1185@item &rest
1181@kindex &rest @r{(Edebug)} 1186@kindex &rest @r{(Edebug)}
1182All following elements in the specification list are repeated zero or 1187All following elements in the specification list are repeated zero or
1183more times. All the elements need not match in the last repetition, 1188more times. In the last repetition, however, it is ok if the expression
1184however. 1189runs out before matching all of the elements of the specification list.
1185 1190
1186To repeat only a few elements, use @code{[&rest @var{specs}@dots{}]}. 1191To repeat only a few elements, use @code{[&rest @var{specs}@dots{}]}.
1187To specify several elements that must all match on every repetition, use 1192To specify several elements that must all match on every repetition, use
diff --git a/lispref/elisp.texi b/lispref/elisp.texi
index 7dbc8093346..e1467e97b62 100644
--- a/lispref/elisp.texi
+++ b/lispref/elisp.texi
@@ -66,11 +66,10 @@ instead of in the original English.
66 66
67@titlepage 67@titlepage
68@title GNU Emacs Lisp Reference Manual 68@title GNU Emacs Lisp Reference Manual
69@subtitle GNU Emacs Version 20 69@subtitle For Emacs Version 20.3
70@subtitle for Unix Users
71@c The edition number appears in several places in this file 70@c The edition number appears in several places in this file
72@c and also in the file intro.texi. 71@c and also in the file intro.texi.
73@subtitle Revision 2.5, February 1998 72@subtitle Revision 2.5, May 1998
74 73
75@author by Bil Lewis, Dan LaLiberte, Richard Stallman 74@author by Bil Lewis, Dan LaLiberte, Richard Stallman
76@author and the GNU Manual Group 75@author and the GNU Manual Group
@@ -81,9 +80,9 @@ Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998 Free Softw
81@sp 2 80@sp 2
82Edition 2.5 @* 81Edition 2.5 @*
83Revised for Emacs Version 20.3,@* 82Revised for Emacs Version 20.3,@*
84February 1998.@* 83May 1998.@*
85@sp 2 84@sp 2
86ISBN 1-882114-71-X 85ISBN 1-882114-72-8
87 86
88@sp 2 87@sp 2
89Published by the Free Software Foundation @* 88Published by the Free Software Foundation @*
@@ -271,7 +270,7 @@ Editing Types
271* Process Type:: A process running on the underlying OS. 270* Process Type:: A process running on the underlying OS.
272* Stream Type:: Receive or send characters. 271* Stream Type:: Receive or send characters.
273* Keymap Type:: What function a keystroke invokes. 272* Keymap Type:: What function a keystroke invokes.
274* Overlay Type:: How an overlay is represented. 273* Overlay Type:: How an overlay is represented.
275 274
276Numbers 275Numbers
277 276
@@ -292,7 +291,7 @@ Strings and Characters
292* Creating Strings:: Functions to allocate new strings. 291* Creating Strings:: Functions to allocate new strings.
293* Text Comparison:: Comparing characters or strings. 292* Text Comparison:: Comparing characters or strings.
294* String Conversion:: Converting characters or strings and vice versa. 293* String Conversion:: Converting characters or strings and vice versa.
295* Formatting Strings:: @code{format}: Emacs's analog of @code{printf}. 294* Formatting Strings:: @code{format}: Emacs's analogue of @code{printf}.
296* Case Conversion:: Case conversion functions. 295* Case Conversion:: Case conversion functions.
297 296
298Lists 297Lists
@@ -454,7 +453,7 @@ Advising Functions
454* Enabling Advice:: You can enable or disable each piece of advice. 453* Enabling Advice:: You can enable or disable each piece of advice.
455* Preactivation:: Preactivation is a way of speeding up the 454* Preactivation:: Preactivation is a way of speeding up the
456 loading of compiled advice. 455 loading of compiled advice.
457* Argument Access:: How advice can access the function's arguments. 456* Argument Access in Advice:: How advice can access the function's arguments.
458* Subr Arguments:: Accessing arguments when advising a primitive. 457* Subr Arguments:: Accessing arguments when advising a primitive.
459* Combined Definition:: How advice is implemented. 458* Combined Definition:: How advice is implemented.
460 459
@@ -692,14 +691,14 @@ Frames
692* Input Focus:: Specifying the selected frame. 691* Input Focus:: Specifying the selected frame.
693* Visibility of Frames:: Frames may be visible or invisible, or icons. 692* Visibility of Frames:: Frames may be visible or invisible, or icons.
694* Raising and Lowering:: Raising a frame makes it hide other X windows; 693* Raising and Lowering:: Raising a frame makes it hide other X windows;
695 lowering it makes the others hide them. 694 lowering it puts it underneath the others.
696* Frame Configurations:: Saving the state of all frames. 695* Frame Configurations:: Saving the state of all frames.
697* Mouse Tracking:: Getting events that say when the mouse moves. 696* Mouse Tracking:: Getting events that say when the mouse moves.
698* Mouse Position:: Asking where the mouse is, or moving it. 697* Mouse Position:: Asking where the mouse is, or moving it.
699* Pop-Up Menus:: Displaying a menu for the user to select from. 698* Pop-Up Menus:: Displaying a menu for the user to select from.
700* Dialog Boxes:: Displaying a box to ask yes or no. 699* Dialog Boxes:: Displaying a box to ask yes or no.
701* Pointer Shapes:: Specifying the shape of the mouse pointer. 700* Pointer Shapes:: Specifying the shape of the mouse pointer.
702* Window System Selections::Transferring text to and from other X clients. 701* Window System Selections::Transferring text to and from other window.
703* Color Names:: Getting the definitions of color names. 702* Color Names:: Getting the definitions of color names.
704* Resources:: Getting resource values from the server. 703* Resources:: Getting resource values from the server.
705* Server Data:: Getting info about the X server. 704* Server Data:: Getting info about the X server.
diff --git a/lispref/errors.texi b/lispref/errors.texi
index 823eadddeac..cee673fd3c8 100644
--- a/lispref/errors.texi
+++ b/lispref/errors.texi
@@ -55,7 +55,7 @@ See @code{/} and @code{%} in @ref{Numbers}.
55@xref{Read Only Buffers}. 55@xref{Read Only Buffers}.
56 56
57@item cyclic-function-indirection 57@item cyclic-function-indirection
58@code{"Symbol's chain of function indirections contains a loop"}@* 58@code{"Symbol's chain of function indirections@* contains a loop"}@*
59@xref{Function Indirection}. 59@xref{Function Indirection}.
60 60
61@item end-of-buffer 61@item end-of-buffer
diff --git a/lispref/frames.texi b/lispref/frames.texi
index 612a1a3ff64..0044a61ac80 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -50,12 +50,15 @@ This predicate returns @code{t} if @var{object} is a frame, and
50* Pointer Shapes:: Specifying the shape of the mouse pointer. 50* Pointer Shapes:: Specifying the shape of the mouse pointer.
51* Window System Selections:: Transferring text to and from other X clients. 51* Window System Selections:: Transferring text to and from other X clients.
52* Font Names:: Looking up font names. 52* Font Names:: Looking up font names.
53* Fontsets:: A fontset is a collection of fonts
54 for displaying various character sets.
53* Color Names:: Getting the definitions of color names. 55* Color Names:: Getting the definitions of color names.
54* Resources:: Getting resource values from the server. 56* Resources:: Getting resource values from the server.
55* Server Data:: Getting info about the X server. 57* Server Data:: Getting info about the X server.
56@end menu 58@end menu
57 59
58 @xref{Display}, for related information. 60 @xref{Display}, for information about the related topic of
61controlling Emacs redisplay.
59 62
60@node Creating Frames 63@node Creating Frames
61@section Creating Frames 64@section Creating Frames
@@ -92,11 +95,10 @@ frame just created.
92 95
93@node Multiple Displays 96@node Multiple Displays
94@section Multiple Displays 97@section Multiple Displays
95@cindex multiple displays 98@cindex multiple X displays
96@cindex multiple X terminals
97@cindex displays, multiple 99@cindex displays, multiple
98 100
99 A single Emacs can talk to more than one X Window display. 101 A single Emacs can talk to more than one X display.
100Initially, Emacs uses just one display---the one chosen with the 102Initially, Emacs uses just one display---the one chosen with the
101@code{DISPLAY} environment variable or with the @samp{--display} option 103@code{DISPLAY} environment variable or with the @samp{--display} option
102(@pxref{Initial Options,,, emacs, The GNU Emacs Manual}). To connect to 104(@pxref{Initial Options,,, emacs, The GNU Emacs Manual}). To connect to
@@ -104,16 +106,18 @@ another display, use the command @code{make-frame-on-display} or specify
104the @code{display} frame parameter when you create the frame. 106the @code{display} frame parameter when you create the frame.
105 107
106 Emacs treats each X server as a separate terminal, giving each one its 108 Emacs treats each X server as a separate terminal, giving each one its
107own selected frame and its own minibuffer windows. A few Lisp variables 109own selected frame and its own minibuffer windows.
108have values local to the current terminal (that is, the terminal 110
109corresponding to the currently selected frame): these are 111 A few Lisp variables are @dfn{terminal-local}; that is, they have a
110@code{default-minibuffer-frame}, @code{defining-kbd-macro}, 112separate binding for each terminal. The binding in effect at any time
111@code{last-kbd-macro}, and @code{system-key-alist}. These variables are 113is the one for the terminal that the currently selected frame belongs
112always terminal-local and can never be buffer-local or frame-local 114to. These variables include @code{default-minibuffer-frame},
113(@pxref{Buffer-Local Variables}). 115@code{defining-kbd-macro}, @code{last-kbd-macro}, and
116@code{system-key-alist}. They are always terminal-local, and can never
117be buffer-local (@pxref{Buffer-Local Variables}) or frame-local.
114 118
115 A single X server can handle more than one screen. A display name 119 A single X server can handle more than one screen. A display name
116@samp{@var{host}.@var{server}.@var{screen}} has three parts; the last 120@samp{@var{host}:@var{server}.@var{screen}} has three parts; the last
117part specifies the screen number for a given server. When you use two 121part specifies the screen number for a given server. When you use two
118screens belonging to one server, Emacs knows by the similarity in their 122screens belonging to one server, Emacs knows by the similarity in their
119names that they share a single keyboard, and it treats them as a single 123names that they share a single keyboard, and it treats them as a single
@@ -164,8 +168,8 @@ Just what parameters a frame has depends on what display mechanism it
164uses. 168uses.
165 169
166Frame parameters exist for the sake of window systems. A terminal frame 170Frame parameters exist for the sake of window systems. A terminal frame
167has a few parameters, mostly for compatibility's sake; only the height, 171has a few parameters, mostly for compatibility's sake; only the @code{height},
168width, @code{name}, @code{title}, @code{buffer-list} and 172@code{width}, @code{name}, @code{title}, @code{buffer-list} and
169@code{buffer-predicate} parameters do something special. 173@code{buffer-predicate} parameters do something special.
170 174
171@menu 175@menu
@@ -418,9 +422,20 @@ appears. If this is @code{nil}, the frame's title is used.
418The color to use for the image of a character. This is a string; the 422The color to use for the image of a character. This is a string; the
419window system defines the meaningful color names. 423window system defines the meaningful color names.
420 424
425If you set the @code{foreground-color} frame parameter, you should
426call @code{frame-update-face-colors} to update faces accordingly.
427
421@item background-color 428@item background-color
422The color to use for the background of characters. 429The color to use for the background of characters.
423 430
431If you set the @code{background-color} frame parameter, you should
432call @code{frame-update-face-colors} to update faces accordingly.
433@xref{Face Functions}.
434
435@item background-mode
436This parameter is either @code{dark} or @code{light}, according
437to whether the background color is a light one or a dark one.
438
424@item mouse-color 439@item mouse-color
425The color for the mouse pointer. 440The color for the mouse pointer.
426 441
@@ -430,6 +445,11 @@ The color for the cursor that shows point.
430@item border-color 445@item border-color
431The color for the border of the frame. 446The color for the border of the frame.
432 447
448@item display-type
449This parameter describes the range of possible colors that can be used
450in this frame. Its value is @code{color}, @code{grayscale} or
451@code{mono}.
452
433@item cursor-type 453@item cursor-type
434The way to display the cursor. The legitimate values are @code{bar}, 454The way to display the cursor. The legitimate values are @code{bar},
435@code{box}, and @code{(bar . @var{width})}. The symbol @code{box} 455@code{box}, and @code{(bar . @var{width})}. The symbol @code{box}
@@ -470,6 +490,10 @@ it and see if it works.)
470 490
471@node Size and Position 491@node Size and Position
472@subsection Frame Size And Position 492@subsection Frame Size And Position
493@cindex size of frame
494@cindex screen size
495@cindex frame size
496@cindex resize frame
473 497
474 You can read or change the size and position of a frame using the 498 You can read or change the size and position of a frame using the
475frame parameters @code{left}, @code{top}, @code{height}, and 499frame parameters @code{left}, @code{top}, @code{height}, and
@@ -481,15 +505,28 @@ by the window manager in its usual fashion.
481@defun set-frame-position frame left top 505@defun set-frame-position frame left top
482This function sets the position of the top left corner of @var{frame} to 506This function sets the position of the top left corner of @var{frame} to
483@var{left} and @var{top}. These arguments are measured in pixels, and 507@var{left} and @var{top}. These arguments are measured in pixels, and
484count from the top left corner of the screen. Negative parameter values 508normally count from the top left corner of the screen.
485count up or rightward from the top left corner of the screen. 509
510Negative parameter values position the bottom edge of the window up from
511the bottom edge of the screen, or the right window edge to the left of
512the right edge of the screen. It would probably be better if the values
513were always counted from the left and top, so that negative arguments
514would position the frame partly off the top or left edge of the screen,
515but it seems inadvisable to change that now.
486@end defun 516@end defun
487 517
488@defun frame-height &optional frame 518@defun frame-height &optional frame
489@defunx frame-width &optional frame 519@defunx frame-width &optional frame
490These functions return the height and width of @var{frame}, measured in 520These functions return the height and width of @var{frame}, measured in
491characters. If you don't supply @var{frame}, they use the selected 521lines and columns. If you don't supply @var{frame}, they use the
492frame. 522selected frame.
523@end defun
524
525@defun screen-height
526@defunx screen-width
527These functions are old aliases for @code{frame-height} and
528@code{frame-width}. When you are using a non-window terminal, the size
529of the frame is normally the same as the size of the terminal screen.
493@end defun 530@end defun
494 531
495@defun frame-pixel-height &optional frame 532@defun frame-pixel-height &optional frame
@@ -515,15 +552,38 @@ To set the size based on values measured in pixels, use
515them to units of characters. 552them to units of characters.
516@end defun 553@end defun
517 554
555@defun set-frame-height frame lines &optional pretend
556This function resizes @var{frame} to a height of @var{lines} lines. The
557sizes of existing windows in @var{frame} are altered proportionally to
558fit.
559
560If @var{pretend} is non-@code{nil}, then Emacs displays @var{lines}
561lines of output in @var{frame}, but does not change its value for the
562actual height of the frame. This is only useful for a terminal frame.
563Using a smaller height than the terminal actually implements may be
564useful to reproduce behavior observed on a smaller screen, or if the
565terminal malfunctions when using its whole screen. Setting the frame
566height ``for real'' does not always work, because knowing the correct
567actual size may be necessary for correct cursor positioning on a
568terminal frame.
569@end defun
570
571@defun set-frame-width frame width &optional pretend
572This function sets the width of @var{frame}, measured in characters.
573The argument @var{pretend} has the same meaning as in
574@code{set-frame-height}.
575@end defun
576
577@findex set-screen-height
578@findex set-screen-width
518 The old-fashioned functions @code{set-screen-height} and 579 The old-fashioned functions @code{set-screen-height} and
519@code{set-screen-width}, which were used to specify the height and width 580@code{set-screen-width}, which were used to specify the height and width
520of the screen in Emacs versions that did not support multiple frames, 581of the screen in Emacs versions that did not support multiple frames,
521are still usable. They apply to the selected frame. @xref{Screen 582are still usable. They apply to the selected frame.
522Size}.
523 583
524@defun x-parse-geometry geom 584@defun x-parse-geometry geom
525@cindex geometry specification 585@cindex geometry specification
526The function @code{x-parse-geometry} converts a standard X Windows 586The function @code{x-parse-geometry} converts a standard X window
527geometry string to an alist that you can use as part of the argument to 587geometry string to an alist that you can use as part of the argument to
528@code{make-frame}. 588@code{make-frame}.
529 589
@@ -562,17 +622,11 @@ Here is an example:
562 622
563@example 623@example
564(x-parse-geometry "35x70+0-0") 624(x-parse-geometry "35x70+0-0")
565 @result{} ((width . 35) (height . 70) 625 @result{} ((height . 70) (width . 35)
566 (left . 0) (top - 0)) 626 (top - 0) (left . 0))
567@end example 627@end example
568@end defun 628@end defun
569 629
570@ignore
571New functions @code{set-frame-height} and @code{set-frame-width} set the
572size of a specified frame. The frame is the first argument; the size is
573the second.
574@end ignore
575
576@node Frame Titles 630@node Frame Titles
577@section Frame Titles 631@section Frame Titles
578 632
@@ -768,8 +822,7 @@ actually displayed on the terminal. @code{switch-frame} is the only way
768to switch frames, and the change lasts until overridden by a subsequent 822to switch frames, and the change lasts until overridden by a subsequent
769call to @code{switch-frame}. Each terminal screen except for the 823call to @code{switch-frame}. Each terminal screen except for the
770initial one has a number, and the number of the selected frame appears 824initial one has a number, and the number of the selected frame appears
771in the mode line after the word @samp{Emacs} (@pxref{Mode Line 825in the mode line before the buffer name (@pxref{Mode Line Variables}).
772Variables}).
773 826
774@c ??? This is not yet implemented properly. 827@c ??? This is not yet implemented properly.
775@defun select-frame frame 828@defun select-frame frame
@@ -1283,7 +1336,7 @@ just as fonts do, and you can use a fontset name in place of a font name
1283when you specify the ``font'' for a frame or a face. Here is 1336when you specify the ``font'' for a frame or a face. Here is
1284information about defining a fontset under Lisp program control. 1337information about defining a fontset under Lisp program control.
1285 1338
1286@defun create-fontset-from-fontset-spec fontset-spec &optional style noerror 1339@defun create-fontset-from-fontset-spec fontset-spec &optional style-variant-p noerror
1287This function defines a new fontset according to the specification 1340This function defines a new fontset according to the specification
1288string @var{fontset-spec}. The string should have this format: 1341string @var{fontset-spec}. The string should have this format:
1289 1342
@@ -1298,22 +1351,23 @@ The first part of the string, @var{fontpattern}, should have the form of
1298a standard X font name, except that the last two fields should be 1351a standard X font name, except that the last two fields should be
1299@samp{fontset-@var{alias}}. 1352@samp{fontset-@var{alias}}.
1300 1353
1301Each fontset has two names, one long and one short. The long name is 1354The new fontset has two names, one long and one short. The long name is
1302@var{fontpattern} in its entirety. The short name is 1355@var{fontpattern} in its entirety. The short name is
1303@samp{fontset-@var{alias}}. You can refer to the fontset by either 1356@samp{fontset-@var{alias}}. You can refer to the fontset by either
1304name. If a fontset with the same name already exists, an error is 1357name. If a fontset with the same name already exists, an error is
1305signaled, unless @var{noerror} is non-@code{nil}, in which case this 1358signaled, unless @var{noerror} is non-@code{nil}, in which case this
1306function does nothing. 1359function does nothing.
1307 1360
1361If optional argument @var{style-variant-p} is non-@code{nil}, that says
1362to create bold, italic and bold-italic variants of the fontset as well.
1363These variant fontsets do not have a short name, only a long one, which
1364is made by altering @var{fontpattern} to indicate the bold or italic
1365status.
1366
1308The specification string also says which fonts to use in the fontset. 1367The specification string also says which fonts to use in the fontset.
1309See below for the details. 1368See below for the details.
1310@end defun 1369@end defun
1311 1370
1312 If optional argument @var{style} is specified, it specifies a way to
1313modify the fontset. It should be one of @code{bold}, @code{italic}, and
1314@code{bold-italic}, and it says to find the bold, italic or bold-italic
1315version of each font if possible.
1316
1317 The construct @samp{@var{charset}:@var{font}} specifies which font to 1371 The construct @samp{@var{charset}:@var{font}} specifies which font to
1318use (in this fontset) for one particular character set. Here, 1372use (in this fontset) for one particular character set. Here,
1319@var{charset} is the name of a character set, and @var{font} is the font 1373@var{charset} is the name of a character set, and @var{font} is the font
@@ -1354,7 +1408,7 @@ and the font specification for Chinese GB2312 characters would be this:
1354 1408
1355 You may not have any Chinese font matching the above font 1409 You may not have any Chinese font matching the above font
1356specification. Most X distributions include only Chinese fonts that 1410specification. Most X distributions include only Chinese fonts that
1357have @samp{song ti} or @samp{fangsong ti} in @var{family} field. In 1411have @samp{song ti} or @samp{fangsong ti} in the @var{family} field. In
1358such a case, @samp{Fontset-@var{n}} can be specified as below: 1412such a case, @samp{Fontset-@var{n}} can be specified as below:
1359 1413
1360@smallexample 1414@smallexample
@@ -1415,7 +1469,7 @@ defined, the value is @code{nil}.
1415@end example 1469@end example
1416 1470
1417The color values are returned for @var{frame}'s display. If @var{frame} 1471The color values are returned for @var{frame}'s display. If @var{frame}
1418is omitted or @code{nil}, the information is return for the selected 1472is omitted or @code{nil}, the information is returned for the selected
1419frame's display. 1473frame's display.
1420@end defun 1474@end defun
1421 1475
diff --git a/lispref/help.texi b/lispref/help.texi
index cde0956b5be..9c88c971705 100644
--- a/lispref/help.texi
+++ b/lispref/help.texi
@@ -99,15 +99,15 @@ Help, emacs, The GNU Emacs Manual}.
99@c Wordy to prevent overfull hbox. --rjc 15mar92 99@c Wordy to prevent overfull hbox. --rjc 15mar92
100 The @file{emacs/lib-src} directory contains two utilities that you can 100 The @file{emacs/lib-src} directory contains two utilities that you can
101use to print nice-looking hardcopy for the file 101use to print nice-looking hardcopy for the file
102@file{emacs/etc/DOC-@var{version}}. These are @file{sorted-doc.c} and 102@file{emacs/etc/DOC-@var{version}}. These are @file{sorted-doc} and
103@file{digest-doc.c}. 103@file{digest-doc}.
104 104
105@node Accessing Documentation 105@node Accessing Documentation
106@section Access to Documentation Strings 106@section Access to Documentation Strings
107 107
108@defun documentation-property symbol property &optional verbatim 108@defun documentation-property symbol property &optional verbatim
109This function returns the documentation string that is recorded 109This function returns the documentation string that is recorded
110@var{symbol}'s property list under property @var{property}. It 110in @var{symbol}'s property list under property @var{property}. It
111retrieves the text from a file if necessary, and runs 111retrieves the text from a file if necessary, and runs
112@code{substitute-command-keys} to substitute actual key bindings. (This 112@code{substitute-command-keys} to substitute actual key bindings. (This
113substitution is not done if @var{verbatim} is non-@code{nil}.) 113substitution is not done if @var{verbatim} is non-@code{nil}.)
@@ -116,7 +116,7 @@ substitution is not done if @var{verbatim} is non-@code{nil}.)
116@group 116@group
117(documentation-property 'command-line-processed 117(documentation-property 'command-line-processed
118 'variable-documentation) 118 'variable-documentation)
119 @result{} "t once command line has been processed" 119 @result{} "Non-nil once command line has been processed"
120@end group 120@end group
121@group 121@group
122(symbol-plist 'command-line-processed) 122(symbol-plist 'command-line-processed)
@@ -218,7 +218,7 @@ goal-column Option
218@c That makes them incorrect. 218@c That makes them incorrect.
219 219
220@group 220@group
221set-goal-column Command: C-x C-n 221set-goal-column Keys: C-x C-n
222Set the current horizontal position as a goal for C-n and C-p. 222Set the current horizontal position as a goal for C-n and C-p.
223@end group 223@end group
224@c DO NOT put a blank line here! That is factually inaccurate! 224@c DO NOT put a blank line here! That is factually inaccurate!
@@ -496,7 +496,7 @@ stands for @kbd{C-h}. When Emacs reads this character, if
496@code{help-form} is a non-@code{nil} Lisp expression, it evaluates that 496@code{help-form} is a non-@code{nil} Lisp expression, it evaluates that
497expression, and displays the result in a window if it is a string. 497expression, and displays the result in a window if it is a string.
498 498
499Usually the value of @code{help-form}'s value is @code{nil}. Then the 499Usually the value of @code{help-form} is @code{nil}. Then the
500help character has no special meaning at the level of command input, and 500help character has no special meaning at the level of command input, and
501it becomes part of a key sequence in the normal way. The standard key 501it becomes part of a key sequence in the normal way. The standard key
502binding of @kbd{C-h} is a prefix key for several general-purpose help 502binding of @kbd{C-h} is a prefix key for several general-purpose help
diff --git a/lispref/intro.texi b/lispref/intro.texi
index d6471a4ced1..17a8d903d30 100644
--- a/lispref/intro.texi
+++ b/lispref/intro.texi
@@ -491,10 +491,6 @@ mail @emph{will} be acted on in due time. If you want to contact the
491Emacs maintainers more quickly, send mail to 491Emacs maintainers more quickly, send mail to
492@code{bug-gnu-emacs@@gnu.org}. 492@code{bug-gnu-emacs@@gnu.org}.
493 493
494@display
495 --Bil Lewis, Dan LaLiberte, Richard Stallman
496@end display
497
498@node Lisp History 494@node Lisp History
499@section Lisp History 495@section Lisp History
500@cindex Lisp history 496@cindex Lisp history
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index d29878d3288..f3b4108c710 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -338,7 +338,8 @@ For example, @kbd{C-x} is a prefix key, and it uses a keymap that is
338also stored in the variable @code{ctl-x-map}. This keymap defines 338also stored in the variable @code{ctl-x-map}. This keymap defines
339bindings for key sequences starting with @kbd{C-x}. 339bindings for key sequences starting with @kbd{C-x}.
340 340
341 Here is a list of the standard prefix keys of Emacs and their keymaps: 341 Some of the standard Emacs prefix keys use keymaps that are
342also found in Lisp variables:
342 343
343@itemize @bullet 344@itemize @bullet
344@item 345@item
@@ -370,6 +371,12 @@ This map is found via the function cell of the symbol
370@code{Control-X-prefix}. 371@code{Control-X-prefix}.
371 372
372@item 373@item
374@cindex @kbd{C-x @key{RET}}
375@vindex mule-keymap
376@code{mule-keymap} is the global keymap used for the @kbd{C-x @key{RET}}
377prefix key.
378
379@item
373@cindex @kbd{C-x 4} 380@cindex @kbd{C-x 4}
374@vindex ctl-x-4-map 381@vindex ctl-x-4-map
375@code{ctl-x-4-map} is the global keymap used for the @kbd{C-x 4} prefix 382@code{ctl-x-4-map} is the global keymap used for the @kbd{C-x 4} prefix
@@ -384,11 +391,28 @@ key.
384 391
385@c Emacs 19 feature 392@c Emacs 19 feature
386@item 393@item
387@cindex @kbd{C-x n} 394@cindex @kbd{C-x 6}
388@cindex @kbd{C-x r} 395@vindex 2C-mode-map
389@cindex @kbd{C-x a} 396@code{2C-mode-map} is the global keymap used for the @kbd{C-x 6} prefix
390The prefix keys @kbd{C-x n}, @kbd{C-x r} and @kbd{C-x a} use keymaps 397key.
391that have no special names. 398
399@item
400@cindex @kbd{C-x v}
401@vindex vc-prefix-map
402@code{vc-prefix-map} is the global keymap used for the @kbd{C-x v} prefix
403key.
404
405@item
406@cindex @kbd{M-g}
407@vindex facemenu-keymap
408@code{facemenu-keymap} is the global keymap used for the @kbd{M-g}
409prefix key.
410
411@c Emacs 19 feature
412@item
413The other Emacs prefix keys are @kbd{C-x @@}, @kbd{C-x a i}, @kbd{C-x
414@key{ESC}} and @kbd{@key{ESC} @key{ESC}}. They use keymaps that have no
415special names.
392@end itemize 416@end itemize
393 417
394 The keymap binding of a prefix key is used for looking up the event 418 The keymap binding of a prefix key is used for looking up the event
@@ -615,7 +639,7 @@ particular minor modes. The elements of this alist look like the
615elements of @code{minor-mode-map-alist}: @code{(@var{variable} 639elements of @code{minor-mode-map-alist}: @code{(@var{variable}
616. @var{keymap})}. 640. @var{keymap})}.
617 641
618If a variable appears an element of 642If a variable appears as an element of
619@code{minor-mode-overriding-map-alist}, the map specified by that 643@code{minor-mode-overriding-map-alist}, the map specified by that
620element totally replaces any map specified for the same variable in 644element totally replaces any map specified for the same variable in
621@code{minor-mode-map-alist}. 645@code{minor-mode-map-alist}.
@@ -1179,16 +1203,15 @@ Dired mode is set up:
1179 1203
1180@smallexample 1204@smallexample
1181@group 1205@group
1182 @dots{} 1206(setq dired-mode-map (make-keymap))
1183 (setq dired-mode-map (make-keymap)) 1207(suppress-keymap dired-mode-map)
1184 (suppress-keymap dired-mode-map) 1208(define-key dired-mode-map "r" 'dired-rename-file)
1185 (define-key dired-mode-map "r" 'dired-rename-file) 1209(define-key dired-mode-map "\C-d" 'dired-flag-file-deleted)
1186 (define-key dired-mode-map "\C-d" 'dired-flag-file-deleted) 1210(define-key dired-mode-map "d" 'dired-flag-file-deleted)
1187 (define-key dired-mode-map "d" 'dired-flag-file-deleted) 1211(define-key dired-mode-map "v" 'dired-view-file)
1188 (define-key dired-mode-map "v" 'dired-view-file) 1212(define-key dired-mode-map "e" 'dired-find-file)
1189 (define-key dired-mode-map "e" 'dired-find-file) 1213(define-key dired-mode-map "f" 'dired-find-file)
1190 (define-key dired-mode-map "f" 'dired-find-file) 1214@dots{}
1191 @dots{}
1192@end group 1215@end group
1193@end smallexample 1216@end smallexample
1194@end defun 1217@end defun
diff --git a/lispref/loading.texi b/lispref/loading.texi
index 6dda4a437ed..cdea882874a 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -148,7 +148,8 @@ Normally, the variable's value is @code{nil}, which means those
148functions should use @code{read}. 148functions should use @code{read}.
149@end defvar 149@end defvar
150 150
151 For how @code{load} is used to build Emacs, see @ref{Building Emacs}. 151 For information about how @code{load} is used in building Emacs, see
152@ref{Building Emacs}.
152 153
153@node Library Search 154@node Library Search
154@section Library Search 155@section Library Search
@@ -176,16 +177,15 @@ directory names, and @samp{.} is used for the current default directory.
176Here is an example of how to set your @code{EMACSLOADPATH} variable from 177Here is an example of how to set your @code{EMACSLOADPATH} variable from
177a @code{csh} @file{.login} file: 178a @code{csh} @file{.login} file:
178 179
179@c This overfull hbox is OK. --rjc 16mar92
180@smallexample 180@smallexample
181setenv EMACSLOADPATH .:/user/bil/emacs:/usr/local/lib/emacs/lisp 181setenv EMACSLOADPATH .:/user/bil/emacs:/usr/local/lib/emacs/20.3/lisp
182@end smallexample 182@end smallexample
183 183
184 Here is how to set it using @code{sh}: 184 Here is how to set it using @code{sh}:
185 185
186@smallexample 186@smallexample
187export EMACSLOADPATH 187export EMACSLOADPATH
188EMACSLOADPATH=.:/user/bil/emacs:/usr/local/lib/emacs/lisp 188EMACSLOADPATH=.:/user/bil/emacs:/usr/local/lib/emacs/20.3/lisp
189@end smallexample 189@end smallexample
190 190
191 Here is an example of code you can place in a @file{.emacs} file to add 191 Here is an example of code you can place in a @file{.emacs} file to add
diff --git a/lispref/markers.texi b/lispref/markers.texi
index 0fa549bdd16..ee4d2144498 100644
--- a/lispref/markers.texi
+++ b/lispref/markers.texi
@@ -316,9 +316,9 @@ relocating a marker to point after the inserted text.
316@defun set-marker-insertion-type marker type 316@defun set-marker-insertion-type marker type
317@tindex set-marker-insertion-type 317@tindex set-marker-insertion-type
318This function sets the insertion type of marker @var{marker} to 318This function sets the insertion type of marker @var{marker} to
319@var{type}. If @var{type} is @code{t}, @var{marker} will advances when 319@var{type}. If @var{type} is @code{t}, @var{marker} will advance when
320text is inserted at it. If @var{type} is @code{nil}, @var{marker} does 320text is inserted at its position. If @var{type} is @code{nil},
321not advance when text is inserted there. 321@var{marker} does not advance when text is inserted there.
322@end defun 322@end defun
323 323
324@defun marker-insertion-type marker 324@defun marker-insertion-type marker
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index 8ddb5d72350..dd0a7e82cbe 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -38,7 +38,7 @@ minibuffer. However, many operations for managing buffers do not apply
38to minibuffers. The name of a minibuffer always has the form @w{@samp{ 38to minibuffers. The name of a minibuffer always has the form @w{@samp{
39*Minibuf-@var{number}}}, and it cannot be changed. Minibuffers are 39*Minibuf-@var{number}}}, and it cannot be changed. Minibuffers are
40displayed only in special windows used only for minibuffers; these 40displayed only in special windows used only for minibuffers; these
41windows always appear at the bottom of a frame. (Sometime frames have 41windows always appear at the bottom of a frame. (Sometimes frames have
42no minibuffer window, and sometimes a special kind of frame contains 42no minibuffer window, and sometimes a special kind of frame contains
43nothing but a minibuffer window; see @ref{Minibuffers and Frames}.) 43nothing but a minibuffer window; see @ref{Minibuffers and Frames}.)
44 44
@@ -136,10 +136,10 @@ properties were present in the minibuffer. Otherwise all the text
136properties are stripped when the value is returned. 136properties are stripped when the value is returned.
137 137
138If the argument @var{inherit-input-method} is non-@code{nil}, then the 138If the argument @var{inherit-input-method} is non-@code{nil}, then the
139minibuffer inherits the current buffer's input method (@pxref{Input 139minibuffer inherits the current input method (@pxref{Input Methods}) and
140Methods}) and the setting of @code{enable-multibyte-characters} 140the setting of @code{enable-multibyte-characters} (@pxref{Text
141(@pxref{Text Representations}) from whichever buffer was current before 141Representations}) from whichever buffer was current before entering the
142entering the minibuffer. 142minibuffer.
143 143
144If @var{initial-contents} is a string, @code{read-from-minibuffer} 144If @var{initial-contents} is a string, @code{read-from-minibuffer}
145inserts it into the minibuffer, leaving point at the end, before the 145inserts it into the minibuffer, leaving point at the end, before the
@@ -191,10 +191,13 @@ This function is a simplified interface to the
191@end defun 191@end defun
192 192
193@defvar minibuffer-allow-text-properties 193@defvar minibuffer-allow-text-properties
194If this variable is non-@code{nil}, then @code{read-from-minibuffer} 194If this variable is @code{nil}, then @code{read-from-minibuffer} strips
195strips all text properties from the string before returning the string. 195all text properties from the minibuffer input before returning it.
196Since all minibuffer input uses @code{read-from-minibuffer}, this 196Since all minibuffer input uses @code{read-from-minibuffer}, this
197variable applies to all minibuffer input. 197variable applies to all minibuffer input.
198
199Note that the completion functions discard text properties unconditionally,
200regardless of the value of this variable.
198@end defvar 201@end defvar
199 202
200@defvar minibuffer-local-map 203@defvar minibuffer-local-map
@@ -679,7 +682,7 @@ edit the input, providing several commands to attempt completion.
679In most cases, we recommend using @var{default}, and not @var{initial}. 682In most cases, we recommend using @var{default}, and not @var{initial}.
680 683
681If the argument @var{inherit-input-method} is non-@code{nil}, then the 684If the argument @var{inherit-input-method} is non-@code{nil}, then the
682minibuffer inherits the current buffer's input method (@pxref{Input 685minibuffer inherits the current input method (@pxref{Input
683Methods}) and the setting of @code{enable-multibyte-characters} 686Methods}) and the setting of @code{enable-multibyte-characters}
684(@pxref{Text Representations}) from whichever buffer was current before 687(@pxref{Text Representations}) from whichever buffer was current before
685entering the minibuffer. 688entering the minibuffer.
@@ -1003,7 +1006,7 @@ predicate @code{user-variable-p} instead of @code{commandp}:
1003@end defun 1006@end defun
1004 1007
1005 See also the functions @code{read-coding-system} and 1008 See also the functions @code{read-coding-system} and
1006@code{read-non-nil-coding-system}, in @ref{Lisp and Coding Systems}. 1009@code{read-non-nil-coding-system}, in @ref{User-Chosen Coding Systems}.
1007 1010
1008@node Reading File Names 1011@node Reading File Names
1009@subsection Reading File Names 1012@subsection Reading File Names
@@ -1035,7 +1038,7 @@ initial input. It defaults to the current buffer's value of
1035 1038
1036@c Emacs 19 feature 1039@c Emacs 19 feature
1037If you specify @var{initial}, that is an initial file name to insert in 1040If you specify @var{initial}, that is an initial file name to insert in
1038the buffer (after with @var{directory}, if that is inserted). In this 1041the buffer (after @var{directory}, if that is inserted). In this
1039case, point goes at the beginning of @var{initial}. The default for 1042case, point goes at the beginning of @var{initial}. The default for
1040@var{initial} is @code{nil}---don't insert any file name. To see what 1043@var{initial} is @code{nil}---don't insert any file name. To see what
1041@var{initial} does, try the command @kbd{C-x C-v}. @strong{Note:} we 1044@var{initial} does, try the command @kbd{C-x C-v}. @strong{Note:} we
diff --git a/lispref/modes.texi b/lispref/modes.texi
index dfbdfee00c6..f8a5729ccc3 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -60,7 +60,7 @@ definition is distinct from that of Text mode, but was derived from it.
60 60
61 Rmail Edit mode offers an example of changing the major mode 61 Rmail Edit mode offers an example of changing the major mode
62temporarily for a buffer, so it can be edited in a different way (with 62temporarily for a buffer, so it can be edited in a different way (with
63ordinary Emacs commands rather than Rmail). In such cases, the 63ordinary Emacs commands rather than Rmail commands). In such cases, the
64temporary major mode usually has a command to switch back to the 64temporary major mode usually has a command to switch back to the
65buffer's usual mode (Rmail mode, in this case). You might be tempted to 65buffer's usual mode (Rmail mode, in this case). You might be tempted to
66present the temporary redefinitions inside a recursive edit and restore 66present the temporary redefinitions inside a recursive edit and restore
@@ -823,11 +823,11 @@ minor modes.
823Make a variable whose name ends in @samp{-mode} to control the minor 823Make a variable whose name ends in @samp{-mode} to control the minor
824mode. We call this the @dfn{mode variable}. The minor mode command 824mode. We call this the @dfn{mode variable}. The minor mode command
825should set this variable (@code{nil} to disable; anything else to 825should set this variable (@code{nil} to disable; anything else to
826enable.) 826enable).
827 827
828If it is possible, implement the mode so that setting the variable 828If it is possible, implement the mode so that setting the variable
829automatically enables or disables the mode. Then the minor mode command 829automatically enables or disables the mode. Then the minor mode command
830does not need to do anything except the variable. 830does not need to do anything except set the variable.
831 831
832This variable is used in conjunction with the @code{minor-mode-alist} to 832This variable is used in conjunction with the @code{minor-mode-alist} to
833display the minor mode name in the mode line. It can also enable 833display the minor mode name in the mode line. It can also enable
@@ -887,6 +887,9 @@ check for an existing element, to avoid duplication. For example:
887@end smallexample 887@end smallexample
888@end itemize 888@end itemize
889 889
890 You can also use @code{add-to-list} to add an element to this list
891just once (@pxref{Setting Variables}).
892
890@node Keymaps and Minor Modes 893@node Keymaps and Minor Modes
891@subsection Keymaps and Minor Modes 894@subsection Keymaps and Minor Modes
892 895
@@ -1135,6 +1138,11 @@ directory.
1135@end group 1138@end group
1136@end example 1139@end example
1137 1140
1141@noindent
1142(The variables @code{line-number-mode}, @code{column-number-mode}
1143and @code{which-func-mode} enable particular minor modes; as usual,
1144these variable names are also the minor mode command names.)
1145
1138@node Mode Line Variables 1146@node Mode Line Variables
1139@subsection Variables Used in the Mode Line 1147@subsection Variables Used in the Mode Line
1140 1148
@@ -1174,12 +1182,8 @@ frame at a time.
1174 1182
1175@defvar mode-line-buffer-identification 1183@defvar mode-line-buffer-identification
1176This variable identifies the buffer being displayed in the window. Its 1184This variable identifies the buffer being displayed in the window. Its
1177default value is @code{("%12b")}, which means that it usually 1185default value is @code{("%12b")}, which means that it usually displays
1178displays @samp{Emacs:} followed by seventeen characters of the buffer 1186twelve characters of the buffer name.
1179name. (In a terminal frame, it displays the frame name instead of
1180@samp{Emacs}; this has the effect of showing the frame number.) You may
1181want to change this in modes such as Rmail that do not behave like a
1182``normal'' Emacs.
1183@end defvar 1187@end defvar
1184 1188
1185@defvar global-mode-string 1189@defvar global-mode-string
@@ -1240,7 +1244,7 @@ This buffer-local variable contains the mode line information on process
1240status in modes used for communicating with subprocesses. It is 1244status in modes used for communicating with subprocesses. It is
1241displayed immediately following the major mode name, with no intervening 1245displayed immediately following the major mode name, with no intervening
1242space. For example, its value in the @samp{*shell*} buffer is 1246space. For example, its value in the @samp{*shell*} buffer is
1243@code{(":@: %s")}, which allows the shell to display its status along 1247@code{(":%s")}, which allows the shell to display its status along
1244with the major mode as: @samp{(Shell:@: run)}. Normally this variable 1248with the major mode as: @samp{(Shell:@: run)}. Normally this variable
1245is @code{nil}. 1249is @code{nil}.
1246@end defvar 1250@end defvar
@@ -1456,8 +1460,8 @@ Setting this variable makes it buffer-local in the current buffer.
1456 1460
1457@defvar imenu-syntax-alist 1461@defvar imenu-syntax-alist
1458This variable is an alist of syntax table modifiers to use while 1462This variable is an alist of syntax table modifiers to use while
1459executing @code{imenu--generic-function} to override the syntax table of 1463processing @code{imenu-generic-expression}, to override the syntax table
1460the current buffer. Each element should have this form: 1464of the current buffer. Each element should have this form:
1461 1465
1462@example 1466@example
1463(@var{characters} . @var{syntax-description}) 1467(@var{characters} . @var{syntax-description})
@@ -1478,7 +1482,7 @@ For example, Fortran mode uses it this way:
1478@end example 1482@end example
1479 1483
1480The @code{imenu-generic-expression} patterns can then use @samp{\\sw+} 1484The @code{imenu-generic-expression} patterns can then use @samp{\\sw+}
1481instead of @samp{\\(\\sw\\|\\s_\\)\\}. Note that this technique may be 1485instead of @samp{\\(\\sw\\|\\s_\\)+}. Note that this technique may be
1482inconvenient to use when the mode needs to limit the initial character 1486inconvenient to use when the mode needs to limit the initial character
1483of a name to a smaller set of characters 1487of a name to a smaller set of characters
1484 1488
@@ -2081,7 +2085,9 @@ each of them the arguments @var{args}.
2081This function is the way to run an abnormal hook which passes arguments 2085This function is the way to run an abnormal hook which passes arguments
2082to the hook functions, and stops as soon as any hook function fails. It 2086to the hook functions, and stops as soon as any hook function fails. It
2083calls each of the hook functions, passing each of them the arguments 2087calls each of the hook functions, passing each of them the arguments
2084@var{args}, until some hook function returns @code{nil}. Then it stops. 2088@var{args}, until some hook function returns @code{nil}. Then it stops,
2089and returns @code{nil} if some hook function did, and otherwise
2090returns a non-@code{nil} value.
2085@end defun 2091@end defun
2086 2092
2087@defun run-hook-with-args-until-success hook &rest args 2093@defun run-hook-with-args-until-success hook &rest args
@@ -2089,7 +2095,8 @@ This function is the way to run an abnormal hook which passes arguments
2089to the hook functions, and stops as soon as any hook function succeeds. 2095to the hook functions, and stops as soon as any hook function succeeds.
2090It calls each of the hook functions, passing each of them the arguments 2096It calls each of the hook functions, passing each of them the arguments
2091@var{args}, until some hook function returns non-@code{nil}. Then it 2097@var{args}, until some hook function returns non-@code{nil}. Then it
2092stops. 2098stops, and returns whatever was returned by the last hook function
2099that was called.
2093@end defun 2100@end defun
2094 2101
2095@defun add-hook hook function &optional append local 2102@defun add-hook hook function &optional append local
diff --git a/lispref/nonascii.texi b/lispref/nonascii.texi
index ac7c9ed9c43..019f1365f72 100644
--- a/lispref/nonascii.texi
+++ b/lispref/nonascii.texi
@@ -46,13 +46,14 @@ character set by setting the variable @code{nonascii-insert-offset}).
46 46
47@cindex leading code 47@cindex leading code
48@cindex multibyte text 48@cindex multibyte text
49@cindex trailing codes
49 In multibyte representation, a character may occupy more than one 50 In multibyte representation, a character may occupy more than one
50byte, and as a result, the full range of Emacs character codes can be 51byte, and as a result, the full range of Emacs character codes can be
51stored. The first byte of a multibyte character is always in the range 52stored. The first byte of a multibyte character is always in the range
52128 through 159 (octal 0200 through 0237). These values are called 53128 through 159 (octal 0200 through 0237). These values are called
53@dfn{leading codes}. The second and subsequent bytes of a multibyte 54@dfn{leading codes}. The second and subsequent bytes of a multibyte
54character are always in the range 160 through 255 (octal 0240 through 55character are always in the range 160 through 255 (octal 0240 through
550377). 560377); these values are @dfn{trailing codes}.
56 57
57 In a buffer, the buffer-local value of the variable 58 In a buffer, the buffer-local value of the variable
58@code{enable-multibyte-characters} specifies the representation used. 59@code{enable-multibyte-characters} specifies the representation used.
@@ -156,14 +157,14 @@ If this is non-@code{nil}, it overrides @code{nonascii-insert-offset}.
156@defun string-make-unibyte string 157@defun string-make-unibyte string
157@tindex string-make-unibyte 158@tindex string-make-unibyte
158This function converts the text of @var{string} to unibyte 159This function converts the text of @var{string} to unibyte
159representation, if it isn't already, and return the result. If 160representation, if it isn't already, and returns the result. If
160@var{string} is a unibyte string, it is returned unchanged. 161@var{string} is a unibyte string, it is returned unchanged.
161@end defun 162@end defun
162 163
163@defun string-make-multibyte string 164@defun string-make-multibyte string
164@tindex string-make-multibyte 165@tindex string-make-multibyte
165This function converts the text of @var{string} to multibyte 166This function converts the text of @var{string} to multibyte
166representation, if it isn't already, and return the result. If 167representation, if it isn't already, and returns the result. If
167@var{string} is a multibyte string, it is returned unchanged. 168@var{string} is a multibyte string, it is returned unchanged.
168@end defun 169@end defun
169 170
@@ -280,18 +281,18 @@ set that @var{character} belongs to.
280@cindex dimension (of character set) 281@cindex dimension (of character set)
281 In multibyte representation, each character occupies one or more 282 In multibyte representation, each character occupies one or more
282bytes. Each character set has an @dfn{introduction sequence}, which is 283bytes. Each character set has an @dfn{introduction sequence}, which is
283one or two bytes long. The introduction sequence is the beginning of 284normally one or two bytes long. (Exception: the @sc{ASCII} character
284the byte sequence for any character in the character set. (The 285set has a zero-length introduction sequence.) The introduction sequence
285@sc{ASCII} character set has a zero-length introduction sequence.) The 286is the beginning of the byte sequence for any character in the character
286rest of the character's bytes distinguish it from the other characters 287set. The rest of the character's bytes distinguish it from the other
287in the same character set. Depending on the character set, there are 288characters in the same character set. Depending on the character set,
288either one or two distinguishing bytes; the number of such bytes is 289there are either one or two distinguishing bytes; the number of such
289called the @dfn{dimension} of the character set. 290bytes is called the @dfn{dimension} of the character set.
290 291
291@defun charset-dimension charset 292@defun charset-dimension charset
292@tindex charset-dimension 293@tindex charset-dimension
293This function returns the dimension of @var{charset}; 294This function returns the dimension of @var{charset};
294At present, the dimension is always 1 or 2. 295at present, the dimension is always 1 or 2.
295@end defun 296@end defun
296 297
297 This is the simplest way to determine the byte length of a character 298 This is the simplest way to determine the byte length of a character
@@ -481,6 +482,7 @@ by a particular @dfn{coding system}.
481* Coding System Basics:: 482* Coding System Basics::
482* Encoding and I/O:: 483* Encoding and I/O::
483* Lisp and Coding Systems:: 484* Lisp and Coding Systems::
485* User-Chosen Coding Systems::
484* Default Coding Systems:: 486* Default Coding Systems::
485* Specifying Coding Systems:: 487* Specifying Coding Systems::
486* Explicit Encoding:: 488* Explicit Encoding::
@@ -559,7 +561,7 @@ as an alias for the coding system.
559@node Encoding and I/O 561@node Encoding and I/O
560@subsection Encoding and I/O 562@subsection Encoding and I/O
561 563
562 The principal purpose coding systems is for use in reading and 564 The principal purpose of coding systems is for use in reading and
563writing files. The function @code{insert-file-contents} uses 565writing files. The function @code{insert-file-contents} uses
564a coding system for decoding the file data, and @code{write-region} 566a coding system for decoding the file data, and @code{write-region}
565uses one to encode the buffer contents. 567uses one to encode the buffer contents.
@@ -632,7 +634,7 @@ Otherwise it signals an error with condition @code{coding-system-error}.
632@defun coding-system-change-eol-conversion coding-system eol-type 634@defun coding-system-change-eol-conversion coding-system eol-type
633@tindex coding-system-change-eol-conversion 635@tindex coding-system-change-eol-conversion
634This function returns a coding system which is like @var{coding-system} 636This function returns a coding system which is like @var{coding-system}
635except for its in eol conversion, which is specified by @code{eol-type}. 637except for its eol conversion, which is specified by @code{eol-type}.
636@var{eol-type} should be @code{unix}, @code{dos}, @code{mac}, or 638@var{eol-type} should be @code{unix}, @code{dos}, @code{mac}, or
637@code{nil}. If it is @code{nil}, the returned coding system determines 639@code{nil}. If it is @code{nil}, the returned coding system determines
638the end-of-line conversion from the data. 640the end-of-line conversion from the data.
@@ -694,6 +696,31 @@ This function is like @code{detect-coding-region} except that it
694operates on the contents of @var{string} instead of bytes in the buffer. 696operates on the contents of @var{string} instead of bytes in the buffer.
695@end defun 697@end defun
696 698
699 @xref{Process Information}, for how to examine or set the coding
700systems used for I/O to a subprocess.
701
702@node User-Chosen Coding Systems
703@subsection User-Chosen Coding Systems
704
705@tindex select-safe-coding-system
706@defun select-safe-coding-system from to &optional preferred-coding-system
707This function selects a coding system for encoding the between
708@var{from} and @var{to}, asking the user to choose if necessary.
709
710The optional argument @var{preferred-coding-system} specifies a coding
711system try first. If it can handle the text in the specified region,
712then it is used. If this argument is omitted, the current buffer's
713value of @code{buffer-file-coding-system} is tried first.
714
715If the region contains some multibyte characters that the preferred
716coding system cannot encode, this function asks the user to choose from
717a list of coding systems which can encode the text, and returns the
718user's choice.
719
720One other kludgy feature: if @var{from} is a string, the string is the
721target text, and @var{to} is ignored.
722@end defun
723
697 Here are two functions you can use to let the user specify a coding 724 Here are two functions you can use to let the user specify a coding
698system, with completion. @xref{Completion}. 725system, with completion. @xref{Completion}.
699 726
@@ -713,15 +740,12 @@ the user tries to enter null input, it asks the user to try again.
713@xref{Coding Systems}. 740@xref{Coding Systems}.
714@end defun 741@end defun
715 742
716 @xref{Process Information}, for how to examine or set the coding
717systems used for I/O to a subprocess.
718
719@node Default Coding Systems 743@node Default Coding Systems
720@subsection Default Coding Systems 744@subsection Default Coding Systems
721 745
722 This section describes variables that specify the default coding 746 This section describes variables that specify the default coding
723system for certain files or when running certain subprograms, and the 747system for certain files or when running certain subprograms, and the
724function which which I/O operations use to access them. 748function that I/O operations use to access them.
725 749
726 The idea of these variables is that you set them once and for all to the 750 The idea of these variables is that you set them once and for all to the
727defaults you want, and then do not change them again. To specify a 751defaults you want, and then do not change them again. To specify a
@@ -738,7 +762,7 @@ reading and writing particular files. Each element has the form
738expression that matches certain file names. The element applies to file 762expression that matches certain file names. The element applies to file
739names that match @var{pattern}. 763names that match @var{pattern}.
740 764
741The @sc{cdr} of the element, @var{val}, should be either a coding 765The @sc{cdr} of the element, @var{coding}, should be either a coding
742system, a cons cell containing two coding systems, or a function symbol. 766system, a cons cell containing two coding systems, or a function symbol.
743If @var{val} is a coding system, that coding system is used for both 767If @var{val} is a coding system, that coding system is used for both
744reading the file and writing it. If @var{val} is a cons cell containing 768reading the file and writing it. If @var{val} is a cons cell containing
@@ -763,7 +787,7 @@ other coding systems later using @code{set-process-coding-system}.
763 787
764 @strong{Warning:} Coding systems such as @code{undecided} which 788 @strong{Warning:} Coding systems such as @code{undecided} which
765determine the coding system from the data do not work entirely reliably 789determine the coding system from the data do not work entirely reliably
766with asynchronous subprocess output. This is because Emacs processes 790with asynchronous subprocess output. This is because Emacs handles
767asynchronous subprocess output in batches, as it arrives. If the coding 791asynchronous subprocess output in batches, as it arrives. If the coding
768system leaves the character code conversion unspecified, or leaves the 792system leaves the character code conversion unspecified, or leaves the
769end-of-line conversion unspecified, Emacs must try to detect the proper 793end-of-line conversion unspecified, Emacs must try to detect the proper
@@ -917,6 +941,15 @@ write them with @code{write-region} (@pxref{Writing to Files}), and
917suppress encoding for that @code{write-region} call by binding 941suppress encoding for that @code{write-region} call by binding
918@code{coding-system-for-write} to @code{no-conversion}. 942@code{coding-system-for-write} to @code{no-conversion}.
919 943
944 Raw bytes sometimes contain overlong byte-sequences that look like a
945proper multibyte character plus extra bytes containing trailing codes.
946For most purposes, Emacs treats such a sequence in a buffer or string as
947a single character, and if you look at its character code, you get the
948value that corresponds to the multibyte character sequence---the extra
949bytes are disregarded. This behavior is not quite clean, but raw bytes
950are used only in limited places in Emacs, so as a practical matter
951problems can be avoided.
952
920@defun encode-coding-region start end coding-system 953@defun encode-coding-region start end coding-system
921@tindex encode-coding-region 954@tindex encode-coding-region
922This function encodes the text from @var{start} to @var{end} according 955This function encodes the text from @var{start} to @var{end} according
@@ -1092,12 +1125,14 @@ This variable defines all the supported input methods.
1092Each element defines one input method, and should have the form: 1125Each element defines one input method, and should have the form:
1093 1126
1094@example 1127@example
1095(@var{input-method} @var{language-env} @var{activate-func} @var{title} @var{description} @var{args}...) 1128(@var{input-method} @var{language-env} @var{activate-func}
1129 @var{title} @var{description} @var{args}...)
1096@end example 1130@end example
1097 1131
1098Here @var{input-method} is the input method name, a string; @var{env} is 1132Here @var{input-method} is the input method name, a string;
1099another string, the name of the language environment this input method 1133@var{language-env} is another string, the name of the language
1100is recommended for. (That serves only for documentation purposes.) 1134environment this input method is recommended for. (That serves only for
1135documentation purposes.)
1101 1136
1102@var{title} is a string to display in the mode line while this method is 1137@var{title} is a string to display in the mode line while this method is
1103active. @var{description} is a string describing this method and what 1138active. @var{description} is a string describing this method and what
@@ -1107,6 +1142,6 @@ it is good for.
1107@var{args}, if any, are passed as arguments to @var{activate-func}. All 1142@var{args}, if any, are passed as arguments to @var{activate-func}. All
1108told, the arguments to @var{activate-func} are @var{input-method} and 1143told, the arguments to @var{activate-func} are @var{input-method} and
1109the @var{args}. 1144the @var{args}.
1110@end defun 1145@end defvar
1111 1146
1112 1147
diff --git a/lispref/os.texi b/lispref/os.texi
index b3764422dff..f9b6595f71c 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -19,6 +19,7 @@ pertaining to the terminal and the screen.
19* Getting Out:: How exiting works (permanent or temporary). 19* Getting Out:: How exiting works (permanent or temporary).
20* System Environment:: Distinguish the name and kind of system. 20* System Environment:: Distinguish the name and kind of system.
21* User Identification:: Finding the name and user id of the user. 21* User Identification:: Finding the name and user id of the user.
22* Reading a Password:: Reading a password from the terminal.
22* Time of Day:: Getting the current time. 23* Time of Day:: Getting the current time.
23* Time Conversion:: Converting a time from numeric form to a string, or 24* Time Conversion:: Converting a time from numeric form to a string, or
24 to calendrical data (or vice versa). 25 to calendrical data (or vice versa).
@@ -195,6 +196,7 @@ loading of this file with the option @samp{-no-site-file}.
195@defvar site-run-file 196@defvar site-run-file
196This variable specifies the site-customization file to load 197This variable specifies the site-customization file to load
197before the user's init file. Its normal value is @code{"site-start"}. 198before the user's init file. Its normal value is @code{"site-start"}.
199(The only way to change it with real effect is before dumping Emacs.)
198@end defvar 200@end defvar
199 201
200 If there is a great deal of code in your @file{.emacs} file, you 202 If there is a great deal of code in your @file{.emacs} file, you
@@ -214,12 +216,13 @@ then the default library is not loaded. The default value is
214@end defopt 216@end defopt
215 217
216@defvar before-init-hook 218@defvar before-init-hook
217This normal hook is run, once, just before loading of all the init files 219This normal hook is run, once, just before loading all the init files
218(the user's init file, @file{default.el}, and/or @file{site-start.el}). 220(the user's init file, @file{default.el}, and/or @file{site-start.el}).
221(The only way to change it with real effect is before dumping Emacs.)
219@end defvar 222@end defvar
220 223
221@defvar after-init-hook 224@defvar after-init-hook
222This normal hook is run, once, just after loading of all the init files 225This normal hook is run, once, just after loading all the init files
223(the user's init file, @file{default.el}, and/or @file{site-start.el}), 226(the user's init file, @file{default.el}, and/or @file{site-start.el}),
224before the terminal-specific initialization. 227before the terminal-specific initialization.
225@end defvar 228@end defvar
@@ -568,6 +571,9 @@ The value of this variable is a symbol indicating the type of operating
568system Emacs is operating on. Here is a table of the possible values: 571system Emacs is operating on. Here is a table of the possible values:
569 572
570@table @code 573@table @code
574@item alpha-vms
575VMS on the Alpha.
576
571@item aix-v3 577@item aix-v3
572AIX. 578AIX.
573 579
@@ -727,13 +733,13 @@ containing the Emacs executable.
727@end defvar 733@end defvar
728 734
729@defun load-average &optional use-float 735@defun load-average &optional use-float
730This function returns the current 1-minute, 5-minute and 15-minute load 736This function returns the current 1-minute, 5-minute, and 15-minute load
731averages in a list. 737averages, in a list.
732 738
733By default, the values are integers that are 100 times the system load 739By default, the values are integers that are 100 times the system load
734averages, which indicate the average number of processes trying to run. 740averages, which indicate the average number of processes trying to run.
735If @var{use-float} is non-@code{nil}, then they are returned 741If @var{use-float} is non-@code{nil}, then they are returned
736as floating point numbers instead. 742as floating point numbers and without multiplying by 100.
737 743
738@example 744@example
739@group 745@group
@@ -864,6 +870,29 @@ This function returns the real @sc{uid} of the user.
864This function returns the effective @sc{uid} of the user. 870This function returns the effective @sc{uid} of the user.
865@end defun 871@end defun
866 872
873@node Reading a Password
874@section Reading a Password
875@cindex passwords, reading
876
877 To read a password to pass to another program, you can use the
878function @code{read-passwd}.
879
880@tindex read-passwd
881@defun read-passwd prompt &optional confirm default
882This function reads a password, prompting with @var{prompt}. It does
883not echo the password as the user types it; instead, it echoes @samp{.}
884for each character in the password.
885
886The optional argument @var{confirm}, if non-@code{nil}, says to read the
887password twice and insist it must be the same both times. If it isn't
888the same, the user has to type it over and over until the last two
889times match.
890
891The optional argument @var{default} specifies the default password to
892return if the user enters empty input. If @var{default} is @code{nil},
893then @code{read-passwd} returns the null string in that case.
894@end defun
895
867@node Time of Day 896@node Time of Day
868@section Time of Day 897@section Time of Day
869 898
@@ -1129,7 +1158,7 @@ after a certain length of idleness.
1129 Emacs cannot run timers at any arbitrary point in a Lisp program; it 1158 Emacs cannot run timers at any arbitrary point in a Lisp program; it
1130can run them only when Emacs could accept output from a subprocess: 1159can run them only when Emacs could accept output from a subprocess:
1131namely, while waiting or inside certain primitive functions such as 1160namely, while waiting or inside certain primitive functions such as
1132@code{sit-for} or @code{read-char} which @emph{can} wait. Therefore, a 1161@code{sit-for} or @code{read-event} which @emph{can} wait. Therefore, a
1133timer's execution may be delayed if Emacs is busy. However, the time of 1162timer's execution may be delayed if Emacs is busy. However, the time of
1134execution is very precise if Emacs is idle. 1163execution is very precise if Emacs is idle.
1135 1164
@@ -1139,8 +1168,9 @@ at time @var{time}. The argument @var{function} is a function to call
1139later, and @var{args} are the arguments to give it when it is called. 1168later, and @var{args} are the arguments to give it when it is called.
1140The time @var{time} is specified as a string. 1169The time @var{time} is specified as a string.
1141 1170
1142Absolute times may be specified in a wide variety of formats, and tries 1171Absolute times may be specified in a wide variety of formats; this
1143to accept all common date formats. Valid formats include these two, 1172function tries to accept all the commonly used date formats. Valid
1173formats include these two,
1144 1174
1145@example 1175@example
1146@var{year}-@var{month}-@var{day} @var{hour}:@var{min}:@var{sec} @var{timezone} 1176@var{year}-@var{month}-@var{day} @var{hour}:@var{min}:@var{sec} @var{timezone}
@@ -1664,7 +1694,7 @@ It is not crucial to exclude from the alist the keysyms of other X
1664servers; those do no harm, as long as they don't conflict with the ones 1694servers; those do no harm, as long as they don't conflict with the ones
1665used by the X server actually in use. 1695used by the X server actually in use.
1666 1696
1667The variable is always local to the current X terminal and cannot be 1697The variable is always local to the current terminal, and cannot be
1668buffer-local. @xref{Multiple Displays}. 1698buffer-local. @xref{Multiple Displays}.
1669@end defvar 1699@end defvar
1670 1700
@@ -1684,7 +1714,7 @@ entries and DEC terminal concentrators, see @file{emacs/etc/TERMS}.
1684@code{C-s} and @kbd{C-q} for flow control. Therefore, the choice of 1714@code{C-s} and @kbd{C-q} for flow control. Therefore, the choice of
1685@kbd{C-s} and @kbd{C-q} as command characters for searching and quoting 1715@kbd{C-s} and @kbd{C-q} as command characters for searching and quoting
1686was natural and uncontroversial. With so many commands needing key 1716was natural and uncontroversial. With so many commands needing key
1687assignments. of course we assigned meanings to nearly all @sc{ASCII} 1717assignments, of course we assigned meanings to nearly all @sc{ASCII}
1688control characters. 1718control characters.
1689 1719
1690 Later, some terminals were introduced which required these characters 1720 Later, some terminals were introduced which required these characters
diff --git a/lispref/positions.texi b/lispref/positions.texi
index e4f9a4cc7b8..02bd42b6669 100644
--- a/lispref/positions.texi
+++ b/lispref/positions.texi
@@ -180,13 +180,15 @@ whether a given character is part of a word. @xref{Syntax Tables}.
180 180
181@deffn Command forward-word count 181@deffn Command forward-word count
182This function moves point forward @var{count} words (or backward if 182This function moves point forward @var{count} words (or backward if
183@var{count} is negative). More precisely, it keeps moving until it 183@var{count} is negative). ``Moving one word'' means moving until point
184moves across a word-constituent character and encounters a 184crosses a word-constituent character and then encounters a
185word-separator character, then returns @code{t}. 185word-separator character (or the boundary of the accessible part of the
186buffer).
186 187
187If this motion encounters the beginning or end of the buffer, or the 188If it is possible to move @var{count} words, without being stopped by
188limits of the accessible portion when narrowing is in effect, point 189the buffer boundary (except perhaps after the last word), the value is
189stops there and the value is @code{nil}. 190@code{t}. Otherwise, the return value is @code{nil} and point stops
191at the buffer boundary.
190 192
191In an interactive call, @var{count} is set to the numeric prefix 193In an interactive call, @var{count} is set to the numeric prefix
192argument. 194argument.
@@ -657,7 +659,7 @@ This function moves point in the current buffer forward, skipping over a
657given set of characters. It examines the character following point, 659given set of characters. It examines the character following point,
658then advances point if the character matches @var{character-set}. This 660then advances point if the character matches @var{character-set}. This
659continues until it reaches a character that does not match. The 661continues until it reaches a character that does not match. The
660function returns @code{nil}. 662function returns the number of characters moved over.
661 663
662The argument @var{character-set} is like the inside of a 664The argument @var{character-set} is like the inside of a
663@samp{[@dots{}]} in a regular expression except that @samp{]} is never 665@samp{[@dots{}]} in a regular expression except that @samp{]} is never
@@ -699,6 +701,9 @@ comes back" twice.
699This function moves point backward, skipping characters that match 701This function moves point backward, skipping characters that match
700@var{character-set}, until @var{limit}. It is just like 702@var{character-set}, until @var{limit}. It is just like
701@code{skip-chars-forward} except for the direction of motion. 703@code{skip-chars-forward} except for the direction of motion.
704
705The return value indicates the distance traveled. It is an integer that
706is zero or less.
702@end defun 707@end defun
703 708
704@node Excursions 709@node Excursions
@@ -765,7 +770,7 @@ The value returned by @code{save-excursion} is the result of the last of
765 @strong{Warning:} Ordinary insertion of text adjacent to the saved 770 @strong{Warning:} Ordinary insertion of text adjacent to the saved
766point value relocates the saved value, just as it relocates all markers. 771point value relocates the saved value, just as it relocates all markers.
767Therefore, when the saved point value is restored, it normally comes 772Therefore, when the saved point value is restored, it normally comes
768after the inserted text. 773before the inserted text.
769 774
770 Although @code{save-excursion} saves the location of the mark, it does 775 Although @code{save-excursion} saves the location of the mark, it does
771not prevent functions which modify the buffer from setting 776not prevent functions which modify the buffer from setting
diff --git a/lispref/processes.texi b/lispref/processes.texi
index 8589348b282..400ab2e53a6 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -79,12 +79,12 @@ Expansion}).
79 79
80 Each of the subprocess-creating functions has a @var{buffer-or-name} 80 Each of the subprocess-creating functions has a @var{buffer-or-name}
81argument which specifies where the standard output from the program will 81argument which specifies where the standard output from the program will
82go. It should be a buffer or a buffer name (which will create the 82go. It should be a buffer or a buffer name; if it is a buffer name,
83buffer if it does not already exist). It can also be @code{nil}, which 83that will create the buffer if it does not already exist. It can also
84says to discard the output unless a filter function handles it. 84be @code{nil}, which says to discard the output unless a filter function
85(@xref{Filter Functions}, and @ref{Read and Print}.) Normally, you 85handles it. (@xref{Filter Functions}, and @ref{Read and Print}.)
86should avoid having multiple processes send output to the same buffer 86Normally, you should avoid having multiple processes send output to the
87because their output would be intermixed randomly. 87same buffer because their output would be intermixed randomly.
88 88
89@cindex program arguments 89@cindex program arguments
90 All three of the subprocess-creating functions have a @code{&rest} 90 All three of the subprocess-creating functions have a @code{&rest}
@@ -102,14 +102,14 @@ must use @var{args} to provide those.
102@code{default-directory} (@pxref{File Name Expansion}). 102@code{default-directory} (@pxref{File Name Expansion}).
103 103
104@cindex environment variables, subprocesses 104@cindex environment variables, subprocesses
105 The subprocess inherits its environment from Emacs; but you can 105 The subprocess inherits its environment from Emacs, but you can
106specify overrides for it with @code{process-environment}. @xref{System 106specify overrides for it with @code{process-environment}. @xref{System
107Environment}. 107Environment}.
108 108
109@defvar exec-directory 109@defvar exec-directory
110@pindex movemail 110@pindex movemail
111The value of this variable is the name of a directory (a string) that 111The value of this variable is the name of a directory (a string) that
112contains programs that come with GNU Emacs, that are intended for Emacs 112contains programs that come with GNU Emacs, programs intended for Emacs
113to invoke. The program @code{movemail} is an example of such a program; 113to invoke. The program @code{movemail} is an example of such a program;
114Rmail uses it to fetch new mail from an inbox. 114Rmail uses it to fetch new mail from an inbox.
115@end defvar 115@end defvar
@@ -224,7 +224,7 @@ parallel with Emacs; but you can think of it as synchronous in that
224Emacs is essentially finished with the subprocess as soon as this 224Emacs is essentially finished with the subprocess as soon as this
225function returns. 225function returns.
226 226
227@item (@var{real-destination} @var{error-destination}) 227@item @code{(@var{real-destination} @var{error-destination})}
228Keep the standard output stream separate from the standard error stream; 228Keep the standard output stream separate from the standard error stream;
229deal with the ordinary output as specified by @var{real-destination}, 229deal with the ordinary output as specified by @var{real-destination},
230and dispose of the error output according to @var{error-destination}. 230and dispose of the error output according to @var{error-destination}.
@@ -365,8 +365,8 @@ then returns the command's output as a string.
365@section Creating an Asynchronous Process 365@section Creating an Asynchronous Process
366@cindex asynchronous subprocess 366@cindex asynchronous subprocess
367 367
368 After an @dfn{asynchronous process} is created, Emacs and the Lisp 368 After an @dfn{asynchronous process} is created, Emacs and the subprocess
369program both continue running immediately. The process thereafter runs 369both continue running immediately. The process thereafter runs
370in parallel with Emacs, and the two can communicate with each other 370in parallel with Emacs, and the two can communicate with each other
371using the functions described in following sections. However, 371using the functions described in following sections. However,
372communication is only partially asynchronous: Emacs sends data to the 372communication is only partially asynchronous: Emacs sends data to the
@@ -484,13 +484,13 @@ deleted automatically after they terminate, but not necessarily right
484away. If you delete a terminated process explicitly before it is 484away. If you delete a terminated process explicitly before it is
485deleted automatically, no harm results. 485deleted automatically, no harm results.
486 486
487@defvar delete-exited-processes 487@defopt delete-exited-processes
488This variable controls automatic deletion of processes that have 488This variable controls automatic deletion of processes that have
489terminated (due to calling @code{exit} or to a signal). If it is 489terminated (due to calling @code{exit} or to a signal). If it is
490@code{nil}, then they continue to exist until the user runs 490@code{nil}, then they continue to exist until the user runs
491@code{list-processes}. Otherwise, they are deleted immediately after 491@code{list-processes}. Otherwise, they are deleted immediately after
492they exit. 492they exit.
493@end defvar 493@end defopt
494 494
495@defun delete-process name 495@defun delete-process name
496This function deletes the process associated with @var{name}, killing it 496This function deletes the process associated with @var{name}, killing it
@@ -505,10 +505,15 @@ the name of a process, a buffer, or the name of a buffer.
505@end smallexample 505@end smallexample
506@end defun 506@end defun
507 507
508@defun process-kill-without-query process 508@defun process-kill-without-query process &optional do-query
509This function declares that Emacs need not query the user if 509This function specifies whether Emacs should query the user if
510@var{process} is still running when Emacs is exited. The process will 510@var{process} is still running when Emacs is exited. If @var{do-query}
511be deleted silently. The value is @code{t}. 511is @code{nil}, the process will be deleted silently.
512Otherwise, Emacs will query about killing it.
513
514The value is @code{t} if the process was formerly set up to require
515query. @code{nil} otherwise. A newly-created process always requires
516query.
512 517
513@smallexample 518@smallexample
514@group 519@group
@@ -1145,9 +1150,7 @@ subprocess output.
1145The argument @var{seconds} need not be an integer. If it is a floating 1150The argument @var{seconds} need not be an integer. If it is a floating
1146point number, this function waits for a fractional number of seconds. 1151point number, this function waits for a fractional number of seconds.
1147Some systems support only a whole number of seconds; on these systems, 1152Some systems support only a whole number of seconds; on these systems,
1148@var{seconds} is rounded down. If the system doesn't support waiting 1153@var{seconds} is rounded down.
1149fractions of a second, you get an error if you specify nonzero
1150@var{millisec}.
1151 1154
1152Not all operating systems support waiting periods other than multiples 1155Not all operating systems support waiting periods other than multiples
1153of a second; on those that do not, you get an error if you specify 1156of a second; on those that do not, you get an error if you specify
diff --git a/lispref/searching.texi b/lispref/searching.texi
index 7ba8a9fe666..265bc9aba5b 100644
--- a/lispref/searching.texi
+++ b/lispref/searching.texi
@@ -234,7 +234,7 @@ backtracking loops. For example, it could take hours for the regular
234expression @samp{\(x+y*\)*a} to try to match the sequence 234expression @samp{\(x+y*\)*a} to try to match the sequence
235@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}, before it ultimately fails. 235@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}, before it ultimately fails.
236The slowness is because Emacs must try each imaginable way of grouping 236The slowness is because Emacs must try each imaginable way of grouping
237the 35 @samp{x}'s before concluding that none of them can work. To make 237the 35 @samp{x}s before concluding that none of them can work. To make
238sure your regular expressions run fast, check nested repetitions 238sure your regular expressions run fast, check nested repetitions
239carefully. 239carefully.
240 240
@@ -266,9 +266,9 @@ matches @samp{cr}, @samp{car}, @samp{cdr}, @samp{caddaar}, etc.
266 266
267You can also include character ranges in a character alternative, by 267You can also include character ranges in a character alternative, by
268writing the starting and ending characters with a @samp{-} between them. 268writing the starting and ending characters with a @samp{-} between them.
269Thus, @samp{[a-z]} matches any lower-case ASCII letter. Ranges may be 269Thus, @samp{[a-z]} matches any lower-case @sc{ASCII} letter. Ranges may be
270intermixed freely with individual characters, as in @samp{[a-z$%.]}, 270intermixed freely with individual characters, as in @samp{[a-z$%.]},
271which matches any lower case ASCII letter or @samp{$}, @samp{%} or 271which matches any lower case @sc{ASCII} letter or @samp{$}, @samp{%} or
272period. 272period.
273 273
274You cannot always match all non-@sc{ASCII} characters with the regular 274You cannot always match all non-@sc{ASCII} characters with the regular
@@ -280,9 +280,9 @@ does match all non-@sc{ASCII} characters, in both multibyte and unibyte
280representations, because only the @sc{ASCII} characters are excluded. 280representations, because only the @sc{ASCII} characters are excluded.
281 281
282The beginning and end of a range must be in the same character set 282The beginning and end of a range must be in the same character set
283(@pxref{Character Sets}). Thus, @samp{[a-\x8c0]} is invalid because 283(@pxref{Character Sets}). Thus, @samp{[a-\x8e0]} is invalid because
284@samp{a} is in the @sc{ASCII} character set but the character 0x8c0 284@samp{a} is in the @sc{ASCII} character set but the character 0x8e0
285(@samp{A} with grave accent) is in the Emacs character set for Latin-1. 285(@samp{a} with grave accent) is in the Emacs character set for Latin-1.
286 286
287Note that the usual regexp special characters are not special inside a 287Note that the usual regexp special characters are not special inside a
288character alternative. A completely different set of characters are 288character alternative. A completely different set of characters are
@@ -1286,7 +1286,7 @@ that shows the problem that arises if you fail to save the match data:
1286 You can save and restore the match data with @code{save-match-data}: 1286 You can save and restore the match data with @code{save-match-data}:
1287 1287
1288@defmac save-match-data body@dots{} 1288@defmac save-match-data body@dots{}
1289This special form executes @var{body}, saving and restoring the match 1289This macro executes @var{body}, saving and restoring the match
1290data around it. 1290data around it.
1291@end defmac 1291@end defmac
1292 1292
diff --git a/lispref/sequences.texi b/lispref/sequences.texi
index 26263831d1c..f812112e243 100644
--- a/lispref/sequences.texi
+++ b/lispref/sequences.texi
@@ -637,7 +637,7 @@ name. @xref{Splitting Characters}, for a description of generic characters.
637 637
638@defun set-char-table-range char-table range value 638@defun set-char-table-range char-table range value
639@tindex set-char-table-range 639@tindex set-char-table-range
640This function set the value in @var{char-table} for a range of 640This function sets the value in @var{char-table} for a range of
641characters @var{range}. Here are the possibilities for @var{range}: 641characters @var{range}. Here are the possibilities for @var{range}:
642 642
643@table @asis 643@table @asis
@@ -678,11 +678,13 @@ The return value is always @code{nil}; to make this function useful,
678here is how to examine each element of the syntax table: 678here is how to examine each element of the syntax table:
679 679
680@example 680@example
681(map-char-table 681(let (accumulator)
682 #'(lambda (key value) 682 (map-char-table
683 (setq accumulator 683 #'(lambda (key value)
684 (cons (list key value) accumulator))) 684 (setq accumulator
685 (syntax-table)) 685 (cons (list key value) accumulator)))
686 (syntax-table))
687 accumulator)
686@result{} 688@result{}
687((475008 nil) (474880 nil) (474752 nil) (474624 nil) 689((475008 nil) (474880 nil) (474752 nil) (474624 nil)
688 ... (5 (3)) (4 (3)) (3 (3)) (2 (3)) (1 (3)) (0 (3))) 690 ... (5 (3)) (4 (3)) (3 (3)) (2 (3)) (1 (3)) (0 (3)))
diff --git a/lispref/streams.texi b/lispref/streams.texi
index cf3f14a095f..5521f74d876 100644
--- a/lispref/streams.texi
+++ b/lispref/streams.texi
@@ -390,11 +390,6 @@ initially located as shown immediately before the @samp{h} in
390@cindex print example 390@cindex print example
391@example 391@example
392@group 392@group
393(setq m (set-marker (make-marker) 10 (get-buffer "foo")))
394 @result{} #<marker at 10 in foo>
395@end group
396
397@group
398---------- Buffer: foo ---------- 393---------- Buffer: foo ----------
399This is t@point{}he contents of foo. 394This is t@point{}he contents of foo.
400---------- Buffer: foo ---------- 395---------- Buffer: foo ----------
@@ -404,10 +399,6 @@ This is t@point{}he contents of foo.
404 @result{} "This is the output" 399 @result{} "This is the output"
405 400
406@group 401@group
407m
408 @result{} #<marker at 32 in foo>
409@end group
410@group
411---------- Buffer: foo ---------- 402---------- Buffer: foo ----------
412This is t 403This is t
413"This is the output" 404"This is the output"
@@ -431,8 +422,8 @@ This is the @point{}output
431@end group 422@end group
432 423
433@group 424@group
434m 425(setq m (copy-marker 10))
435 @result{} #<marker at 11 in foo> 426 @result{} #<marker at 10 in foo>
436@end group 427@end group
437 428
438@group 429@group
@@ -450,7 +441,7 @@ he @point{}output
450 441
451@group 442@group
452m 443m
453 @result{} #<marker at 35 in foo> 444 @result{} #<marker at 34 in foo>
454@end group 445@end group
455@end example 446@end example
456 447
@@ -723,6 +714,14 @@ In the second expression, the local binding of
723@code{prin1}, but not during the printing of the result. 714@code{prin1}, but not during the printing of the result.
724@end defvar 715@end defvar
725 716
717@tindex print-escape-nonascii
718@defvar print-escape-nonascii
719If this variable is non-@code{nil}, then unibyte non-@sc{ASCII}
720characters in strings are unconditionally printed as backslash sequences
721by the print functions @code{prin1} and @code{print} that print with
722quoting.
723@end defvar
724
726@defvar print-length 725@defvar print-length
727@cindex printing limits 726@cindex printing limits
728The value of this variable is the maximum number of elements to print in 727The value of this variable is the maximum number of elements to print in
diff --git a/lispref/strings.texi b/lispref/strings.texi
index 5e511a5d331..dc4aaabb18e 100644
--- a/lispref/strings.texi
+++ b/lispref/strings.texi
@@ -439,9 +439,9 @@ the string). The specified part of @var{string2} runs from index
439@var{start2} up to index @var{end2} (default, the end of the string). 439@var{start2} up to index @var{end2} (default, the end of the string).
440 440
441The strings are both converted to multibyte for the comparison 441The strings are both converted to multibyte for the comparison
442(@pxref{Text Representations}) so that a unibyte string can be usefully 442(@pxref{Text Representations}) so that a unibyte string can be equal to
443compared with a multibyte string. If @var{ignore-case} is 443a multibyte string. If @var{ignore-case} is non-@code{nil}, then case
444non-@code{nil}, then case is ignored as well. 444is ignored, so that upper case letters can be equal to lower case letters.
445 445
446If the specified portions of the two strings match, the value is 446If the specified portions of the two strings match, the value is
447@code{t}. Otherwise, the value is an integer which indicates how many 447@code{t}. Otherwise, the value is an integer which indicates how many
diff --git a/lispref/syntax.texi b/lispref/syntax.texi
index b6a5ea9a132..35cde861d15 100644
--- a/lispref/syntax.texi
+++ b/lispref/syntax.texi
@@ -362,7 +362,7 @@ character, @samp{/}, does have the @samp{b} flag.
362 362
363@item @samp{*/} 363@item @samp{*/}
364This is a comment-end sequence for ``a'' style because the first 364This is a comment-end sequence for ``a'' style because the first
365character, @samp{*}, does not have the @samp{b} flag 365character, @samp{*}, does not have the @samp{b} flag.
366 366
367@item newline 367@item newline
368This is a comment-end sequence for ``b'' style, because the newline 368This is a comment-end sequence for ``b'' style, because the newline
@@ -542,10 +542,8 @@ This function moves point forward across characters having syntax classes
542mentioned in @var{syntaxes}. It stops when it encounters the end of 542mentioned in @var{syntaxes}. It stops when it encounters the end of
543the buffer, or position @var{limit} (if specified), or a character it is 543the buffer, or position @var{limit} (if specified), or a character it is
544not supposed to skip. 544not supposed to skip.
545@ignore @c may want to change this.
546The return value is the distance traveled, which is a nonnegative 545The return value is the distance traveled, which is a nonnegative
547integer. 546integer.
548@end ignore
549@end defun 547@end defun
550 548
551@defun skip-syntax-backward syntaxes &optional limit 549@defun skip-syntax-backward syntaxes &optional limit
@@ -553,10 +551,9 @@ This function moves point backward across characters whose syntax
553classes are mentioned in @var{syntaxes}. It stops when it encounters 551classes are mentioned in @var{syntaxes}. It stops when it encounters
554the beginning of the buffer, or position @var{limit} (if specified), or a 552the beginning of the buffer, or position @var{limit} (if specified), or a
555character it is not supposed to skip. 553character it is not supposed to skip.
556@ignore @c may want to change this. 554
557The return value indicates the distance traveled. It is an integer that 555The return value indicates the distance traveled. It is an integer that
558is zero or less. 556is zero or less.
559@end ignore
560@end defun 557@end defun
561 558
562@defun backward-prefix-chars 559@defun backward-prefix-chars
@@ -598,7 +595,7 @@ stops when it comes to any character that starts a sexp. If
598@var{stop-comment} is non-@code{nil}, parsing stops when it comes to the 595@var{stop-comment} is non-@code{nil}, parsing stops when it comes to the
599start of a comment. If @var{stop-comment} is the symbol 596start of a comment. If @var{stop-comment} is the symbol
600@code{syntax-table}, parsing stops after the start of a comment or a 597@code{syntax-table}, parsing stops after the start of a comment or a
601string, or the of a comment or a string, whichever comes first. 598string, or the end of a comment or a string, whichever comes first.
602 599
603@cindex parse state 600@cindex parse state
604The fifth argument @var{state} is a nine-element list of the same form 601The fifth argument @var{state} is a nine-element list of the same form
@@ -893,7 +890,7 @@ in category table @var{table}.
893@defun get-unused-category table 890@defun get-unused-category table
894This function returns a category name (a character) which is not 891This function returns a category name (a character) which is not
895currently defined in @var{table}. If all possible categories are in use 892currently defined in @var{table}. If all possible categories are in use
896in @var{table}, it returns @code{nil}, 893in @var{table}, it returns @code{nil}.
897@end defun 894@end defun
898 895
899@defun category-table 896@defun category-table
diff --git a/lispref/text.texi b/lispref/text.texi
index 69f0c002293..f87b4f9948a 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -42,6 +42,7 @@ buffer, together with their properties (when relevant).
42 How to control how much information is kept. 42 How to control how much information is kept.
43* Filling:: Functions for explicit filling. 43* Filling:: Functions for explicit filling.
44* Margins:: How to specify margins for filling commands. 44* Margins:: How to specify margins for filling commands.
45* Adaptive Fill: Adaptive Fill mode chooses a fill prefix from context.
45* Auto Filling:: How auto-fill mode is implemented to break lines. 46* Auto Filling:: How auto-fill mode is implemented to break lines.
46* Sorting:: Functions for sorting parts of the buffer. 47* Sorting:: Functions for sorting parts of the buffer.
47* Columns:: Computing horizontal positions, and using them. 48* Columns:: Computing horizontal positions, and using them.
@@ -62,11 +63,12 @@ buffer, together with their properties (when relevant).
62Several simple functions are described here. See also @code{looking-at} 63Several simple functions are described here. See also @code{looking-at}
63in @ref{Regexp Search}. 64in @ref{Regexp Search}.
64 65
65@defun char-after position 66@defun char-after &optional position
66This function returns the character in the current buffer at (i.e., 67This function returns the character in the current buffer at (i.e.,
67immediately after) position @var{position}. If @var{position} is out of 68immediately after) position @var{position}. If @var{position} is out of
68range for this purpose, either before the beginning of the buffer, or at 69range for this purpose, either before the beginning of the buffer, or at
69or beyond the end, then the value is @code{nil}. 70or beyond the end, then the value is @code{nil}. The default for
71@var{position} is point.
70 72
71In the following example, assume that the first character in the 73In the following example, assume that the first character in the
72buffer is @samp{@@}: 74buffer is @samp{@@}:
@@ -79,11 +81,12 @@ buffer is @samp{@@}:
79@end example 81@end example
80@end defun 82@end defun
81 83
82@defun char-before position 84@defun char-before &optional position
83This function returns the character in the current buffer immediately 85This function returns the character in the current buffer immediately
84before position @var{position}. If @var{position} is out of range for 86before position @var{position}. If @var{position} is out of range for
85this purpose, either before the beginning of the buffer, or at or beyond 87this purpose, either before the beginning of the buffer, or at or beyond
86the end, then the value is @code{nil}. 88the end, then the value is @code{nil}. The default for
89@var{position} is point.
87@end defun 90@end defun
88 91
89@defun following-char 92@defun following-char
@@ -449,9 +452,12 @@ Programs hardly ever use this function.
449@end deffn 452@end deffn
450 453
451@defvar overwrite-mode 454@defvar overwrite-mode
452This variable controls whether overwrite mode is in effect: a 455This variable controls whether overwrite mode is in effect. The value
453non-@code{nil} value enables the mode. It is automatically made 456should be @code{overwrite-mode-textual}, @code{overwrite-mode-binary},
454buffer-local when set in any fashion. 457or @code{nil}. @code{overwrite-mode-textual} specifies textual
458overwrite mode (treats newlines and tabs specially), and
459@code{overwrite-mode-binary} specifies binary overwrite mode (treats
460newlines and tabs like any other characters).
455@end defvar 461@end defvar
456 462
457@node Deletion 463@node Deletion
@@ -467,7 +473,7 @@ cases.
467 All of the deletion functions operate on the current buffer, and all 473 All of the deletion functions operate on the current buffer, and all
468return a value of @code{nil}. 474return a value of @code{nil}.
469 475
470@defun erase-buffer 476@deffn Command erase-buffer
471This function deletes the entire text of the current buffer, leaving it 477This function deletes the entire text of the current buffer, leaving it
472empty. If the buffer is read-only, it signals a @code{buffer-read-only} 478empty. If the buffer is read-only, it signals a @code{buffer-read-only}
473error. Otherwise, it deletes the text without asking for any 479error. Otherwise, it deletes the text without asking for any
@@ -478,7 +484,7 @@ auto-saving of that buffer ``because it has shrunk''. However,
478@code{erase-buffer} does not do this, the idea being that the future 484@code{erase-buffer} does not do this, the idea being that the future
479text is not really related to the former text, and its size should not 485text is not really related to the former text, and its size should not
480be compared with that of the former text. 486be compared with that of the former text.
481@end defun 487@end deffn
482 488
483@deffn Command delete-region start end 489@deffn Command delete-region start end
484This command deletes the text in the current buffer in the region 490This command deletes the text in the current buffer in the region
@@ -779,6 +785,12 @@ is convenient because it lets the user use all the kill commands to copy
779text into the kill ring from a read-only buffer. 785text into the kill ring from a read-only buffer.
780@end deffn 786@end deffn
781 787
788@defopt kill-read-only-ok
789If this option is non-@code{nil}, @code{kill-region} does not get an
790error if the buffer is read-only. Instead, it simply returns, updating
791the kill ring but not changing the buffer.
792@end defopt
793
782@deffn Command copy-region-as-kill start end 794@deffn Command copy-region-as-kill start end
783This command saves the region defined by @var{start} and @var{end} on 795This command saves the region defined by @var{start} and @var{end} on
784the kill ring (including text properties), but does not delete the text 796the kill ring (including text properties), but does not delete the text
@@ -1000,10 +1012,11 @@ A value of @code{t} disables the recording of undo information.
1000Here are the kinds of elements an undo list can have: 1012Here are the kinds of elements an undo list can have:
1001 1013
1002@table @code 1014@table @code
1003@item @var{integer} 1015@item @var{position}
1004This kind of element records a previous value of point. Ordinary cursor 1016This kind of element records a previous value of point; undoing this
1005motion does not get any sort of undo record, but deletion operations use 1017element moves point to @var{position}. Ordinary cursor motion does not
1006these entries to record where point was before the command. 1018make any sort of undo record, but deletion operations use these entries
1019to record where point was before the command.
1007 1020
1008@item (@var{beg} . @var{end}) 1021@item (@var{beg} . @var{end})
1009This kind of element indicates how to delete text that was inserted. 1022This kind of element indicates how to delete text that was inserted.
@@ -1037,11 +1050,6 @@ relocated due to deletion of surrounding text, and that it moved
1037@var{adjustment} character positions. Undoing this element moves 1050@var{adjustment} character positions. Undoing this element moves
1038@var{marker} @minus{} @var{adjustment} characters. 1051@var{marker} @minus{} @var{adjustment} characters.
1039 1052
1040@item @var{position}
1041This element indicates where point was at an earlier time. Undoing this
1042element sets point to @var{position}. Deletion normally creates an
1043element of this kind as well as a reinsertion element.
1044
1045@item nil 1053@item nil
1046This element is a boundary. The elements between two boundaries are 1054This element is a boundary. The elements between two boundaries are
1047called a @dfn{change group}; normally, each change group corresponds to 1055called a @dfn{change group}; normally, each change group corresponds to
@@ -1185,11 +1193,16 @@ It uses the ordinary paragraph motion commands to find paragraph
1185boundaries. @xref{Paragraphs,,, emacs, The Emacs Manual}. 1193boundaries. @xref{Paragraphs,,, emacs, The Emacs Manual}.
1186@end deffn 1194@end deffn
1187 1195
1188@deffn Command fill-region start end &optional justify 1196@deffn Command fill-region start end &optional justify nosqueeze
1189This command fills each of the paragraphs in the region from @var{start} 1197This command fills each of the paragraphs in the region from @var{start}
1190to @var{end}. It justifies as well if @var{justify} is 1198to @var{end}. It justifies as well if @var{justify} is
1191non-@code{nil}. 1199non-@code{nil}.
1192 1200
1201If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace
1202other than line breaks untouched. If @var{to-eop} is non-@code{nil},
1203that means to keep filling to the end of the paragraph---or next hard
1204newline, if @code{use-hard-newlines} is enabled (see below).
1205
1193The variable @code{paragraph-separate} controls how to distinguish 1206The variable @code{paragraph-separate} controls how to distinguish
1194paragraphs. @xref{Standard Regexps}. 1207paragraphs. @xref{Standard Regexps}.
1195@end deffn 1208@end deffn
@@ -1220,7 +1233,7 @@ This variable alters the action of @code{fill-individual-paragraphs} as
1220described above. 1233described above.
1221@end defopt 1234@end defopt
1222 1235
1223@deffn Command fill-region-as-paragraph start end &optional justify 1236@deffn Command fill-region-as-paragraph start end &optional justify nosqueeze squeeze-after
1224This command considers a region of text as a single paragraph and fills 1237This command considers a region of text as a single paragraph and fills
1225it. If the region was made up of many paragraphs, the blank lines 1238it. If the region was made up of many paragraphs, the blank lines
1226between paragraphs are removed. This function justifies as well as 1239between paragraphs are removed. This function justifies as well as
@@ -1228,11 +1241,13 @@ filling when @var{justify} is non-@code{nil}.
1228 1241
1229In an interactive call, any prefix argument requests justification. 1242In an interactive call, any prefix argument requests justification.
1230 1243
1231@cindex Adaptive Fill mode 1244If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace
1232In Adaptive Fill mode, which is enabled by default, calling the function 1245other than line breaks untouched. If @var{squeeze-after} is
1233@code{fill-region-as-paragraph} on an indented paragraph when there is 1246non-@code{nil}, specifies a position in the region, and means don't
1234no fill prefix uses the indentation of the second line of the paragraph 1247canonicalize spaces before that position.
1235as the fill prefix. 1248
1249In Adaptive Fill mode, this command calls @code{fill-context-prefix} to
1250choose a fill prefix by default. @xref{Adaptive Fill}.
1236@end deffn 1251@end deffn
1237 1252
1238@deffn Command justify-current-line how eop nosqueeze 1253@deffn Command justify-current-line how eop nosqueeze
@@ -1267,6 +1282,12 @@ This function returns the proper justification style to use for filling
1267the text around point. 1282the text around point.
1268@end defun 1283@end defun
1269 1284
1285@defopt sentence-end-double-space
1286If this variable is non-@code{nil}, a period followed by just one space
1287does not count as the end of a sentence, and the filling functions
1288avoid breaking the line at such a place.
1289@end defopt
1290
1270@defvar fill-paragraph-function 1291@defvar fill-paragraph-function
1271This variable provides a way for major modes to override the filling of 1292This variable provides a way for major modes to override the filling of
1272paragraphs. If the value is non-@code{nil}, @code{fill-paragraph} calls 1293paragraphs. If the value is non-@code{nil}, @code{fill-paragraph} calls
@@ -1306,7 +1327,7 @@ together. The resulting filled lines also start with the fill prefix.
1306The fill prefix follows the left margin whitespace, if any. 1327The fill prefix follows the left margin whitespace, if any.
1307@end defopt 1328@end defopt
1308 1329
1309@defvar fill-column 1330@defopt fill-column
1310This buffer-local variable specifies the maximum width of filled lines. 1331This buffer-local variable specifies the maximum width of filled lines.
1311Its value should be an integer, which is a number of columns. All the 1332Its value should be an integer, which is a number of columns. All the
1312filling, justification, and centering commands are affected by this 1333filling, justification, and centering commands are affected by this
@@ -1316,7 +1337,7 @@ As a practical matter, if you are writing text for other people to
1316read, you should set @code{fill-column} to no more than 70. Otherwise 1337read, you should set @code{fill-column} to no more than 70. Otherwise
1317the line will be too long for people to read comfortably, and this can 1338the line will be too long for people to read comfortably, and this can
1318make the text seem clumsy. 1339make the text seem clumsy.
1319@end defvar 1340@end defopt
1320 1341
1321@defvar default-fill-column 1342@defvar default-fill-column
1322The value of this variable is the default value for @code{fill-column} in 1343The value of this variable is the default value for @code{fill-column} in
@@ -1392,6 +1413,50 @@ place where a break is being considered. If the function returns
1392non-@code{nil}, then the line won't be broken there. 1413non-@code{nil}, then the line won't be broken there.
1393@end defvar 1414@end defvar
1394 1415
1416@node Adaptive Fill
1417@section Adaptive Fill Mode
1418@cindex Adaptive Fill mode
1419
1420 Adaptive Fill mode chooses a fill prefix automatically from the text
1421in each paragraph being filled.
1422
1423@defopt adaptive-fill-mode
1424Adaptive Fill mode is enabled when this variable is non-@code{nil}.
1425It is @code{t} by default.
1426@end defopt
1427
1428@defun fill-context-prefix from to
1429This function implements the heart of Adaptive Fill mode; it chooses a
1430fill prefix based on the text between @var{from} and @var{to}. It does
1431this by looking at the first two lines of the paragraph, based on the
1432variables described below.
1433@end defun
1434
1435@defopt adaptive-fill-regexp
1436This variable holds a regular expression to control Adaptive Fill mode.
1437Whichever characters starting after the line's left margin match this
1438regular expression, those are the candidate for the fill prefix.
1439@end defopt
1440
1441@defopt adaptive-fill-first-line-regexp
1442In a one-line paragraph, if the candidate fill prefix matches
1443this regular expression, or if it matches @code{comment-start-skip},
1444then it is used---otherwise, it is replaced with an equivalent
1445number of spaces.
1446
1447However, the fill prefix is never taken from a one-line paragraph
1448if it would act as a paragraph starter on subsequent lines.
1449@end defopt
1450
1451@defopt adaptive-fill-function
1452You can specify more complex ways of choosing a fill prefix
1453automatically by setting this variable to a function. The function is
1454called when @code{adaptive-fill-regexp} does not match, with point after
1455the left margin of a line, and it should return the appropriate fill
1456prefix based on that line. If it returns @code{nil}, that means it sees
1457no fill prefix in that line.
1458@end defopt
1459
1395@node Auto Filling 1460@node Auto Filling
1396@comment node-name, next, previous, up 1461@comment node-name, next, previous, up
1397@section Auto Filling 1462@section Auto Filling
@@ -1513,10 +1578,11 @@ the sort order.
1513@end group 1578@end group
1514@group 1579@group
1515 (interactive "P\nr") 1580 (interactive "P\nr")
1516 (save-restriction 1581 (save-excursion
1517 (narrow-to-region beg end) 1582 (save-restriction
1518 (goto-char (point-min)) 1583 (narrow-to-region beg end)
1519 (sort-subr reverse 'forward-line 'end-of-line))) 1584 (goto-char (point-min))
1585 (sort-subr reverse 'forward-line 'end-of-line))))
1520@end group 1586@end group
1521@end example 1587@end example
1522 1588
@@ -1531,8 +1597,11 @@ its @code{sort-subr} call looks like this:
1531@example 1597@example
1532@group 1598@group
1533(sort-subr reverse 1599(sort-subr reverse
1534 (function 1600 (function
1535 (lambda () (skip-chars-forward "\n \t\f"))) 1601 (lambda ()
1602 (while (and (not (eobp))
1603 (looking-at paragraph-separate))
1604 (forward-line 1))))
1536 'forward-paragraph) 1605 'forward-paragraph)
1537@end group 1606@end group
1538@end example 1607@end example
@@ -1541,6 +1610,11 @@ Markers pointing into any sort records are left with no useful
1541position after @code{sort-subr} returns. 1610position after @code{sort-subr} returns.
1542@end defun 1611@end defun
1543 1612
1613@defopt sort-fold-case
1614If this variable is non-@code{nil}, @code{sort-subr} and the other
1615buffer sorting functions ignore case when comparing strings.
1616@end defopt
1617
1544@deffn Command sort-regexp-fields reverse record-regexp key-regexp start end 1618@deffn Command sort-regexp-fields reverse record-regexp key-regexp start end
1545This command sorts the region between @var{start} and @var{end} 1619This command sorts the region between @var{start} and @var{end}
1546alphabetically as specified by @var{record-regexp} and @var{key-regexp}. 1620alphabetically as specified by @var{record-regexp} and @var{key-regexp}.
@@ -1823,7 +1897,7 @@ but in some text modes, where @key{TAB} inserts a tab,
1823@deffn Command reindent-then-newline-and-indent 1897@deffn Command reindent-then-newline-and-indent
1824@comment !!SourceFile simple.el 1898@comment !!SourceFile simple.el
1825This command reindents the current line, inserts a newline at point, 1899This command reindents the current line, inserts a newline at point,
1826and then reindents the new line (the one following the newline just 1900and then indents the new line (the one following the newline just
1827inserted). 1901inserted).
1828 1902
1829This command does indentation on both lines according to the current 1903This command does indentation on both lines according to the current
@@ -3177,7 +3251,7 @@ end of the region just changed, and the length of the text that existed
3177before the change. All three arguments are integers. The buffer that's 3251before the change. All three arguments are integers. The buffer that's
3178about to change is always the current buffer. 3252about to change is always the current buffer.
3179 3253
3180The length of the old text the difference between the buffer positions 3254The length of the old text is the difference between the buffer positions
3181before and after that text as it was before the change. As for the 3255before and after that text as it was before the change. As for the
3182changed text, its length is simply the difference between the first two 3256changed text, its length is simply the difference between the first two
3183arguments. 3257arguments.
diff --git a/lispref/tips.texi b/lispref/tips.texi
index 264875768b9..5a1b6cc5dcf 100644
--- a/lispref/tips.texi
+++ b/lispref/tips.texi
@@ -354,7 +354,7 @@ compiled specially (@pxref{Array Functions}):
354@end example 354@end example
355 355
356@item 356@item
357If calling a small function accounts for a substantial part of your 357If calling a small function accounts for a substantial part of your
358program's running time, make the function inline. This eliminates 358program's running time, make the function inline. This eliminates
359the function call overhead. Since making a function inline reduces 359the function call overhead. Since making a function inline reduces
360the flexibility of changing the program, don't do it unless it gives 360the flexibility of changing the program, don't do it unless it gives
@@ -396,7 +396,7 @@ that looks good.
396 396
397@item 397@item
398For consistency, phrase the verb in the first sentence of a 398For consistency, phrase the verb in the first sentence of a
399documentation string as an infinitive with ``to'' omitted. For 399function's documentation string as an infinitive with ``to'' omitted. For
400instance, use ``Return the cons of A and B.'' in preference to ``Returns 400instance, use ``Return the cons of A and B.'' in preference to ``Returns
401the cons of A and B@.'' Usually it looks good to do likewise for the 401the cons of A and B@.'' Usually it looks good to do likewise for the
402rest of the first paragraph. Subsequent paragraphs usually look better 402rest of the first paragraph. Subsequent paragraphs usually look better
@@ -478,8 +478,8 @@ t and nil without single-quotes. (In this manual, we use a different
478convention, with single-quotes for all symbols.) 478convention, with single-quotes for all symbols.)
479@end ifinfo 479@end ifinfo
480 480
481Help mode automatically creates hyperlinks when documentation strings 481Help mode automatically creates a hyperlink when a documentation string
482use symbol names inside single quotes, when the symbol has either a 482uses a symbol name inside single quotes, if the symbol has either a
483function or a variable definition. You do not need to do anything 483function or a variable definition. You do not need to do anything
484special to make use of this feature. However, when a symbol has both a 484special to make use of this feature. However, when a symbol has both a
485function definition and a variable definition, and you want to refer to 485function definition and a variable definition, and you want to refer to
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 1451db07d06..4d46e19d0dc 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1073,7 +1073,7 @@ and/or frames is an important customization method.
1073 1073
1074 This section describes buffer-local bindings; for frame-local 1074 This section describes buffer-local bindings; for frame-local
1075bindings, see the following section, @ref{Frame-Local Variables}. (A few 1075bindings, see the following section, @ref{Frame-Local Variables}. (A few
1076variables have bindings that are local to each X terminal; see 1076variables have bindings that are local to each terminal; see
1077@ref{Multiple Displays}.) 1077@ref{Multiple Displays}.)
1078 1078
1079@menu 1079@menu
diff --git a/lispref/windows.texi b/lispref/windows.texi
index bd4bad02137..31151040e58 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -252,10 +252,13 @@ characters; see @ref{Display Tables}.
252@end deffn 252@end deffn
253 253
254@deffn Command split-window-vertically size 254@deffn Command split-window-vertically size
255This function splits the selected window into two windows, one above 255This function splits the selected window into two windows, one above the
256the other, leaving the selected window with @var{size} lines. 256other, leaving the upper of the two window selected, with @var{size}
257lines. (If @var{size} is negative, then the lower of the two windows
258gets @minus{} @var{size} lines and the upper window gets the rest, but
259the upper window is still the one selected.)
257 260
258This function is simply an interface to @code{split-windows}. 261This function is simply an interface to @code{split-window}.
259Here is the complete function definition for it: 262Here is the complete function definition for it:
260 263
261@smallexample 264@smallexample
@@ -272,7 +275,7 @@ Here is the complete function definition for it:
272This function splits the selected window into two windows 275This function splits the selected window into two windows
273side-by-side, leaving the selected window with @var{size} columns. 276side-by-side, leaving the selected window with @var{size} columns.
274 277
275This function is simply an interface to @code{split-windows}. Here is 278This function is simply an interface to @code{split-window}. Here is
276the complete definition for @code{split-window-horizontally} (except for 279the complete definition for @code{split-window-horizontally} (except for
277part of the documentation string): 280part of the documentation string):
278 281
@@ -366,16 +369,20 @@ where there is only one window), then the frame reverts to having a
366single window showing another buffer chosen with @code{other-buffer}. 369single window showing another buffer chosen with @code{other-buffer}.
367@xref{The Buffer List}. 370@xref{The Buffer List}.
368 371
369The argument @var{frame} controls which frames to operate on: 372The argument @var{frame} controls which frames to operate on. This
373function does not use it in quite the same way as the other functions
374which scan all windows; specifically, the values @code{t} and @code{nil}
375have the opposite of their meanings in other functions. Here are the
376full details:
370 377
371@itemize @bullet 378@itemize @bullet
372@item 379@item
373If it is @code{nil}, operate on the selected frame. 380If it is @code{nil}, operate on all frames.
374@item 381@item
375If it is @code{t}, operate on all frames. 382If it is @code{t}, operate on the selected frame.
376@item 383@item
377If it is @code{visible}, operate on all visible frames. 384If it is @code{visible}, operate on all visible frames.
378@item 0 385@item
379If it is 0, operate on all visible or iconified frames. 386If it is 0, operate on all visible or iconified frames.
380@item 387@item
381If it is a frame, operate on that frame. 388If it is a frame, operate on that frame.
@@ -463,8 +470,8 @@ If there are two windows of the same size, then the function returns
463the window that is first in the cyclic ordering of windows (see 470the window that is first in the cyclic ordering of windows (see
464following section), starting from the selected window. 471following section), starting from the selected window.
465 472
466The argument @var{frame} controls which set of windows are 473The argument @var{frame} controls which set of windows to
467considered. See @code{get-lru-window}, above. 474consider. See @code{get-lru-window}, above.
468@end defun 475@end defun
469 476
470@node Cyclic Window Ordering 477@node Cyclic Window Ordering
@@ -677,7 +684,7 @@ This variable records the time at which a buffer was last made visible
677in a window. It is always local in each buffer; each time 684in a window. It is always local in each buffer; each time
678@code{set-window-buffer} is called, it sets this variable to 685@code{set-window-buffer} is called, it sets this variable to
679@code{(current-time)} in the specified buffer (@pxref{Time of Day}). 686@code{(current-time)} in the specified buffer (@pxref{Time of Day}).
680When a buffer is first created, @code{buffer-display-count} starts out 687When a buffer is first created, @code{buffer-display-time} starts out
681with the value @code{nil}. 688with the value @code{nil}.
682@end defvar 689@end defvar
683 690
@@ -704,9 +711,9 @@ functions work by calling @code{set-window-buffer}.
704current so that a Lisp program can access or modify it; they are too 711current so that a Lisp program can access or modify it; they are too
705drastic for that purpose, since they change the display of buffers in 712drastic for that purpose, since they change the display of buffers in
706windows, which would be gratuitous and surprise the user. Instead, use 713windows, which would be gratuitous and surprise the user. Instead, use
707@code{set-buffer} (@pxref{Current Buffer}) and @code{save-excursion} 714@code{set-buffer} and @code{save-current-buffer} (@pxref{Current
708(@pxref{Excursions}), which designate buffers as current for programmed 715Buffer}), which designate buffers as current for programmed access
709access without affecting the display of buffers in windows. 716without affecting the display of buffers in windows.
710 717
711@deffn Command switch-to-buffer buffer-or-name &optional norecord 718@deffn Command switch-to-buffer buffer-or-name &optional norecord
712This function makes @var{buffer-or-name} the current buffer, and also 719This function makes @var{buffer-or-name} the current buffer, and also
@@ -824,11 +831,23 @@ function does nothing.
824@var{buffer-or-name}. 831@var{buffer-or-name}.
825 832
826If the argument @var{frame} is non-@code{nil}, it specifies which frames 833If the argument @var{frame} is non-@code{nil}, it specifies which frames
827to check when deciding whether the buffer is already displayed. Its 834to check when deciding whether the buffer is already displayed. If the
828value means the same thing as in functions @code{get-buffer-window} 835buffer is already displayed in some window on one of these frames,
829(@pxref{Buffers and Windows}). If the buffer is already displayed 836@code{display-buffer} simply returns that window. Here are the possible
830in some window on one of these frames, @code{display-buffer} simply 837values of @var{frame}:
831returns that window. 838
839@itemize @bullet
840@item
841If it is @code{nil}, consider windows on the selected frame.
842@item
843If it is @code{t}, consider windows on all frames.
844@item
845If it is @code{visible}, consider windows on all visible frames.
846@item
847If it is 0, consider windows on all visible or iconified frames.
848@item
849If it is a frame, consider windows on that frame.
850@end itemize
832 851
833Precisely how @code{display-buffer} finds or creates a window depends on 852Precisely how @code{display-buffer} finds or creates a window depends on
834the variables described below. 853the variables described below.
@@ -882,7 +901,7 @@ This variable holds an alist specifying frame parameters used when
882more information about frame parameters. 901more information about frame parameters.
883@end defvar 902@end defvar
884 903
885@defvar special-display-buffer-names 904@defopt special-display-buffer-names
886A list of buffer names for buffers that should be displayed specially. 905A list of buffer names for buffers that should be displayed specially.
887If the buffer's name is in this list, @code{display-buffer} handles the 906If the buffer's name is in this list, @code{display-buffer} handles the
888buffer specially. 907buffer specially.
@@ -895,9 +914,9 @@ frame. There are two possibilities for the rest of the list. It can be
895an alist, specifying frame parameters, or it can contain a function and 914an alist, specifying frame parameters, or it can contain a function and
896arguments to give to it. (The function's first argument is always the 915arguments to give to it. (The function's first argument is always the
897buffer to be displayed; the arguments from the list come after that.) 916buffer to be displayed; the arguments from the list come after that.)
898@end defvar 917@end defopt
899 918
900@defvar special-display-regexps 919@defopt special-display-regexps
901A list of regular expressions that specify buffers that should be 920A list of regular expressions that specify buffers that should be
902displayed specially. If the buffer's name matches any of the regular 921displayed specially. If the buffer's name matches any of the regular
903expressions in this list, @code{display-buffer} handles the buffer 922expressions in this list, @code{display-buffer} handles the buffer
@@ -908,7 +927,7 @@ By default, special display means to give the buffer a dedicated frame.
908If an element is a list, instead of a string, then the @sc{car} of the 927If an element is a list, instead of a string, then the @sc{car} of the
909list is the regular expression, and the rest of the list says how to 928list is the regular expression, and the rest of the list says how to
910create the frame. See above, under @code{special-display-buffer-names}. 929create the frame. See above, under @code{special-display-buffer-names}.
911@end defvar 930@end defopt
912 931
913@defvar special-display-function 932@defvar special-display-function
914This variable holds the function to call to display a buffer specially. 933This variable holds the function to call to display a buffer specially.
@@ -1084,7 +1103,7 @@ If the last redisplay of @var{window} was preempted, and did not finish,
1084Emacs does not know the position of the end of display in that window. 1103Emacs does not know the position of the end of display in that window.
1085In that case, this function returns @code{nil}. 1104In that case, this function returns @code{nil}.
1086 1105
1087If you @var{update} is non-@code{nil}, @code{window-end} always returns 1106If @var{update} is non-@code{nil}, @code{window-end} always returns
1088an up-to-date value for where the window ends. If the saved value is 1107an up-to-date value for where the window ends. If the saved value is
1089valid, @code{window-end} returns that; otherwise it computes the correct 1108valid, @code{window-end} returns that; otherwise it computes the correct
1090value by scanning the buffer text. 1109value by scanning the buffer text.
@@ -1253,13 +1272,38 @@ If this variable is non-@code{nil}, it tells @code{scroll-other-window}
1253which buffer to scroll. 1272which buffer to scroll.
1254@end defvar 1273@end defvar
1255 1274
1256@defopt scroll-step 1275@tindex scroll-margin
1276@defopt scroll-margin
1277This option specifies the size of the scroll margin---a minimum number
1278of lines between point and the top or bottom of a window. Whenever
1279point gets within this many lines of the top or bottom of the window,
1280the window scrolls automatically (if possible) to move point out of the
1281margin, closer to the center of the window.
1282@end defopt
1283
1284@tindex scroll-conservatively
1285@defopt scroll-conservatively
1257This variable controls how scrolling is done automatically when point 1286This variable controls how scrolling is done automatically when point
1258moves off the screen. If the value is zero, then redisplay scrolls the 1287moves off the screen (or into the scroll margin). If the value is zero,
1259text to center point vertically in the window. If the value is a 1288then redisplay scrolls the text to center point vertically in the
1260positive integer @var{n}, then redisplay brings point back on screen by 1289window. If the value is a positive integer @var{n}, then redisplay
1261scrolling @var{n} lines in either direction, if possible; otherwise, it 1290scrolls the window up to @var{n} lines in either direction, if that will
1262centers point. The default value is zero. 1291bring point back into view. Otherwise, it centers point. The default
1292value is zero.
1293@end defopt
1294
1295@defopt scroll-step
1296This variable is an older variant of @code{scroll-conservatively}. The
1297difference is that it if its value is @var{n}, that permits scrolling
1298only by precisely @var{n} lines, not a smaller number. This feature
1299does not work with @code{scroll-margin}. The default value is zero.
1300@end defopt
1301
1302@tindex scroll-preserve-screen-position
1303@defopt scroll-preserve-screen-position
1304If this option is non-@code{nil}, the scroll functions move point so
1305that the vertical position of the cursor is unchanged, when that is
1306possible.
1263@end defopt 1307@end defopt
1264 1308
1265@defopt next-screen-context-lines 1309@defopt next-screen-context-lines
@@ -1608,6 +1652,17 @@ It could be defined as follows:
1608@end example 1652@end example
1609@end deffn 1653@end deffn
1610 1654
1655@deffn Command shrink-window-if-larger-than-buffer window
1656This command shrinks @var{window} to be as small as possible while still
1657showing the full contents of its buffer---but not less than
1658@code{window-min-height} lines.
1659
1660However, the command does nothing if the window is already too small to
1661display the whole text of the buffer, or if part of the contents are
1662currently scrolled off screen, or if the window is not the full width of
1663its frame, or if the window is the only window in its frame.
1664@end deffn
1665
1611@cindex minimum window size 1666@cindex minimum window size
1612 The following two variables constrain the window-size-changing 1667 The following two variables constrain the window-size-changing
1613functions to a minimum height and width. 1668functions to a minimum height and width.
@@ -1624,7 +1679,7 @@ less than two. The default value is 4.
1624 1679
1625@defopt window-min-width 1680@defopt window-min-width
1626The value of this variable determines how narrow a window may become 1681The value of this variable determines how narrow a window may become
1627before it automatically deleted. Making a window smaller than 1682before it is automatically deleted. Making a window smaller than
1628@code{window-min-width} automatically deletes it, and no window may be 1683@code{window-min-width} automatically deletes it, and no window may be
1629created narrower than this. The absolute minimum width is one; any 1684created narrower than this. The absolute minimum width is one; any
1630value below that is ignored. The default value is 10. 1685value below that is ignored. The default value is 10.
@@ -1813,12 +1868,9 @@ display-start position.
1813 1868
1814Displaying a different buffer in the window also runs these functions. 1869Displaying a different buffer in the window also runs these functions.
1815 1870
1816These functions cannot expect @code{window-end} (@pxref{Window Start}) 1871These functions must be careful in using @code{window-end}
1817to return a meaningful value, because that value is updated only by 1872(@pxref{Window Start}); if you need an up-to-date value, you must use
1818redisplaying the buffer. So if one of these functions needs to know the 1873the @var{update} argument to ensure you get it.
1819last character that will fit in the window with its current
1820display-start position, it has to find that character using
1821@code{vertical-motion} (@pxref{Screen Lines}).
1822@end defvar 1874@end defvar
1823 1875
1824@defvar window-size-change-functions 1876@defvar window-size-change-functions
@@ -1846,7 +1898,7 @@ Windows}) is what you need here.
1846 1898
1847@defvar redisplay-end-trigger-functions 1899@defvar redisplay-end-trigger-functions
1848@tindex redisplay-end-trigger-functions 1900@tindex redisplay-end-trigger-functions
1849This abnormal hook is run whenever redisplay in window uses text that 1901This abnormal hook is run whenever redisplay in a window uses text that
1850extends past a specified end trigger position. You set the end trigger 1902extends past a specified end trigger position. You set the end trigger
1851position with the function @code{set-window-redisplay-end-trigger}. The 1903position with the function @code{set-window-redisplay-end-trigger}. The
1852functions are called with two arguments: the window, and the end trigger 1904functions are called with two arguments: the window, and the end trigger