aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-06-05 12:23:13 +0000
committerKarl Heuer1995-06-05 12:23:13 +0000
commit22697dac66806b67eca956ad8cf8907b16d750b4 (patch)
tree57a28d25543669c66512a7fd1977eea4973115c4
parenta8a818c00e9cc73259aa3c519ba5fc34741c11ab (diff)
downloademacs-22697dac66806b67eca956ad8cf8907b16d750b4.tar.gz
emacs-22697dac66806b67eca956ad8cf8907b16d750b4.zip
*** empty log message ***
-rw-r--r--lispref/buffers.texi307
-rw-r--r--lispref/calendar.texi10
-rw-r--r--lispref/commands.texi44
-rw-r--r--lispref/compile.texi129
-rw-r--r--lispref/debugging.texi4
-rw-r--r--lispref/display.texi201
-rw-r--r--lispref/elisp.texi27
-rw-r--r--lispref/eval.texi4
-rw-r--r--lispref/files.texi144
-rw-r--r--lispref/frames.texi335
-rw-r--r--lispref/keymaps.texi27
-rw-r--r--lispref/lists.texi46
-rw-r--r--lispref/loading.texi14
-rw-r--r--lispref/macros.texi66
-rw-r--r--lispref/minibuf.texi20
-rw-r--r--lispref/modes.texi74
-rw-r--r--lispref/numbers.texi23
-rw-r--r--lispref/objects.texi63
-rw-r--r--lispref/os.texi216
-rw-r--r--lispref/processes.texi88
-rw-r--r--lispref/searching.texi157
-rw-r--r--lispref/sequences.texi11
-rw-r--r--lispref/strings.texi12
-rw-r--r--lispref/symbols.texi63
-rw-r--r--lispref/text.texi222
-rw-r--r--lispref/variables.texi46
-rw-r--r--lispref/windows.texi27
27 files changed, 1914 insertions, 466 deletions
diff --git a/lispref/buffers.texi b/lispref/buffers.texi
index 4ce4c4c2037..bfa8f020c62 100644
--- a/lispref/buffers.texi
+++ b/lispref/buffers.texi
@@ -17,6 +17,8 @@ not be displayed in any windows.
17 17
18@menu 18@menu
19* Buffer Basics:: What is a buffer? 19* Buffer Basics:: What is a buffer?
20* Current Buffer:: Designating a buffer as current
21 so primitives will access its contents.
20* Buffer Names:: Accessing and changing buffer names. 22* Buffer Names:: Accessing and changing buffer names.
21* Buffer File Name:: The buffer file name indicates which file is visited. 23* Buffer File Name:: The buffer file name indicates which file is visited.
22* Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved. 24* Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved.
@@ -26,8 +28,7 @@ not be displayed in any windows.
26* The Buffer List:: How to look at all the existing buffers. 28* The Buffer List:: How to look at all the existing buffers.
27* Creating Buffers:: Functions that create buffers. 29* Creating Buffers:: Functions that create buffers.
28* Killing Buffers:: Buffers exist until explicitly killed. 30* Killing Buffers:: Buffers exist until explicitly killed.
29* Current Buffer:: Designating a buffer as current 31* Indirect Buffers:: An indirect buffer shares text with some other buffer.
30 so primitives will access its contents.
31@end menu 32@end menu
32 33
33@node Buffer Basics 34@node Buffer Basics
@@ -75,6 +76,130 @@ This function returns @code{t} if @var{object} is a buffer,
75@code{nil} otherwise. 76@code{nil} otherwise.
76@end defun 77@end defun
77 78
79@node Current Buffer
80@section The Current Buffer
81@cindex selecting a buffer
82@cindex changing to another buffer
83@cindex current buffer
84
85 There are, in general, many buffers in an Emacs session. At any time,
86one of them is designated as the @dfn{current buffer}. This is the
87buffer in which most editing takes place, because most of the primitives
88for examining or changing text in a buffer operate implicitly on the
89current buffer (@pxref{Text}). Normally the buffer that is displayed on
90the screen in the selected window is the current buffer, but this is not
91always so: a Lisp program can designate any buffer as current
92temporarily in order to operate on its contents, without changing what
93is displayed on the screen.
94
95 The way to designate a current buffer in a Lisp program is by calling
96@code{set-buffer}. The specified buffer remains current until a new one
97is designated.
98
99 When an editing command returns to the editor command loop, the
100command loop designates the buffer displayed in the selected window as
101current, to prevent confusion: the buffer that the cursor is in when
102Emacs reads a command is the buffer that the command will apply to.
103(@xref{Command Loop}.) Therefore, @code{set-buffer} is not the way to
104switch visibly to a different buffer so that the user can edit it. For
105this, you must use the functions described in @ref{Displaying Buffers}.
106
107 However, Lisp functions that change to a different current buffer
108should not depend on the command loop to set it back afterwards.
109Editing commands written in Emacs Lisp can be called from other programs
110as well as from the command loop. It is convenient for the caller if
111the subroutine does not change which buffer is current (unless, of
112course, that is the subroutine's purpose). Therefore, you should
113normally use @code{set-buffer} within a @code{save-excursion} that will
114restore the current buffer when your function is done
115(@pxref{Excursions}). Here is an example, the code for the command
116@code{append-to-buffer} (with the documentation string abridged):
117
118@example
119@group
120(defun append-to-buffer (buffer start end)
121 "Append to specified buffer the text of the region.
122@dots{}"
123 (interactive "BAppend to buffer: \nr")
124 (let ((oldbuf (current-buffer)))
125 (save-excursion
126 (set-buffer (get-buffer-create buffer))
127 (insert-buffer-substring oldbuf start end))))
128@end group
129@end example
130
131@noindent
132This function binds a local variable to the current buffer, and then
133@code{save-excursion} records the values of point, the mark, and the
134original buffer. Next, @code{set-buffer} makes another buffer current.
135Finally, @code{insert-buffer-substring} copies the string from the
136original current buffer to the new current buffer.
137
138 If the buffer appended to happens to be displayed in some window,
139the next redisplay will show how its text has changed. Otherwise, you
140will not see the change immediately on the screen. The buffer becomes
141current temporarily during the execution of the command, but this does
142not cause it to be displayed.
143
144 If you make local bindings (with @code{let} or function arguments) for
145a variable that may also have buffer-local bindings, make sure that the
146same buffer is current at the beginning and at the end of the local
147binding's scope. Otherwise you might bind it in one buffer and unbind
148it in another! There are two ways to do this. In simple cases, you may
149see that nothing ever changes the current buffer within the scope of the
150binding. Otherwise, use @code{save-excursion} to make sure that the
151buffer current at the beginning is current again whenever the variable
152is unbound.
153
154 It is not reliable to change the current buffer back with
155@code{set-buffer}, because that won't do the job if a quit happens while
156the wrong buffer is current. Here is what @emph{not} to do:
157
158@example
159@group
160(let (buffer-read-only
161 (obuf (current-buffer)))
162 (set-buffer @dots{})
163 @dots{}
164 (set-buffer obuf))
165@end group
166@end example
167
168@noindent
169Using @code{save-excursion}, as shown below, handles quitting, errors,
170and @code{throw}, as well as ordinary evaluation.
171
172@example
173@group
174(let (buffer-read-only)
175 (save-excursion
176 (set-buffer @dots{})
177 @dots{}))
178@end group
179@end example
180
181@defun current-buffer
182This function returns the current buffer.
183
184@example
185@group
186(current-buffer)
187 @result{} #<buffer buffers.texi>
188@end group
189@end example
190@end defun
191
192@defun set-buffer buffer-or-name
193This function makes @var{buffer-or-name} the current buffer. It does
194not display the buffer in the currently selected window or in any other
195window, so the user cannot necessarily see the buffer. But Lisp
196programs can in any case work on it.
197
198This function returns the buffer identified by @var{buffer-or-name}.
199An error is signaled if @var{buffer-or-name} does not identify an
200existing buffer.
201@end defun
202
78@node Buffer Names 203@node Buffer Names
79@section Buffer Names 204@section Buffer Names
80@cindex buffer names 205@cindex buffer names
@@ -533,6 +658,12 @@ If @var{buffer-or-name} is not supplied (or if it is not a buffer),
533then @code{other-buffer} returns the first buffer on the buffer list 658then @code{other-buffer} returns the first buffer on the buffer list
534that is not visible in any window in a visible frame. 659that is not visible in any window in a visible frame.
535 660
661If the selected frame has a non-@code{nil} @code{buffer-predicate}
662parameter, then @code{other-buffer} uses that predicate to decide which
663buffers to consider. It calls the predicate once for each buffer, and
664if the value is @code{nil}, that buffer is ignored. @xref{X Frame
665Parameters}.
666
536@c Emacs 19 feature 667@c Emacs 19 feature
537If @var{visible-ok} is @code{nil}, @code{other-buffer} avoids returning 668If @var{visible-ok} is @code{nil}, @code{other-buffer} avoids returning
538a buffer visible in any window on any visible frame, except as a last 669a buffer visible in any window on any visible frame, except as a last
@@ -589,8 +720,9 @@ An error is signaled if @var{name} is not a string.
589@end group 720@end group
590@end example 721@end example
591 722
592The major mode for the new buffer is set according to the variable 723The major mode for the new buffer is set to Fundamental mode. The
593@code{default-major-mode}. @xref{Auto Major Mode}. 724variable @code{default-major-mode} is handled at a higher level.
725@xref{Auto Major Mode}.
594@end defun 726@end defun
595 727
596@defun generate-new-buffer name 728@defun generate-new-buffer name
@@ -618,8 +750,9 @@ An error is signaled if @var{name} is not a string.
618@end group 750@end group
619@end example 751@end example
620 752
621The major mode for the new buffer is set by the value of 753The major mode for the new buffer is set to Fundamental mode. The
622@code{default-major-mode}. @xref{Auto Major Mode}. 754variable @code{default-major-mode} is handled at a higher level.
755@xref{Auto Major Mode}.
623 756
624See the related function @code{generate-new-buffer-name} in @ref{Buffer 757See the related function @code{generate-new-buffer-name} in @ref{Buffer
625Names}. 758Names}.
@@ -713,126 +846,48 @@ variable @code{buffer-offer-save} automatically becomes buffer-local
713when set for any reason. @xref{Buffer-Local Variables}. 846when set for any reason. @xref{Buffer-Local Variables}.
714@end defvar 847@end defvar
715 848
716@node Current Buffer 849@node Indirect Buffers
717@section The Current Buffer 850@section Indirect Buffers
718@cindex selecting a buffer 851@cindex indirect buffers
719@cindex changing to another buffer 852@cindex base buffer
720@cindex current buffer 853
721 854 An @dfn{indirect buffer} shares the text of some other buffer, which
722 There are, in general, many buffers in an Emacs session. At any time, 855is called the @dfn{base buffer} of the indirect buffer. In some ways it
723one of them is designated as the @dfn{current buffer}. This is the 856is the equivalent, for buffers, of a symbolic link among files. The base
724buffer in which most editing takes place, because most of the primitives 857buffer may not itself be an indirect buffer.
725for examining or changing text in a buffer operate implicitly on the 858
726current buffer (@pxref{Text}). Normally the buffer that is displayed on 859 The text of the indirect buffer is always identical to the text of its
727the screen in the selected window is the current buffer, but this is not 860base buffer; changes made by editing either one are visible immediately
728always so: a Lisp program can designate any buffer as current 861in the other. This includes the text properties as well as the characters
729temporarily in order to operate on its contents, without changing what 862themselves.
730is displayed on the screen. 863
731 864 But in all other respects, the indirect buffer and its base buffer are
732 The way to designate a current buffer in a Lisp program is by calling 865completely separate. They have different names, different values of
733@code{set-buffer}. The specified buffer remains current until a new one 866point, different narrowing, different markers and overlays (though
734is designated. 867inserting or deleting text in either buffer relocates the markers and
735 868overlays for both), different major modes, and different local
736 When an editing command returns to the editor command loop, the 869variables.
737command loop designates the buffer displayed in the selected window as 870
738current, to prevent confusion: the buffer that the cursor is in when 871 An indirect buffer cannot visit a file, but its base buffer can. If
739Emacs reads a command is the buffer that the command will apply to. 872you try to save the indirect buffer, that actually works by saving the
740(@xref{Command Loop}.) Therefore, @code{set-buffer} is not the way to 873base buffer.
741switch visibly to a different buffer so that the user can edit it. For 874
742this, you must use the functions described in @ref{Displaying Buffers}. 875 Killing an indirect buffer has no effect on its base buffer. Killing
743 876the base buffer effectively kills the indirect buffer in that it cannot
744 However, Lisp functions that change to a different current buffer 877ever again be the current buffer.
745should not depend on the command loop to set it back afterwards. 878
746Editing commands written in Emacs Lisp can be called from other programs 879@deffn Command make-indirect-buffer base-buffer name
747as well as from the command loop. It is convenient for the caller if 880This creates an indirect buffer named @var{name} whose base buffer
748the subroutine does not change which buffer is current (unless, of 881is @var{base-buffer}. The argument @var{base-buffer} may be a buffer
749course, that is the subroutine's purpose). Therefore, you should 882or a string.
750normally use @code{set-buffer} within a @code{save-excursion} that will 883
751restore the current buffer when your function is done 884If @var{base-buffer} is an indirect buffer, its base buffer is used as
752(@pxref{Excursions}). Here is an example, the code for the command 885the base for the new buffer.
753@code{append-to-buffer} (with the documentation string abridged): 886@end deffn
754
755@example
756@group
757(defun append-to-buffer (buffer start end)
758 "Append to specified buffer the text of the region.
759@dots{}"
760 (interactive "BAppend to buffer: \nr")
761 (let ((oldbuf (current-buffer)))
762 (save-excursion
763 (set-buffer (get-buffer-create buffer))
764 (insert-buffer-substring oldbuf start end))))
765@end group
766@end example
767
768@noindent
769This function binds a local variable to the current buffer, and then
770@code{save-excursion} records the values of point, the mark, and the
771original buffer. Next, @code{set-buffer} makes another buffer current.
772Finally, @code{insert-buffer-substring} copies the string from the
773original current buffer to the new current buffer.
774
775 If the buffer appended to happens to be displayed in some window,
776the next redisplay will show how its text has changed. Otherwise, you
777will not see the change immediately on the screen. The buffer becomes
778current temporarily during the execution of the command, but this does
779not cause it to be displayed.
780
781 If you make local bindings (with @code{let} or function arguments) for
782a variable that may also have buffer-local bindings, make sure that the
783same buffer is current at the beginning and at the end of the local
784binding's scope. Otherwise you might bind it in one buffer and unbind
785it in another! There are two ways to do this. In simple cases, you may
786see that nothing ever changes the current buffer within the scope of the
787binding. Otherwise, use @code{save-excursion} to make sure that the
788buffer current at the beginning is current again whenever the variable
789is unbound.
790
791 It is not reliable to change the current buffer back with
792@code{set-buffer}, because that won't do the job if a quit happens while
793the wrong buffer is current. Here is what @emph{not} to do:
794
795@example
796@group
797(let (buffer-read-only
798 (obuf (current-buffer)))
799 (set-buffer @dots{})
800 @dots{}
801 (set-buffer obuf))
802@end group
803@end example
804
805@noindent
806Using @code{save-excursion}, as shown below, handles quitting, errors,
807and @code{throw}, as well as ordinary evaluation.
808
809@example
810@group
811(let (buffer-read-only)
812 (save-excursion
813 (set-buffer @dots{})
814 @dots{}))
815@end group
816@end example
817
818@defun current-buffer
819This function returns the current buffer.
820 887
821@example 888@defun buffer-base-buffer buffer
822@group 889This function returns the base buffer of @var{buffer}. If @var{buffer}
823(current-buffer) 890is not indirect, the value is @code{nil}. Otherwise, the value is
824 @result{} #<buffer buffers.texi> 891another buffer, which is never an indirect buffer.
825@end group
826@end example
827@end defun 892@end defun
828 893
829@defun set-buffer buffer-or-name
830This function makes @var{buffer-or-name} the current buffer. It does
831not display the buffer in the currently selected window or in any other
832window, so the user cannot necessarily see the buffer. But Lisp
833programs can in any case work on it.
834
835This function returns the buffer identified by @var{buffer-or-name}.
836An error is signaled if @var{buffer-or-name} does not identify an
837existing buffer.
838@end defun
diff --git a/lispref/calendar.texi b/lispref/calendar.texi
index 5f49a5128e2..8e42a530f25 100644
--- a/lispref/calendar.texi
+++ b/lispref/calendar.texi
@@ -66,7 +66,10 @@ asterisk (@samp{*}).
66date as being a holiday. Its value may be a character to insert next to 66date as being a holiday. Its value may be a character to insert next to
67the date, or a face name to use for displaying the date. Likewise, the 67the date, or a face name to use for displaying the date. Likewise, the
68variable @code{diary-entry-marker} specifies how to mark a date that has 68variable @code{diary-entry-marker} specifies how to mark a date that has
69diary entries. 69diary entries. The calendar creates faces named @code{holiday-face} and
70@code{diary-face} for these purposes; those symbols are the default
71values of these variables, when Emacs supports multiple faces on your
72terminal.
70 73
71@vindex calendar-load-hook 74@vindex calendar-load-hook
72 The variable @code{calendar-load-hook} is a normal hook run when the 75 The variable @code{calendar-load-hook} is a normal hook run when the
@@ -104,7 +107,10 @@ changing its face or by adding an asterisk. Here's how to use it:
104@vindex calendar-today-marker 107@vindex calendar-today-marker
105The variable @code{calendar-today-marker} specifies how to mark today's 108The variable @code{calendar-today-marker} specifies how to mark today's
106date. Its value should be a character to insert next to the date or a 109date. Its value should be a character to insert next to the date or a
107face name to use for displaying the date. 110face name to use for displaying the date. A face named
111@code{calendar-today-face} is provided for this purpose; that symbol is
112the default for this variable when Emacs supports multiple faces on your
113terminal.
108 114
109@vindex today-invisible-calendar-hook 115@vindex today-invisible-calendar-hook
110@noindent 116@noindent
diff --git a/lispref/commands.texi b/lispref/commands.texi
index e95b5599ad3..aa7ad7d2852 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -370,6 +370,12 @@ The cursor does not move into the echo area. Prompt.
370This kind of input is used by commands such as @code{describe-key} and 370This kind of input is used by commands such as @code{describe-key} and
371@code{global-set-key}. 371@code{global-set-key}.
372 372
373@item K
374A key sequence, whose definition you intend to change. This works like
375@samp{k}, except that it suppresses, for the last input event in the key
376sequence, the conversions that are normally used (when necessary) to
377convert an undefined key into a defined one.
378
373@item m 379@item m
374@cindex marker argument 380@cindex marker argument
375The position of the mark, as an integer. No I/O. 381The position of the mark, as an integer. No I/O.
@@ -766,6 +772,7 @@ This function returns non-@code{nil} if @var{event} is an input event.
766* Repeat Events:: Double and triple click (or drag, or down). 772* Repeat Events:: Double and triple click (or drag, or down).
767* Motion Events:: Just moving the mouse, not pushing a button. 773* Motion Events:: Just moving the mouse, not pushing a button.
768* Focus Events:: Moving the mouse between frames. 774* Focus Events:: Moving the mouse between frames.
775* Misc Events:: Other events window systems can generate.
769* Event Examples:: Examples of the lists for mouse events. 776* Event Examples:: Examples of the lists for mouse events.
770* Classifying Events:: Finding the modifier keys in an event symbol. 777* Classifying Events:: Finding the modifier keys in an event symbol.
771 Event types. 778 Event types.
@@ -1223,6 +1230,34 @@ sequence---that is, after a prefix key---then Emacs reorders the events
1223so that the focus event comes either before or after the multi-event key 1230so that the focus event comes either before or after the multi-event key
1224sequence, and not within it. 1231sequence, and not within it.
1225 1232
1233@node Misc Events
1234@subsection Miscellaneous Window System Events
1235
1236A few other event types represent occurrences within the window system.
1237
1238@table @code
1239@cindex @code{delete-frame} event
1240@item (delete-frame (@var{frame}))
1241This kind of event indicates that the user gave the window manager
1242a command to delete a particular window, which happens to be an Emacs frame.
1243
1244The standard definition of the @code{delete-frame} event is to delete @var{frame}.
1245
1246@cindex @code{iconify-frame} event
1247@item (iconify-frame (@var{frame}))
1248This kind of event indicates that the user iconified @var{frame} using
1249the window manager. Its standard definition is @code{ignore}; since
1250the frame has already been iconified, Emacs has no work to do.
1251The purpose of this event type is so that you can keep track of such
1252events if you want to.
1253
1254@cindex @code{deiconify-frame} event
1255@item (deiconify-frame (@var{frame}))
1256This kind of event indicates that the user deiconified @var{frame} using
1257the window manager. Its standard definition is @code{ignore}; since the
1258frame has already been iconified, Emacs has no work to do.
1259@end table
1260
1226@node Event Examples 1261@node Event Examples
1227@subsection Event Examples 1262@subsection Event Examples
1228 1263
@@ -1835,6 +1870,9 @@ If @var{nodisp} is non-@code{nil}, then @code{sit-for} does not
1835redisplay, but it still returns as soon as input is available (or when 1870redisplay, but it still returns as soon as input is available (or when
1836the timeout elapses). 1871the timeout elapses).
1837 1872
1873Iconifying or deiconifying a frame makes @code{sit-for} return, because
1874that generates an event. @xref{Misc Events}.
1875
1838The usual purpose of @code{sit-for} is to give the user time to read 1876The usual purpose of @code{sit-for} is to give the user time to read
1839text that you display. 1877text that you display.
1840@end defun 1878@end defun
@@ -2339,6 +2377,9 @@ encounters an error or a failing search.
2339@defvar last-kbd-macro 2377@defvar last-kbd-macro
2340This variable is the definition of the most recently defined keyboard 2378This variable is the definition of the most recently defined keyboard
2341macro. Its value is a string or vector, or @code{nil}. 2379macro. Its value is a string or vector, or @code{nil}.
2380
2381The variable is always local to the current X terminal and cannot be
2382buffer-local. @xref{Multiple Displays}.
2342@end defvar 2383@end defvar
2343 2384
2344@defvar executing-macro 2385@defvar executing-macro
@@ -2354,5 +2395,8 @@ This variable indicates whether a keyboard macro is being defined. A
2354command can test this variable to behave differently while a macro is 2395command can test this variable to behave differently while a macro is
2355being defined. The commands @code{start-kbd-macro} and 2396being defined. The commands @code{start-kbd-macro} and
2356@code{end-kbd-macro} set this variable---do not set it yourself. 2397@code{end-kbd-macro} set this variable---do not set it yourself.
2398
2399The variable is always local to the current X terminal and cannot be
2400buffer-local. @xref{Multiple Displays}.
2357@end defvar 2401@end defvar
2358 2402
diff --git a/lispref/compile.texi b/lispref/compile.texi
index 69b328fd905..413adc085a3 100644
--- a/lispref/compile.texi
+++ b/lispref/compile.texi
@@ -22,8 +22,8 @@ however, as fast as true compiled code.
22 22
23 In general, any version of Emacs can run byte-compiled code produced 23 In general, any version of Emacs can run byte-compiled code produced
24by recent earlier versions of Emacs, but the reverse is not true. In 24by recent earlier versions of Emacs, but the reverse is not true. In
25particular, if you compile a program with Emacs 18, you can run the 25particular, if you compile a program with Emacs 19.29, the compiled
26compiled code in Emacs 19, but not vice versa. 26code does not run in earlier versions.
27 27
28 @xref{Compilation Errors}, for how to investigate errors occurring in 28 @xref{Compilation Errors}, for how to investigate errors occurring in
29byte compilation. 29byte compilation.
@@ -31,6 +31,8 @@ byte compilation.
31@menu 31@menu
32* Speed of Byte-Code:: An example of speedup from byte compilation. 32* Speed of Byte-Code:: An example of speedup from byte compilation.
33* Compilation Functions:: Byte compilation functions. 33* Compilation Functions:: Byte compilation functions.
34* Docs and Compilation:: Dynamic loading of documentation strings.
35* Dynamic Loading:: Dynamic loading of individual functions.
34* Eval During Compile:: Code to be evaluated when you compile. 36* Eval During Compile:: Code to be evaluated when you compile.
35* Byte-Code Objects:: The data type used for byte-compiled functions. 37* Byte-Code Objects:: The data type used for byte-compiled functions.
36* Disassembly:: Disassembling byte-code; how to read byte-code. 38* Disassembly:: Disassembling byte-code; how to read byte-code.
@@ -109,7 +111,7 @@ i.e., the compiler does not follow indirection to another symbol.
109@code{byte-compile} returns the new, compiled definition of 111@code{byte-compile} returns the new, compiled definition of
110@var{symbol}. 112@var{symbol}.
111 113
112If @var{symbol}'s definition is a byte-code function object, 114 If @var{symbol}'s definition is a byte-code function object,
113@code{byte-compile} does nothing and returns @code{nil}. Lisp records 115@code{byte-compile} does nothing and returns @code{nil}. Lisp records
114only one function definition for any symbol, and if that is already 116only one function definition for any symbol, and if that is already
115compiled, non-compiled code is not available anywhere. So there is no 117compiled, non-compiled code is not available anywhere. So there is no
@@ -221,10 +223,129 @@ part of a byte-code function object, and only rarely due to an explicit
221call to @code{byte-code}. 223call to @code{byte-code}.
222@end defun 224@end defun
223 225
226@node Docs and Compilation
227@section Documentation Strings and Compilation
228@cindex dynamic loading of documentation
229
230 Functions and variables loaded from a byte-compiled file access their
231documentation strings dynamically from the file whenever needed. This
232saves space within Emacs, and make loading faster because the
233documentation strings themselves need not be processed while loading the
234file. Actual access to the documentation strings becomes slower as a
235result, but this normally is not enough to bother users.
236
237 Dynamic access to documentation strings does have drawbacks:
238
239@itemize @bullet
240@item
241If you delete or move the compiled file after loading it, Emacs can no
242longer access the documentation strings for the functions and variables
243in the file.
244
245@item
246If you alter the compiled file (such as by compiling a new version),
247then further access to documentation strings in this file will give
248nonsense results.
249@end itemize
250
251 If your site installs Emacs following the usual procedures, these
252problems will never normally occur. Installing a new version uses a new
253directory with a different name; as long as the old version remains
254installed, its files will remain unmodified in the places where they are
255expected to be.
256
257 However, if you have build Emacs yourself and use it from the
258directory where you built it, you will experience this problem
259occasionally if you edit and recompile Lisp files. When it happens, you
260can cure the problem by reloading the file after recompiling it.
261
262 Byte-compiled files made with Emacs 19.29 will not load into older
263versions because the older versions don't support this feature. You can
264turn off this feature by setting @code{byte-compile-dynamic-docstrings}
265to @code{nil}. Once this is done, you can compile files that will load
266into older Emacs versions. You can do this globally, or for one source
267file by specifying a file-local binding for the variable. Here's one
268way:
269
270@example
271-*-byte-compile-dynamic-docstrings: nil;-*-
272@end example
273
274@defvar byte-compile-dynamic-docstrings
275If this is non-@code{nil}, the byte compiler generates compiled files
276that are set up for dynamic loading of documentation strings.
277@end defvar
278
279@cindex @samp{#@@@var{count}}
280@cindex @samp{#$}
281 The dynamic documentation string feature writes compiled files that
282use a special Lisp reader construct, @samp{#@@@var{count}}. This
283construct skips the next @var{count} characters. It also uses the
284@samp{#$} construct, which stands for ``the name of this file, as a
285string.'' It is best not to use these constructs in Lisp source files.
286
287@node Dynamic Loading
288@section Dynamic Loading of Individual Functions
289
290@cindex dynamic loading of functions
291@cindex lazy loading
292 When you compile a file, you can optionally enable the @dfn{dynamic
293function loading} feature (also known as @dfn{lazy loading}). With
294dynamic function loading, loading the file doesn't fully read the
295function definitions in the file. Instead, each function definition
296contains a place-holder which refers to the file. The first time each
297function is called, it reads the full definition from the file, to
298replace the place-holder.
299
300 The advantage of dynamic function loading is that loading the file
301becomes much faster. This is a good thing for a file which contains
302many separate commands, provided that using one of them does not imply
303you will soon (or ever) use the rest. A specialized mode which provides
304many keyboard commands often has that usage pattern: a user may invoke
305the mode, but use only a few of the commands it provides.
306
307 The dynamic loading feature has certain disadvantages:
308
309@itemize @bullet
310@item
311If you delete or move the compiled file after loading it, Emacs can no
312longer load the remaining function definitions not already loaded.
313
314@item
315If you alter the compiled file (such as by compiling a new version),
316then trying to load any function not already loaded will get nonsense
317results.
318@end itemize
319
320 If you compile a new version of the file, the best thing to do is
321immediately load the new compiled file. That will prevent any future
322problems.
323
324 The byte compiler uses the dynamic function loading feature if the
325variable @code{byte-compile-dynamic} is non-@code{nil} at compilation
326time. Do not set this variable globally, since dynamic loading is
327desirable only for certain files. Instead, enable the feature for
328specific source files with file-local variable bindings, like this:
329
330@example
331-*-byte-compile-dynamic: t;-*-
332@end example
333
334@defvar byte-compile-dynamic
335If this is non-@code{nil}, the byte compiler generates compiled files
336that are set up for dynamic function loading.
337@end defvar
338
339@defun fetch-bytecode function
340This immediately finishes loading the definition of @var{function} from
341its byte-compiled file, if it is not fully loaded already. The argument
342@var{function} may be a byte-code function object or a function name.
343@end defun
344
224@node Eval During Compile 345@node Eval During Compile
225@section Evaluation During Compilation 346@section Evaluation During Compilation
226 347
227These features permit you to write code to be evaluated during 348 These features permit you to write code to be evaluated during
228compilation of a program. 349compilation of a program.
229 350
230@defspec eval-and-compile body 351@defspec eval-and-compile body
diff --git a/lispref/debugging.texi b/lispref/debugging.texi
index 1b765970278..3fa300d02f9 100644
--- a/lispref/debugging.texi
+++ b/lispref/debugging.texi
@@ -89,6 +89,10 @@ The value can also be a list of error conditions that should call the
89debugger. For example, if you set it to the list 89debugger. For example, if you set it to the list
90@code{(void-variable)}, then only errors about a variable that has no 90@code{(void-variable)}, then only errors about a variable that has no
91value invoke the debugger. 91value invoke the debugger.
92
93When this variable is non-@code{nil}, Emacs does not catch errors that
94happen in process filter functions and sentinels. Therefore, these
95errors also can invoke the debugger. @xref{Processes}.
92@end defopt 96@end defopt
93 97
94 To debug an error that happens during loading of the @file{.emacs} 98 To debug an error that happens during loading of the @file{.emacs}
diff --git a/lispref/display.texi b/lispref/display.texi
index 2fc7340e035..146dee69531 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -14,7 +14,8 @@ that Emacs presents to the user.
14* Screen Size:: How big is the Emacs screen. 14* Screen Size:: How big is the Emacs screen.
15* Truncation:: Folding or wrapping long text lines. 15* Truncation:: Folding or wrapping long text lines.
16* The Echo Area:: Where messages are displayed. 16* The Echo Area:: Where messages are displayed.
17* Selective Display:: Hiding part of the buffer text. 17* Invisible Text:: Hiding part of the buffer text.
18* Selective Display:: Hiding part of the buffer text (the old way).
18* Overlay Arrow:: Display of an arrow to indicate position. 19* Overlay Arrow:: Display of an arrow to indicate position.
19* Temporary Displays:: Displays that go away automatically. 20* Temporary Displays:: Displays that go away automatically.
20* Overlays:: Use overlays to highlight parts of the buffer. 21* Overlays:: Use overlays to highlight parts of the buffer.
@@ -168,12 +169,27 @@ If it is non-@code{nil}, these lines are truncated; otherwise,
168 You can override the images that indicate continuation or truncation 169 You can override the images that indicate continuation or truncation
169with the display table; see @ref{Display Tables}. 170with the display table; see @ref{Display Tables}.
170 171
172 If your buffer contains @strong{very} long lines, and you use
173continuation to display them, just thinking about them can make Emacs
174redisplay slow.
175
176@defvar cache-long-line-scans
177If this variable is non-@code{nil}, various indentation and motion
178functions, and Emacs redisplay, cache the results of their scans for
179newlines, and consult the cache to avoid rescanning regions of the
180buffer unless they are modified.
181
182Turning on the newline cache slows down processing of short lines.
183
184This variable is automatically local in every buffer.
185@end defvar
186
171@node The Echo Area 187@node The Echo Area
172@section The Echo Area 188@section The Echo Area
173@cindex error display 189@cindex error display
174@cindex echo area 190@cindex echo area
175 191
176 The @dfn{echo area} is used for displaying messages made with the 192The @dfn{echo area} is used for displaying messages made with the
177@code{message} primitive, and for echoing keystrokes. It is not the 193@code{message} primitive, and for echoing keystrokes. It is not the
178same as the minibuffer, despite the fact that the minibuffer appears 194same as the minibuffer, despite the fact that the minibuffer appears
179(when active) in the same place on the screen as the echo area. The 195(when active) in the same place on the screen as the echo area. The
@@ -187,7 +203,7 @@ functions with @code{t} as the stream (@pxref{Output Functions}), or as
187follows: 203follows:
188 204
189@defun message string &rest arguments 205@defun message string &rest arguments
190This function prints a one-line message in the echo area. The 206This function displays a one-line message in the echo area. The
191argument @var{string} is similar to a C language @code{printf} control 207argument @var{string} is similar to a C language @code{printf} control
192string. See @code{format} in @ref{String Conversion}, for the details 208string. See @code{format} in @ref{String Conversion}, for the details
193on the conversion specifications. @code{message} returns the 209on the conversion specifications. @code{message} returns the
@@ -217,6 +233,21 @@ Minibuffer depth is 0.
217@end example 233@end example
218@end defun 234@end defun
219 235
236Almost all the messages displayed in the echo area are also recorded
237in the @samp{*Messages*} buffer.
238
239@defopt message-log-max
240This variable specifies how many lines to keep in the @samp{*Messages*}
241buffer. The value @code{t} means there is no limit on how many lines to
242keep. The value @code{nil} disables message logging entirely. Here's
243how to display a message and prevent it from being logged:
244
245@example
246(let (message-log-max)
247 (message @dots{}))
248@end example
249@end defopt
250
220@defvar cursor-in-echo-area 251@defvar cursor-in-echo-area
221This variable controls where the cursor appears when a message is 252This variable controls where the cursor appears when a message is
222displayed in the echo area. If it is non-@code{nil}, then the cursor 253displayed in the echo area. If it is non-@code{nil}, then the cursor
@@ -227,6 +258,62 @@ The value is normally @code{nil}; Lisp programs bind it to @code{t}
227for brief periods of time. 258for brief periods of time.
228@end defvar 259@end defvar
229 260
261@node Invisible Text
262@section Invisible Text
263
264@cindex invisible text
265You can make characters @dfn{invisible}, so that they do not appear on
266the screen, with the @code{invisible} property. This can be either a
267text property or a property of an overlay.
268
269In the simplest case, any non-@code{nil} @code{invisible} property makes
270a character invisible. This is the default case---if you don't alter
271the default value of @code{buffer-invisibility-spec}, this is how the
272@code{invisibility} property works. This feature is much like selective
273display (@pxref{Selective Display}), but more general and cleaner.
274
275More generally, you can use the variable @code{buffer-invisibility-spec}
276to control which values of the @code{invisible} property make text
277invisible. This permits you to classify the text into different subsets
278in advance, by giving them different @code{invisible} values, and
279subsequently make various subsets visible or invisible by changing the
280value of @code{buffer-invisibility-spec}.
281
282Controlling visibility with @code{buffer-invisibility-spec} is
283especially useful in a program to display the list of entries in a data
284base. It permits the implementation of convenient filtering commands to
285view just a part of the entries in the data base. Setting this variable
286is very fast, much faster than scanning all the text in the buffer
287looking for things to change.
288
289@defvar buffer-invisibility-spec
290This variable specifies which kinds of @code{invisible} properties
291actually make a character invisible.
292
293@table @asis
294@item @code{t}
295A character is invisible if its @code{invisible} property is
296non-@code{nil}. This is the default.
297
298@item a list
299Each element of the list makes certain characters invisible.
300Ultimately, a character is invisible if any of the elements of this list
301applies to it. The list can have two kinds of elements:
302
303@table @code
304@item @var{atom}
305A character is invisible if its @code{invisible} propery value
306is @var{atom} or if it is a list with @var{atom} as a member.
307
308@item (@var{atom} . t)
309A character is invisible if its @code{invisible} propery value
310is @var{atom} or if it is a list with @var{atom} as a member.
311Moreover, if this character is at the end of a line and is followed
312by a visible newline, it displays an ellipsis.
313@end table
314@end table
315@end defvar
316
230@node Selective Display 317@node Selective Display
231@section Selective Display 318@section Selective Display
232@cindex selective display 319@cindex selective display
@@ -237,9 +324,13 @@ lines do not appear.
237 324
238 The first variant, explicit selective display, is designed for use in 325 The first variant, explicit selective display, is designed for use in
239a Lisp program. The program controls which lines are hidden by altering 326a Lisp program. The program controls which lines are hidden by altering
240the text. Outline mode uses this variant. In the second variant, the 327the text. Outline mode has traditionally used this variant. It has
241choice of lines to hide is made automatically based on indentation. 328been partially replaced by the invisible text feature (@pxref{Invisible
242This variant is designed as a user-level feature. 329Text}); there is a new version of Outline mode which uses that instead.
330
331 In the second variant, the choice of lines to hide is made
332automatically based on indentation. This variant is designed as a
333user-level feature.
243 334
244 The way you control explicit selective display is by replacing a 335 The way you control explicit selective display is by replacing a
245newline (control-j) with a carriage return (control-m). The text that 336newline (control-j) with a carriage return (control-m). The text that
@@ -370,12 +461,17 @@ given time.
370@c now. Is it? 461@c now. Is it?
371@end defvar 462@end defvar
372 463
464 You can do the same job by creating an overlay with a
465@code{before-string} property. @xref{Overlay Properties}.
466
373@node Temporary Displays 467@node Temporary Displays
374@section Temporary Displays 468@section Temporary Displays
375 469
376 Temporary displays are used by commands to put output into a buffer 470 Temporary displays are used by commands to put output into a buffer
377and then present it to the user for perusal rather than for editing. 471and then present it to the user for perusal rather than for editing.
378Many of the help commands use this feature. 472Many of the help commands use this feature. Nowadays you can do the
473same job by creating an overlay with a @code{before-string} property.
474@xref{Overlay Properties}.
379 475
380@defspec with-output-to-temp-buffer buffer-name forms@dots{} 476@defspec with-output-to-temp-buffer buffer-name forms@dots{}
381This function executes @var{forms} while arranging to insert any 477This function executes @var{forms} while arranging to insert any
@@ -527,11 +623,18 @@ what they should mean.
527If the @code{window} property is non-@code{nil}, then the overlay 623If the @code{window} property is non-@code{nil}, then the overlay
528applies only on that window. 624applies only on that window.
529 625
626@item category
627@kindex category @r{(overlay property)}
628If an overlay has a @code{category} property, we call it the
629@dfn{category} of the character. It should be a symbol. The properties
630of the symbol serve as defaults for the properties of the overlay.
631
530@item face 632@item face
531@kindex face @r{(overlay property)} 633@kindex face @r{(overlay property)}
532This property controls the font and color of text. @xref{Faces}, for 634This property controls the font and color of text. Its value is a face
533more information. This feature is temporary; in the future, we may 635name or a list of face names. @xref{Faces}, for more information. This
534replace it with other ways of specifying how to display text. 636feature may be temporary; in the future, we may replace it with other
637ways of specifying how to display text.
535 638
536@item mouse-face 639@item mouse-face
537@kindex mouse-face @r{(overlay property)} 640@kindex mouse-face @r{(overlay property)}
@@ -543,39 +646,67 @@ the range of the overlay. This feature may be temporary, like
543@kindex modification-hooks @r{(overlay property)} 646@kindex modification-hooks @r{(overlay property)}
544This property's value is a list of functions to be called if any 647This property's value is a list of functions to be called if any
545character within the overlay is changed or if text is inserted strictly 648character within the overlay is changed or if text is inserted strictly
546within the overlay. Each function receives three arguments: the 649within the overlay.
547overlay, and the beginning and end of the part of the buffer being 650
651The hook functions are called both before and after each change.
652If the functions save the information they receive, and compare notes
653between calls, they can determine exactly what change has been made
654in the buffer text.
655
656When called before a change, each function receives four arguments: the
657overlay, @code{nil}, and the beginning and end of the text range to be
548modified. 658modified.
549 659
660When called after a change, each function receives five arguments: the
661overlay, @code{t}, the beginning and end of the text range just
662modified, and the length of the pre-change text replaced by that range.
663(For an insertion, the pre-change length is zero; for a deletion, that
664length is the number of characters deleted, and the post-change
665beginning and end are at the same place.)
666
550@item insert-in-front-hooks 667@item insert-in-front-hooks
551@kindex insert-in-front-hooks @r{(overlay property)} 668@kindex insert-in-front-hooks @r{(overlay property)}
552This property's value is a list of functions to be called 669This property's value is a list of functions to be called before and
553if text is inserted right at the beginning of the overlay. 670after inserting text right at the beginning of the overlay. The calling
671conventions are the same as for the @code{modification-hooks} functions.
554 672
555@item insert-behind-hooks 673@item insert-behind-hooks
556@kindex insert-behind-hooks @r{(overlay property)} 674@kindex insert-behind-hooks @r{(overlay property)}
557This property's value is a list of functions to be called if text is 675This property's value is a list of functions to be called before and
558inserted right at the end of the overlay. 676after inserting text right at the end of the overlay. The calling
677conventions are the same as for the @code{modification-hooks} functions.
559 678
560@item invisible 679@item invisible
561@kindex invisible @r{(overlay property)} 680@kindex invisible @r{(overlay property)}
562A non-@code{nil} @code{invisible} property means that the text in the 681The @code{invisible} property can make the text in the overlay
563overlay does not appear on the screen. This works much like selective 682invisible, which means that it does not appear on the screen.
564display. Details of this feature are likely to change in future 683@xref{Invisible Text}, for details.
565versions, so check the @file{etc/NEWS} file in the version you are 684
566using. 685@item intangible
686@kindex intangible @r{(overlay property)}
687The @code{intangible} property on an overlay works just like the
688@code{intangible} text propert. @xref{Special Properties}, for details.
567 689
568@item before-string 690@item before-string
569@kindex before-string @r{(overlay property)} 691@kindex before-string @r{(overlay property)}
570This property's value is a string to add to the display at the beginning 692This property's value is a string to add to the display at the beginning
571of the overlay. The string does not appear in the buffer in any 693of the overlay. The string does not appear in the buffer in any
572sense---only on the screen. This is not yet implemented, but will be. 694sense---only on the screen. The string should contain only characters
695that display as a single column---control characters, including tabs or
696newlines, will give strange results.
573 697
574@item after-string 698@item after-string
575@kindex after-string @r{(overlay property)} 699@kindex after-string @r{(overlay property)}
576This property's value is a string to add to the display at the end of 700This property's value is a string to add to the display at the end of
577the overlay. The string does not appear in the buffer in any 701the overlay. The string does not appear in the buffer in any
578sense---only on the screen. This is not yet implemented, but will be. 702sense---only on the screen. The string should contain only characters
703that display as a single column---control characters, including tabs or
704newlines, will give strange results.
705
706@item evaporate
707@kindex evaporate @r{(overlay property)}
708If this property is non-@code{nil}, the overlay is deleted automatically
709if it ever becomes empty (i.e., if it spans no characters).
579@end table 710@end table
580 711
581 These are the functions for reading and writing the properties of an 712 These are the functions for reading and writing the properties of an
@@ -583,8 +714,10 @@ overlay.
583 714
584@defun overlay-get overlay prop 715@defun overlay-get overlay prop
585This function returns the value of property @var{prop} recorded in 716This function returns the value of property @var{prop} recorded in
586@var{overlay}. If @var{overlay} does not record any value for that 717@var{overlay}, if any. If @var{overlay} does not record any value for
587property, then the value is @code{nil}. 718that property, but it does have a @code{category} property which is a
719symbol, that symbol's @var{prop} property is used. Otherwise, the value
720is @code{nil}.
588@end defun 721@end defun
589 722
590@defun overlay-put overlay prop value 723@defun overlay-put overlay prop value
@@ -654,6 +787,11 @@ This function returns the buffer position of the next beginning or end
654of an overlay, after @var{pos}. 787of an overlay, after @var{pos}.
655@end defun 788@end defun
656 789
790@defun previous-overlay-change pos
791This function returns the buffer position of the previous beginning or
792end of an overlay, before @var{pos}.
793@end defun
794
657@node Faces 795@node Faces
658@section Faces 796@section Faces
659@cindex face 797@cindex face
@@ -667,6 +805,12 @@ Each face has its own @dfn{face id number} which distinguishes faces at
667low levels within Emacs. However, for most purposes, you can refer to 805low levels within Emacs. However, for most purposes, you can refer to
668faces in Lisp programs by their names. 806faces in Lisp programs by their names.
669 807
808@defun facep object
809This function returns @code{t} if @var{object} is a face name symbol (or
810if it is a vector of the kind used internally to record face data). It
811returns @code{nil} otherwise.
812@end defun
813
670Each face name is meaningful for all frames, and by default it has the 814Each face name is meaningful for all frames, and by default it has the
671same meaning in all frames. But you can arrange to give a particular 815same meaning in all frames. But you can arrange to give a particular
672face name a special meaning in one frame if you wish. 816face name a special meaning in one frame if you wish.
@@ -1051,9 +1195,10 @@ This creates and returns a display table. The table initially has
1051element says how to display the character code @var{n}. The value 1195element says how to display the character code @var{n}. The value
1052should be @code{nil} or a vector of glyph values (@pxref{Glyphs}). If 1196should be @code{nil} or a vector of glyph values (@pxref{Glyphs}). If
1053an element is @code{nil}, it says to display that character according to 1197an element is @code{nil}, it says to display that character according to
1054the usual display conventions (@pxref{Usual Display}). Note that the 1198the usual display conventions (@pxref{Usual Display}).
1055display table has no effect on the tab and newline characters; they are 1199
1056always displayed as whitespace in their usual special fashion. 1200 If you use the display table to change the display of newline
1201characters, the whole buffer will be displayed as one long ``line.''
1057 1202
1058 The remaining six elements of a display table serve special purposes, 1203 The remaining six elements of a display table serve special purposes,
1059and @code{nil} means use the default stated below. 1204and @code{nil} means use the default stated below.
diff --git a/lispref/elisp.texi b/lispref/elisp.texi
index ce4b7d542c2..e1e21b9417c 100644
--- a/lispref/elisp.texi
+++ b/lispref/elisp.texi
@@ -6,8 +6,8 @@
6@c %**end of header 6@c %**end of header
7 7
8@ifinfo 8@ifinfo
9This version is the edition 2.3 of the GNU Emacs Lisp 9This version is the edition 2.4 of the GNU Emacs Lisp
10Reference Manual. It corresponds to Emacs Version 19.25. 10Reference Manual. It corresponds to Emacs Version 19.29.
11@c Please REMEMBER to update edition number in *four* places in this file 11@c Please REMEMBER to update edition number in *four* places in this file
12@c and also in *one* place in intro.texi 12@c and also in *one* place in intro.texi
13 13
@@ -15,7 +15,7 @@ Published by the Free Software Foundation
15675 Massachusetts Avenue 15675 Massachusetts Avenue
16Cambridge, MA 02139 USA 16Cambridge, MA 02139 USA
17 17
18Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 18Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
19 19
20Permission is granted to make and distribute verbatim copies of this 20Permission is granted to make and distribute verbatim copies of this
21manual provided the copyright notice and this permission notice are 21manual provided the copyright notice and this permission notice are
@@ -68,21 +68,20 @@ instead of in the original English.
68@subtitle for Unix Users 68@subtitle for Unix Users
69@c The edition number appears in several places in this file 69@c The edition number appears in several places in this file
70@c and also in the file intro.texi. 70@c and also in the file intro.texi.
71@subtitle Second Edition, June 1993 71@subtitle Revision 2.4, June 1995
72@subtitle Revision 2.3, June 1994
73 72
74@author by Bil Lewis, Dan LaLiberte, Richard Stallman 73@author by Bil Lewis, Dan LaLiberte, Richard Stallman
75@author and the GNU Manual Group 74@author and the GNU Manual Group
76@page 75@page
77@vskip 0pt plus 1filll 76@vskip 0pt plus 1filll
78Copyright @copyright{} 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 77Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
79 78
80@sp 2 79@sp 2
81Edition 2.3 @* 80Edition 2.4 @*
82Revised for Emacs Version 19.25,@* 81Revised for Emacs Version 19.29,@*
83June, 1994.@* 82June, 1995.@*
84@sp 2 83@sp 2
85ISBN 1-882114-40-X 84ISBN 1-882114-71-X
86 85
87@sp 2 86@sp 2
88Published by the Free Software Foundation @* 87Published by the Free Software Foundation @*
@@ -113,8 +112,8 @@ Cover art by Etienne Suvasa.
113@node Top, Copying, (dir), (dir) 112@node Top, Copying, (dir), (dir)
114 113
115@ifinfo 114@ifinfo
116This Info file contains edition 2.3 of the GNU Emacs Lisp 115This Info file contains edition 2.4 of the GNU Emacs Lisp
117Reference Manual, corresponding to GNU Emacs version 19.25. 116Reference Manual, corresponding to GNU Emacs version 19.29.
118@end ifinfo 117@end ifinfo
119 118
120@menu 119@menu
@@ -268,7 +267,7 @@ Numbers
268* Arithmetic Operations:: How to add, subtract, multiply and divide. 267* Arithmetic Operations:: How to add, subtract, multiply and divide.
269* Bitwise Operations:: Logical and, or, not, shifting. 268* Bitwise Operations:: Logical and, or, not, shifting.
270* Numeric Conversions:: Converting float to integer and vice versa. 269* Numeric Conversions:: Converting float to integer and vice versa.
271* Transcendental Functions:: Trig, exponential and logarithmic functions. 270* Math Functions:: Trig, exponential and logarithmic functions.
272* Random Numbers:: Obtaining random integers, predictable or not. 271* Random Numbers:: Obtaining random integers, predictable or not.
273 272
274Strings and Characters 273Strings and Characters
@@ -707,7 +706,7 @@ The Kill Ring
707* Kill Ring Concepts:: What text looks like in the kill ring. 706* Kill Ring Concepts:: What text looks like in the kill ring.
708* Kill Functions:: Functions that kill text. 707* Kill Functions:: Functions that kill text.
709* Yank Commands:: Commands that access the kill ring. 708* Yank Commands:: Commands that access the kill ring.
710* Low Level Kill Ring:: Functions and variables for kill ring access. 709* Low-Level Kill Ring:: Functions and variables for kill ring access.
711* Internals of Kill Ring:: Variables that hold kill-ring data. 710* Internals of Kill Ring:: Variables that hold kill-ring data.
712 711
713Indentation 712Indentation
diff --git a/lispref/eval.texi b/lispref/eval.texi
index 999f3b4b1c4..1bbd672f5fc 100644
--- a/lispref/eval.texi
+++ b/lispref/eval.texi
@@ -165,6 +165,10 @@ reached, or until an error is signaled and not handled.
165If @var{stream} is supplied, @code{standard-output} is bound to it 165If @var{stream} is supplied, @code{standard-output} is bound to it
166during the evaluation. 166during the evaluation.
167 167
168You can use the variable @code{load-read-function} to specify a function
169for @code{eval-region} to use instead of @code{read} for reading
170expressions. @xref{How Programs Do Loading}.
171
168@code{eval-region} always returns @code{nil}. 172@code{eval-region} always returns @code{nil}.
169@end deffn 173@end deffn
170 174
diff --git a/lispref/files.texi b/lispref/files.texi
index 7c7f20c2884..cfcab286d7b 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -34,6 +34,7 @@ substitutions such as @samp{$HOME}. @xref{File Name Expansion}.
34* Create/Delete Dirs:: Creating and Deleting Directories. 34* Create/Delete Dirs:: Creating and Deleting Directories.
35* Magic File Names:: Defining "magic" special handling 35* Magic File Names:: Defining "magic" special handling
36 for certain file names. 36 for certain file names.
37* Format Conversion:: Conversion to and from various file formats.
37* Files and MS-DOS:: Distinguishing text and binary files on MS-DOS. 38* Files and MS-DOS:: Distinguishing text and binary files on MS-DOS.
38@end menu 39@end menu
39 40
@@ -426,6 +427,10 @@ contents of the buffer (actually, just the accessible portion) with the
426contents of the file. This is better than simply deleting the buffer 427contents of the file. This is better than simply deleting the buffer
427contents and inserting the whole file, because (1) it preserves some 428contents and inserting the whole file, because (1) it preserves some
428marker positions and (2) it puts less data in the undo list. 429marker positions and (2) it puts less data in the undo list.
430
431The function @code{insert-file-contents} checks the file contents
432against the defined file formats, and converts the file contents if
433appropriate. @xref{Format Conversion}.
429@end defun 434@end defun
430 435
431If you want to pass a file name to another process so that another 436If you want to pass a file name to another process so that another
@@ -488,6 +493,10 @@ Normally, @code{write-region} displays a message @samp{Wrote file
488nor @code{nil} nor a string, then this message is inhibited. This 493nor @code{nil} nor a string, then this message is inhibited. This
489feature is useful for programs that use files for internal purposes, 494feature is useful for programs that use files for internal purposes,
490files that the user does not need to know about. 495files that the user does not need to know about.
496
497The function @code{write-region} converts the data which it writes to
498the appropriate file formats specified by @code{buffer-file-format}.
499@xref{Format Conversion}.
491@end deffn 500@end deffn
492 501
493@node File Locks 502@node File Locks
@@ -684,6 +693,11 @@ we can deduce that any attempt to read a file in @file{/foo/} will
684give an error. 693give an error.
685@end defun 694@end defun
686 695
696@defun file-ownership-preserved-p filename
697This function returns @code{t} if deleting the file @var{filename} and
698then creating it anew would keep the file's owner unchanged.
699@end defun
700
687@defun file-newer-than-file-p filename1 filename2 701@defun file-newer-than-file-p filename1 filename2
688@cindex file age 702@cindex file age
689@cindex file modification time 703@cindex file modification time
@@ -787,6 +801,12 @@ existing directory, @code{nil} otherwise.
787@end example 801@end example
788@end defun 802@end defun
789 803
804@defun file-regular-p filename
805This function returns @code{t} if the file @var{filename} exists and is
806a regular file (not a directory, symbolic link, named pipe, terminal, or
807other I/O device).
808@end defun
809
790@node Truenames 810@node Truenames
791@subsection Truenames 811@subsection Truenames
792@cindex truename (of file) 812@cindex truename (of file)
@@ -1309,6 +1329,12 @@ backup version numbers, or trailing tildes.
1309@end example 1329@end example
1310@end defun 1330@end defun
1311 1331
1332@defun file-name-sans-extension filename
1333This function returns @var{filename} sans its final ``extension'', if
1334any. The extension, in a file name, is the part that follows the last
1335@samp{.}.
1336@end defun
1337
1312@node Directory Names 1338@node Directory Names
1313@comment node-name, next, previous, up 1339@comment node-name, next, previous, up
1314@subsection Directory Names 1340@subsection Directory Names
@@ -1944,6 +1970,124 @@ non-magic directory to serve as its current directory, and this function
1944is a good way to come up with one. 1970is a good way to come up with one.
1945@end defun 1971@end defun
1946 1972
1973@node Format Conversion
1974@section File Format Conversion
1975
1976@cindex file format conversion
1977@cindex encoding file formats
1978@cindex decoding file formats
1979 The variable @code{format-alist} defines a list of @dfn{file formats},
1980which are textual representations used in files for the data (text,
1981text-properties, and possibly other information) in an Emacs buffer.
1982Emacs performs format conversion when reading and writing files.
1983
1984@defvar format-alist
1985This list contains one format definition for each defined file format.
1986@end defvar
1987
1988@cindex format definition
1989Each format definition is a list of this form:
1990
1991@example
1992(@var{name} @var{doc-string} @var{regexp} @var{from-fn} @var{to-fn} @var{modify} @var{mode-fn})
1993@end example
1994
1995Here is what the elements in a format definition mean:
1996
1997@table @var
1998@item name
1999The name of this format.
2000
2001@item doc-string
2002A documentation string for the format.
2003
2004@item regexp
2005A regular expression which is used to recognize files represented in
2006this format.
2007
2008@item from-fn
2009A function to call to decode data in this format (to convert file data into
2010the usual Emacs data representation).
2011
2012The @var{from-fn} is called with two args, @var{begin} and @var{end},
2013which specify the part of the buffer it should convert. It should convert
2014the text by editing it in place. Since this can change the length of the
2015text, @var{from-fn} should return the modified end position.
2016
2017One responsibility of @var{from-fm} is to make sure that the beginning
2018of the file no longer matches @var{regexp}. Otherwise it is likely to
2019get called again.
2020
2021@item to-fn
2022A function to call to encode data in this format (to convert
2023the usual Emacs data representation into this format).
2024
2025The @var{to-fn} is called with two args, @var{begin} and @var{end},
2026which specify the part of the buffer it should convert. There are
2027two ways it can do the conversion:
2028
2029@itemize @bullet
2030@item
2031By editing the buffer in place. In this case, @var{to-fn} should
2032return the end-position of the range of text, as modified.
2033
2034@item
2035By returning a list of annotations. This is a list of elements of the
2036form @code{(@var{position} . @var{string})}, where @var{position} is an
2037integer specifying the relative position in the text to be written, and
2038@var{string} is the annotation to add there. The list must be sorted in
2039order of position when @var{to-fn} returns it.
2040
2041When @code{write-region} actually writes the text from the buffer to the
2042file, it intermixes the specified annotations at the corresponding
2043positions. All this takes place without modifying the buffer.
2044@end itemize
2045
2046@item modify
2047A flag, @code{t} if the encoding function modifies the buffer, and
2048@code{nil} if it works by returning a list of annotations.
2049
2050@item mode
2051A mode function to call after visiting a file converted from this
2052format.
2053@end table
2054
2055The function @code{insert-file-contents} automatically recognizes file
2056formats when it reads the specified file. It checks the text of the
2057beginning of the file against the regular expressions of the format
2058definitions, and if it finds a match, it calls the decoding function for
2059that format. Then it checks all the known formats over again.
2060It keeps checking them until none of them is applicable.
2061
2062Visiting a file, with @code{find-file-noselect} or the commands that use
2063it, performs conversion likewise (because it calls
2064@code{insert-file-contents}); but it also calls the mode function for
2065each format that it decodes. It stores a list of the format names
2066in the buffer-local variable @code{buffer-file-format}.
2067
2068@defvar buffer-file-format
2069This variable holds a list of the file formats that were decoded in the
2070course of visiting the current buffer's file. It is always local in all
2071buffers.
2072@end defvar
2073
2074When @code{write-region} writes data into a file, it first calls the
2075encoding functions for the formats listed in @code{buffer-file-format}.
2076
2077@defun format-write-file file format
2078This command writes the current buffer contents into the file @var{file}
2079in format @var{format}, and makes that format the default for future
2080saves of the buffer.
2081@end defun
2082
2083@defvar auto-save-file-format
2084This variable specifies the format to use for auto-saving. Its value is
2085a list of format names, just like the value of
2086@code{buffer-file-format}; but it is used instead of
2087@code{buffer-file-format} for writing auto-save files. This variable
2088is always local in all buffers.
2089@end defvar
2090
1947@node Files and MS-DOS 2091@node Files and MS-DOS
1948@section Files and MS-DOS 2092@section Files and MS-DOS
1949@cindex MS-DOS file types 2093@cindex MS-DOS file types
diff --git a/lispref/frames.texi b/lispref/frames.texi
index edcff7ea6fa..97d8e3e940a 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -14,11 +14,13 @@ horizontally into smaller windows.
14 14
15@cindex terminal frame 15@cindex terminal frame
16@cindex X window frame 16@cindex X window frame
17 When Emacs runs on a text-only terminal, it has just one frame, a 17 When Emacs runs on a text-only terminal, it starts with one
18@dfn{terminal frame}. There is no way to create another terminal frame 18@dfn{terminal frames}. If you create additional ones, Emacs displays
19after startup. If Emacs has an X display, it does not have a terminal 19one and only one at any given time---on the terminal screen, of course.
20frame; instead, it starts with a single @dfn{X window frame}. You can 20
21create more; see @ref{Creating Frames}. 21 When Emacs uses X for display, it does not have a terminal frame;
22instead, it starts with a single @dfn{X window frame}. It can display
23multiple X window frames at the same time, each in its own X window.
22 24
23@defun framep object 25@defun framep object
24This predicate returns @code{t} if @var{object} is a frame, and 26This predicate returns @code{t} if @var{object} is a frame, and
@@ -26,8 +28,10 @@ This predicate returns @code{t} if @var{object} is a frame, and
26@end defun 28@end defun
27 29
28@menu 30@menu
29* Creating Frames:: Creating additional X Window frames. 31* Creating Frames:: Creating additional frames.
32* Multiple Displays:: Creating frames on other X displays.
30* Frame Parameters:: Controlling frame size, position, font, etc. 33* Frame Parameters:: Controlling frame size, position, font, etc.
34* Frame Titles:: Automatic updating of frame titles.
31* Deleting Frames:: Frames last until explicitly deleted. 35* Deleting Frames:: Frames last until explicitly deleted.
32* Finding All Frames:: How to examine all existing frames. 36* Finding All Frames:: How to examine all existing frames.
33* Frames and Windows:: A frame contains windows; 37* Frames and Windows:: A frame contains windows;
@@ -57,8 +61,8 @@ This predicate returns @code{t} if @var{object} is a frame, and
57To create a new frame, call the function @code{make-frame}. 61To create a new frame, call the function @code{make-frame}.
58 62
59@defun make-frame alist 63@defun make-frame alist
60This function creates a new frame, if the display mechanism permits 64This function creates a new frame. If you are using X, it makes
61creation of frames. (An X server does; an ordinary terminal does not.) 65an X window frame; otherwise, it makes a terminal frame.
62 66
63The argument is an alist specifying frame parameters. Any parameters 67The argument is an alist specifying frame parameters. Any parameters
64not mentioned in @var{alist} default according to the value of the 68not mentioned in @var{alist} default according to the value of the
@@ -67,8 +71,7 @@ either default from the standard X defaults file and X resources.
67 71
68The set of possible parameters depends in principle on what kind of 72The set of possible parameters depends in principle on what kind of
69window system Emacs uses to display its frames. @xref{X Frame 73window system Emacs uses to display its frames. @xref{X Frame
70Parameters}, for documentation of individual parameters you can specify 74Parameters}, for documentation of individual parameters you can specify.
71when creating an X window frame.
72@end defun 75@end defun
73 76
74@defvar before-make-frame-hook 77@defvar before-make-frame-hook
@@ -80,6 +83,62 @@ frame.
80A normal hook run by @code{make-frame} after it creates the frame. 83A normal hook run by @code{make-frame} after it creates the frame.
81@end defvar 84@end defvar
82 85
86@node Multiple Displays
87@section Multiple Displays
88@cindex multiple displays
89@cindex multiple X terminals
90@cindex displays, multiple
91
92 A single Emacs can talk to more than one X Windows display.
93Initially, Emacs uses just one display---the one chosen with the
94@code{DISPLAY} environment variable or with the @samp{--display} option
95(@pxref{Initial Options,,, emacs, The GNU Emacs Manual}). To connect to
96another display, use the command @code{make-frame-on-display} or specify
97the @code{display} frame parameter when you create the frame.
98
99 Emacs treats each X server as a separate terminal, giving each one its
100own selected frame and its own minibuffer windows. A few Lisp variables
101have values local to the current terminal (that is, the terminal
102corresponding to the currently selected frame): these are
103@code{default-minibuffer-frame}, @code{defining-kbd-macro},
104@code{last-kbd-macro}, @code{multiple-frames} and
105@code{system-key-alist}. These variables are always terminal-local and
106can never be buffer-local.
107
108 A single X server can handle more than one screen. A display name
109@samp{@var{host}.@var{server}.@var{screen}} has three parts; the last
110part specifies the screen number for a given server. When you use two
111screens belonging to one server, Emacs knows by the similarity in their
112names that they share a single keyboard, and it treats them as a single
113terminal.
114
115@deffn Command make-frame-on-display display &optional parameters
116This creates a new frame on display @var{display}, taking the other
117frame parameters from @var{parameters}. Aside from the @var{display}
118argument, it is like @code{make-frame} (@pxref{Creating Frames}).
119@end deffn
120
121@defun x-display-list
122This returns a list that indicates which X displays Emacs has a
123connection to. The elements of the list are display names (strings).
124@end defun
125
126@defun x-open-connection display &optional xrm-string
127This function opens a connection to the X display @var{display}. It
128does not create a frame on that display, but it permits you to check
129that communication can be established with that display.
130
131The optional second argument @var{xrm-string} should be a string of
132resources in xrdb format, or @code{nil}. The resources, if specified,
133apply to all Emacs frames created on this display.
134@end defun
135
136@defun x-close-connection display
137This function closes the connection to display @var{display}. Before
138you can do this, you must first delete all the frames that were open on
139that display (@pxref{Deleting Frames}).
140@end defun
141
83@node Frame Parameters 142@node Frame Parameters
84@section Frame Parameters 143@section Frame Parameters
85 144
@@ -95,7 +154,7 @@ and width.
95@menu 154@menu
96* Parameter Access:: How to change a frame's parameters. 155* Parameter Access:: How to change a frame's parameters.
97* Initial Parameters:: Specifying frame parameters when you make a frame. 156* Initial Parameters:: Specifying frame parameters when you make a frame.
98* X Frame Parameters:: Individual parameters documented. 157* X Frame Parameters:: List of frame parameters.
99* Size and Position:: Changing the size and position of a frame. 158* Size and Position:: Changing the size and position of a frame.
100@end menu 159@end menu
101 160
@@ -180,7 +239,9 @@ instead. @xref{Command Arguments,,, emacs, The GNU Emacs Manual}.
180@subsection X Window Frame Parameters 239@subsection X Window Frame Parameters
181 240
182Just what parameters a frame has depends on what display mechanism it 241Just what parameters a frame has depends on what display mechanism it
183uses. Here is a table of the parameters of an X window frame: 242uses. Here is a table of the parameters of an X window frame; of these,
243@code{name}, @code{height}, @code{width}, and @code{buffer-predicate}
244provide meaningful information in non-X frames.
184 245
185@table @code 246@table @code
186@item name 247@item name
@@ -193,15 +254,32 @@ If you specify the frame name explicitly when you create the frame, the
193name is also used (instead of the name of the Emacs executable) when 254name is also used (instead of the name of the Emacs executable) when
194looking up X resources for the frame. 255looking up X resources for the frame.
195 256
257@item display
258The display on which to open this frame. It should be a string of the
259form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the
260@code{DISPLAY} environment variable.
261
196@item left 262@item left
197The screen position of the left edge, in pixels. The value may be 263The screen position of the left edge, in pixels, with respect to the
198@code{-} instead of a number; that represents @samp{-0} in a geometry 264left edge of the screen. The value may be a positive number @var{pos},
199specification. 265or a list of the form @code{(+ @var{pos})} which permits specifying a
266negative @var{pos} value.
267
268A negative number @minus{}@var{pos}, or a list of the form @code{(-
269@var{pos})}, actually specifies the position of the right edge of the
270window with respect to the right edge of the screen, counting toward the
271left.
200 272
201@item top 273@item top
202The screen position of the top edge, in pixels. The value may be 274The screen position of the top edge, in pixels, with respect to the
203@code{-} instead of a number; that represents @samp{-0} in a geometry 275top edge of the screen. The value may be a positive number @var{pos},
204specification. 276or a list of the form @code{(+ @var{pos})} which permits specifying a
277negative @var{pos} value.
278
279A negative number @minus{}@var{pos}, or a list of the form @code{(-
280@var{pos})}, actually specifies the position of the bottom edge of the
281window with respect to the bottom edge of the screen, counting toward the
282top.
205 283
206@item icon-left 284@item icon-left
207The screen position of the left edge @emph{of the frame's icon}, in 285The screen position of the left edge @emph{of the frame's icon}, in
@@ -237,6 +315,14 @@ yes, @code{nil} means no, @code{only} means this frame is just a
237minibuffer, a minibuffer window (in some other frame) means the new 315minibuffer, a minibuffer window (in some other frame) means the new
238frame uses that minibuffer. 316frame uses that minibuffer.
239 317
318@item buffer-predicate
319The buffer-predicate function for this frame. The function
320@code{other-buffer} uses this predicate (from the selected frame) to
321decide which buffers it should consider, if the predicate is not
322@code{nil}. It calls the predicate with one arg, a buffer, once for
323each buffer; if the predicate returns a non-@code{nil} value, it
324considers that buffer.
325
240@item font 326@item font
241The name of the font for displaying text in the frame. This is a 327The name of the font for displaying text in the frame. This is a
242string. 328string.
@@ -256,6 +342,9 @@ Whether the frame has scroll bars for horizontal scrolling
256(non-@code{nil} means yes). (Horizontal scroll bars are not currently 342(non-@code{nil} means yes). (Horizontal scroll bars are not currently
257implemented.) 343implemented.)
258 344
345@item scroll-bar-width
346The width of the vertical scroll bar, in pixels.
347
259@item icon-type 348@item icon-type
260The type of icon to use for this frame when it is iconified. If the 349The type of icon to use for this frame when it is iconified. If the
261value is a string, that specifies a file containing a bitmap to use. 350value is a string, that specifies a file containing a bitmap to use.
@@ -279,11 +368,12 @@ The color for the cursor that shows point.
279The color for the border of the frame. 368The color for the border of the frame.
280 369
281@item cursor-type 370@item cursor-type
282The way to display the cursor. There are two legitimate values: 371The way to display the cursor. The legitimate values are @code{bar},
283@code{bar} and @code{box}. The symbol @code{bar} specifies a vertical 372@code{box}, and @code{(bar . @var{width})}. The symbol @code{box}
284bar between characters as the cursor. The symbol @code{box} specifies 373specifies an ordinary black box overlaying the character after point;
285an ordinary black box overlaying the character after point; that is the 374that is the default. The symbol @code{bar} specifies a vertical bar
286default. 375between characters as the cursor. @code{(bar . @var{width})} specifies
376a bar @var{width} pixels wide.
287 377
288@item border-width 378@item border-width
289The width in pixels of the window border. 379The width in pixels of the window border.
@@ -376,9 +466,37 @@ gives the values specified for them. Each element looks like
376@code{(@var{parameter} . @var{value})}. The possible @var{parameter} 466@code{(@var{parameter} . @var{value})}. The possible @var{parameter}
377values are @code{left}, @code{top}, @code{width}, and @code{height}. 467values are @code{left}, @code{top}, @code{width}, and @code{height}.
378 468
469For the size parameters, the value must be an integer. The position
470parameter names @code{left} and @code{top} are not totally accurate,
471because some values indicate the position of the right or bottom edges
472instead. These are the @var{value} possibilities for the position
473parameters:
474
475@table @asis
476@item an integer
477A positive integer relates the left edge or top edge of the window to
478the left or top edge of the screen. A negative integer relates the
479right or bottom edge of the window to the right or bottom edge of the
480screen.
481
482@item (+ @var{position})
483This specifies the position of the left or top edge of the window
484relative to the left or top edge of the screen. The integer
485@var{position} may be positive or negative; a negative value specifies a
486position outside the screen.
487
488@item (- @var{position})
489This specifies the position of the right or bottom edge of the window
490relative to the right or bottom edge of the screen. The integer
491@var{position} may be positive or negative; a negative value specifies a
492position outside the screen.
493@end table
494
495Here is an example:
496
379@smallexample 497@smallexample
380(x-parse-geometry "35x70+0-0") 498(x-parse-geometry "35x70+0-0")
381 @result{} ((width . 35) (height . 70) (left . 0) (top . -1)) 499 @result{} ((width . 35) (height . 70) (left . 0) (top - 0))
382@end smallexample 500@end smallexample
383@end defun 501@end defun
384 502
@@ -388,6 +506,42 @@ size of a specified frame. The frame is the first argument; the size is
388the second. 506the second.
389@end ignore 507@end ignore
390 508
509@node Frame Titles
510@section Frame Titles
511
512Every frame has a title; most window managers display the frame title at
513the top of the frame. You can specify an explicit title with the
514@code{name} frame property. But normally you don't specify this
515explicitly, and Emacs computes the title automatically.
516
517Emacs computes the frame title based on a template stored in the
518variable @code{frame-title-format}.
519
520@defvar frame-title-format
521This variable specifies how to compute a title for a frame
522when you have not explicitly specified one.
523
524The variable's value is actually a mode line construct, just like
525@code{mode-line-format}. @xref{Mode Line Data}.
526@end defvar
527
528@defvar icon-title-format
529This variable specifies how to compute the title for an iconified frame,
530when you have not explicitly specified the frame title. This title
531appears in the icon itself.
532@end defvar
533
534@defvar multiple-frames
535This variable is set automatically by Emacs. Its value is @code{t} when
536there are two or more frames (not counting minibuffer-only frames or
537invisible frames). The default value of @code{frame-title-format} uses
538@code{multiple-frames} so as to put the buffer name in the frame title
539only when there is more than one frame.
540
541The variable is always local to the current X terminal and cannot be
542buffer-local. @xref{Multiple Displays}.
543@end defvar
544
391@node Deleting Frames 545@node Deleting Frames
392@section Deleting Frames 546@section Deleting Frames
393@cindex deletion of frames 547@cindex deletion of frames
@@ -409,6 +563,12 @@ The function @code{frame-live-p} returns non-@code{nil} if the frame
409@var{frame} has not been deleted. 563@var{frame} has not been deleted.
410@end defun 564@end defun
411 565
566 Some window managers provide a command to delete a window. These work
567by sending a special message to the program than operates the window.
568When Emacs gets one of these commands, it generates a
569@code{delete-frame} event, whose normal definition is a command that
570calls the function @code{delete-frame}. @xref{Misc Events}.
571
412@node Finding All Frames 572@node Finding All Frames
413@section Finding All Frames 573@section Finding All Frames
414 574
@@ -421,7 +581,8 @@ doesn't have any effect on the internals of Emacs.
421 581
422@defun visible-frame-list 582@defun visible-frame-list
423This function returns a list of just the currently visible frames. 583This function returns a list of just the currently visible frames.
424@xref{Visibility of Frames}. 584@xref{Visibility of Frames}. (Terminal frames always count as
585``visible'', even though only the selected one is actually displayed.)
425@end defun 586@end defun
426 587
427@defun next-frame &optional frame minibuf 588@defun next-frame &optional frame minibuf
@@ -502,6 +663,12 @@ If you use a minibuffer-only frame, you might want that frame to raise
502when you enter the minibuffer. If so, set the variable 663when you enter the minibuffer. If so, set the variable
503@code{minibuffer-auto-raise} to @code{t}. @xref{Raising and Lowering}. 664@code{minibuffer-auto-raise} to @code{t}. @xref{Raising and Lowering}.
504 665
666@defvar default-minibuffer-frame
667This variable specifies the frame to use for the minibuffer window, by
668default. It is always local to the current X terminal and cannot be
669buffer-local. @xref{Multiple Displays}.
670@end defvar
671
505@node Input Focus 672@node Input Focus
506@section Input Focus 673@section Input Focus
507@cindex input focus 674@cindex input focus
@@ -524,12 +691,20 @@ the function @code{select-frame}. This does not override the window
524manager; rather, it escapes from the window manager's control until 691manager; rather, it escapes from the window manager's control until
525that control is somehow reasserted. 692that control is somehow reasserted.
526 693
694When using a text-only terminal, there is no window manager; therefore,
695@code{switch-frame} is the only way to switch frames, and the effect
696lasts until overridden by a subsequent call to @code{switch-frame}.
697Only the selected terminal frame is actually displayed on the terminal.
698Each terminal screen except for the initial one has a number, and the
699number of the selected frame appears in the mode line after the word
700@samp{Emacs}.
701
527@c ??? This is not yet implemented properly. 702@c ??? This is not yet implemented properly.
528@defun select-frame frame 703@defun select-frame frame
529This function selects frame @var{frame}, temporarily disregarding the 704This function selects frame @var{frame}, temporarily disregarding the
530focus of the X server. The selection of @var{frame} lasts until the 705focus of the X server if any. The selection of @var{frame} lasts until
531next time the user does something to select a different frame, or until 706the next time the user does something to select a different frame, or
532the next time this function is called. 707until the next time this function is called.
533@end defun 708@end defun
534 709
535Emacs cooperates with the X server and the window managers by arranging 710Emacs cooperates with the X server and the window managers by arranging
@@ -583,10 +758,14 @@ change it.
583@cindex iconified frame 758@cindex iconified frame
584@cindex frame visibility 759@cindex frame visibility
585 760
586A frame may be @dfn{visible}, @dfn{invisible}, or @dfn{iconified}. If 761An X windo frame may be @dfn{visible}, @dfn{invisible}, or
587it is visible, you can see its contents. If it is iconified, the 762@dfn{iconified}. If it is visible, you can see its contents. If it is
588frame's contents do not appear on the screen, but an icon does. If the 763iconified, the frame's contents do not appear on the screen, but an icon
589frame is invisible, it doesn't show on the screen, not even as an icon. 764does. If the frame is invisible, it doesn't show on the screen, not
765even as an icon.
766
767Visibility is meaningless for terminal frames, since only the selected
768one is actually displayed in any case.
590 769
591@deffn Command make-frame-visible &optional frame 770@deffn Command make-frame-visible &optional frame
592This function makes frame @var{frame} visible. If you omit @var{frame}, 771This function makes frame @var{frame} visible. If you omit @var{frame},
@@ -613,6 +792,11 @@ This returns the visibility status of frame @var{frame}. The value is
613parameter. You can read or change it as such. @xref{X Frame 792parameter. You can read or change it as such. @xref{X Frame
614Parameters}. 793Parameters}.
615 794
795 The user can iconify and deiconify frames with the window manager.
796This happens below the level at which Emacs can exert any control, but
797Emacs does provide events that you can use to keep track of such
798changes. @xref{Misc Events}.
799
616@node Raising and Lowering 800@node Raising and Lowering
617@section Raising and Lowering Frames 801@section Raising and Lowering Frames
618 802
@@ -634,13 +818,13 @@ screen.
634 818
635You can raise and lower Emacs's X windows with these functions: 819You can raise and lower Emacs's X windows with these functions:
636 820
637@defun raise-frame frame 821@deffn Command raise-frame frame
638This function raises frame @var{frame}. 822This function raises frame @var{frame}.
639@end defun 823@end deffn
640 824
641@defun lower-frame frame 825@deffn Command lower-frame frame
642This function lowers frame @var{frame}. 826This function lowers frame @var{frame}.
643@end defun 827@end deffn
644 828
645@defopt minibuffer-auto-raise 829@defopt minibuffer-auto-raise
646If this is non-@code{nil}, activation of the minibuffer raises the frame 830If this is non-@code{nil}, activation of the minibuffer raises the frame
@@ -771,6 +955,9 @@ characters. These coordinates are not required to be within the frame.
771@node Pop-Up Menus 955@node Pop-Up Menus
772@section Pop-Up Menus 956@section Pop-Up Menus
773 957
958 When using X windows, a Lisp program can pop up a menu which the
959user can choose from with the mouse.
960
774@defun x-popup-menu position menu 961@defun x-popup-menu position menu
775This function displays a pop-up menu and returns an indication of 962This function displays a pop-up menu and returns an indication of
776what selection the user makes. 963what selection the user makes.
@@ -873,8 +1060,8 @@ pop-up menu in the center of the frame.
873@cindex pointer shape 1060@cindex pointer shape
874@cindex mouse pointer shape 1061@cindex mouse pointer shape
875 1062
876 These variables specify which mouse pointer shape to use in various 1063 These variables specify which shape to use for the mouse pointer in
877situations: 1064various situations:
878 1065
879@table @code 1066@table @code
880@item x-pointer-shape 1067@item x-pointer-shape
@@ -1072,68 +1259,74 @@ If you specify them, the key is
1072@section Data about the X Server 1259@section Data about the X Server
1073 1260
1074 This section describes functions and a variable that you can use to 1261 This section describes functions and a variable that you can use to
1075get information about the capabilities and origin of the X server that 1262get information about the capabilities and origin of an X display that
1076Emacs is displaying its frames on. 1263Emacs is using. Each of these functions lets you specify the display
1077 1264you are interested in: the @var{display} argument can be either a
1078@defun x-display-screens 1265display name, or a frame (meaning use the display that frame is on). If
1079This function returns the number of screens associated with the current 1266you omit the @var{display} argument, that means to use the selected
1080display. 1267frame's display.
1268
1269@defun x-display-screens &optional display
1270This function returns the number of screens associated with the display.
1081@end defun 1271@end defun
1082 1272
1083@defun x-server-version 1273@defun x-server-version &optional display
1084This function returns the list of version numbers of the X server in 1274This function returns the list of version numbers of the X server
1085use. 1275running the display.
1086@end defun 1276@end defun
1087 1277
1088@defun x-server-vendor 1278@defun x-server-vendor &optional display
1089This function returns the vendor supporting the X server in use. 1279This function returns the vendor that provided the X server software.
1090@end defun 1280@end defun
1091 1281
1092@defun x-display-pixel-height 1282@defun x-display-pixel-height &optional display
1093This function returns the height of this X screen in pixels. 1283This function returns the height of the screen in pixels.
1094@end defun 1284@end defun
1095 1285
1096@defun x-display-mm-height 1286@defun x-display-mm-height &optional display
1097This function returns the height of this X screen in millimeters. 1287This function returns the height of the screen in millimeters.
1098@end defun 1288@end defun
1099 1289
1100@defun x-display-pixel-width 1290@defun x-display-pixel-width &optional display
1101This function returns the width of this X screen in pixels. 1291This function returns the width of the screen in pixels.
1102@end defun 1292@end defun
1103 1293
1104@defun x-display-mm-width 1294@defun x-display-mm-width &optional display
1105This function returns the width of this X screen in millimeters. 1295This function returns the width of the screen in millimeters.
1106@end defun 1296@end defun
1107 1297
1108@defun x-display-backing-store 1298@defun x-display-backing-store &optional display
1109This function returns the backing store capability of this screen. 1299This function returns the backing store capability of the screen.
1110Values can be the symbols @code{always}, @code{when-mapped}, or 1300Values can be the symbols @code{always}, @code{when-mapped}, or
1111@code{not-useful}. 1301@code{not-useful}.
1112@end defun 1302@end defun
1113 1303
1114@defun x-display-save-under 1304@defun x-display-save-under &optional display
1115This function returns non-@code{nil} if this X screen supports the 1305This function returns non-@code{nil} if the display supports the
1116SaveUnder feature. 1306SaveUnder feature.
1117@end defun 1307@end defun
1118 1308
1119@defun x-display-planes 1309@defun x-display-planes &optional display
1120This function returns the number of planes this display supports. 1310This function returns the number of planes the display supports.
1121@end defun 1311@end defun
1122 1312
1123@defun x-display-visual-class 1313@defun x-display-visual-class &optional display
1124This function returns the visual class for this X screen. The value is 1314This function returns the visual class for the screen. The value is one
1125one of the symbols @code{static-gray}, @code{gray-scale}, 1315of the symbols @code{static-gray}, @code{gray-scale},
1126@code{static-color}, @code{pseudo-color}, @code{true-color}, and 1316@code{static-color}, @code{pseudo-color}, @code{true-color}, and
1127@code{direct-color}. 1317@code{direct-color}.
1128@end defun 1318@end defun
1129 1319
1130@defun x-display-color-p 1320@defun x-display-grayscale-p &optional display
1131This function returns @code{t} if the X screen in use is a color 1321This function returns @code{t} if the screen can display shades of gray.
1132screen. 1322@end defun
1323
1324@defun x-display-color-p &optional display
1325This function returns @code{t} if the screen is a color screen.
1133@end defun 1326@end defun
1134 1327
1135@defun x-display-color-cells 1328@defun x-display-color-cells &optional display
1136This function returns the number of color cells this X screen supports. 1329This function returns the number of color cells the screen supports.
1137@end defun 1330@end defun
1138 1331
1139@ignore 1332@ignore
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index 7cce7ea7a2b..8e09e3e4dfc 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -582,6 +582,21 @@ keymap, if any, overrides all other maps that would have been active,
582except for the current global map. 582except for the current global map.
583@end defvar 583@end defvar
584 584
585@defvar overriding-local-map-menu-flag
586If this variable is non-@code{nil}, the value of
587@code{overriding-local-map} can affect the display of the menu bar. The
588default value is @code{nil}, so @code{overriding-local-map} has no
589effect on the menu bar.
590
591Note that @code{overriding-local-map} does affect the execution of key
592sequences entered using the menu bar, even if it does not affect the
593menu bar display. So if a menu bar key sequence comes in, you should
594clear @code{overriding-local-map} before looking up and executing that
595key sequence. Modes that use @code{overriding-local-map} would
596typically do this anyway; normally they respond to events that they do
597not handle by ``unreading'' them and and exiting.
598@end defvar
599
585@node Key Lookup 600@node Key Lookup
586@section Key Lookup 601@section Key Lookup
587@cindex key lookup 602@cindex key lookup
@@ -913,6 +928,13 @@ containing a single @kbd{C-M-x}. You can also use this escape syntax in
913vectors, as well as others that aren't allowed in strings; one example 928vectors, as well as others that aren't allowed in strings; one example
914is @samp{[?\C-\H-x home]}. @xref{Character Type}. 929is @samp{[?\C-\H-x home]}. @xref{Character Type}.
915 930
931 The key definition and lookup functions accept an alternate syntax for
932event types in a key sequence that is a vector: you can use a list
933containing modifier names plus one base event (a character or function
934key name). For example, @code{(control ?a)} is equivalent to
935@code{?\C-a} and @code{(hyper control left)} is equivalent to
936@code{C-H-left}.
937
916 For the functions below, an error is signaled if @var{keymap} is not a 938 For the functions below, an error is signaled if @var{keymap} is not a
917keymap or if @var{key} is not a string or vector representing a key 939keymap or if @var{key} is not a string or vector representing a key
918sequence. You can use event types (symbols) as shorthand for events 940sequence. You can use event types (symbols) as shorthand for events
@@ -1585,6 +1607,11 @@ that menu bar item, it brings up a single, combined submenu containing
1585all the subcommands of that item---the global subcommands, the local 1607all the subcommands of that item---the global subcommands, the local
1586subcommands, and the minor mode subcommands, all together. 1608subcommands, and the minor mode subcommands, all together.
1587 1609
1610 The variable @code{overriding-local-map} is normally ignored when
1611determining the menu bar contents. That is, the menu bar is computed
1612from the keymaps that would be active if @code{overriding-local-map}
1613were @code{nil}. @xref{Active Keymaps}.
1614
1588 In order for a frame to display a menu bar, its @code{menu-bar-lines} 1615 In order for a frame to display a menu bar, its @code{menu-bar-lines}
1589parameter must be greater than zero. Emacs uses just one line for the 1616parameter must be greater than zero. Emacs uses just one line for the
1590menu bar itself; if you specify more than one line, the other lines 1617menu bar itself; if you specify more than one line, the other lines
diff --git a/lispref/lists.texi b/lispref/lists.texi
index dcb3b8af9d5..55ce93c9547 100644
--- a/lispref/lists.texi
+++ b/lispref/lists.texi
@@ -554,34 +554,14 @@ not a list, the sequence's elements do not become elements of the
554resulting list. Instead, the sequence becomes the final @sc{cdr}, like 554resulting list. Instead, the sequence becomes the final @sc{cdr}, like
555any other non-list final argument. 555any other non-list final argument.
556 556
557Integers are also allowed as arguments to @code{append}. They are 557The @code{append} function also allows integers as arguments. It
558converted to strings of digits making up the decimal print 558converts them to strings of digits, making up the decimal print
559representation of the integer, and these strings are then appended. 559representation of the integer, and then uses the strings instead of the
560Here's what happens: 560original integers. @strong{Don't use this feature; we plan to eliminate
561 561it. If you already use this feature, change your programs now!} The
562@example 562proper way to convert an integer to a decimal number in this way is with
563@group 563@code{format} (@pxref{Formatting Strings}) or @code{number-to-string}
564(setq trees '(pine oak)) 564(@pxref{String Conversion}).
565 @result{} (pine oak)
566@end group
567@group
568(char-to-string 54)
569 @result{} "6"
570@end group
571@group
572(setq longer-list (append trees 6 '(spruce)))
573 @result{} (pine oak 54 spruce)
574@end group
575@group
576(setq x-list (append trees 6 6))
577 @result{} (pine oak 54 . 6)
578@end group
579@end example
580
581This special case exists for compatibility with Mocklisp, and we don't
582recommend you take advantage of it. If you want to convert an integer
583in this way, use @code{format} (@pxref{Formatting Strings}) or
584@code{number-to-string} (@pxref{String Conversion}).
585@end defun 565@end defun
586 566
587@defun reverse list 567@defun reverse list
@@ -1303,6 +1283,16 @@ Here is another example, in which the keys and values are not symbols:
1303@end smallexample 1283@end smallexample
1304@end defun 1284@end defun
1305 1285
1286@defun rassoc value alist
1287This function returns the first association with value @var{value} in
1288@var{alist}. It returns @code{nil} if no association in @var{alist} has
1289a @sc{cdr} @code{equal} to @var{value}.
1290
1291@code{rassoc} is like @code{assoc} except that it compares the @sc{cdr} of
1292each @var{alist} association instead of the @sc{car}. You can think of
1293this as ``reverse @code{assoc}'', finding the key for a given value.
1294@end defun
1295
1306@defun assq key alist 1296@defun assq key alist
1307This function is like @code{assoc} in that it returns the first 1297This function is like @code{assoc} in that it returns the first
1308association for @var{key} in @var{alist}, but it makes the comparison 1298association for @var{key} in @var{alist}, but it makes the comparison
diff --git a/lispref/loading.texi b/lispref/loading.texi
index 8254107e710..645ada83976 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -101,6 +101,10 @@ error @code{file-error} (with @samp{Cannot open load file
101@var{filename}}). But if @var{missing-ok} is non-@code{nil}, then 101@var{filename}}). But if @var{missing-ok} is non-@code{nil}, then
102@code{load} just returns @code{nil}. 102@code{load} just returns @code{nil}.
103 103
104You can use the variable @code{load-read-function} to specify a function
105for @code{load} to use instead of @code{read} for reading expressions.
106See below.
107
104@code{load} returns @code{t} if the file loads successfully. 108@code{load} returns @code{t} if the file loads successfully.
105@end defun 109@end defun
106 110
@@ -193,6 +197,15 @@ file, and it is @code{nil} otherwise. This is how @code{defun} and
193effect can be undone if the load fails. 197effect can be undone if the load fails.
194@end defvar 198@end defvar
195 199
200@defvar load-read-function
201This variable specifies an alternate expression-reading function for
202@code{load} and @code{eval-region} to use instead of @code{read}.
203The function should accept one argument, just as @code{read} does.
204
205Normally, the variable's value is @code{nil}, which means those
206functions should use @code{read}.
207@end defvar
208
196 To learn how @code{load} is used to build Emacs, see @ref{Building Emacs}. 209 To learn how @code{load} is used to build Emacs, see @ref{Building Emacs}.
197 210
198@node Autoload 211@node Autoload
@@ -326,7 +339,6 @@ convention used only in the preloaded Lisp files such as
326documentation string in the @file{etc/DOC} file. @xref{Building Emacs}. 339documentation string in the @file{etc/DOC} file. @xref{Building Emacs}.
327 340
328@node Repeated Loading 341@node Repeated Loading
329@comment node-name, next, previous, up
330@section Repeated Loading 342@section Repeated Loading
331@cindex repeated loading 343@cindex repeated loading
332 344
diff --git a/lispref/macros.texi b/lispref/macros.texi
index 71dc82f9e54..c5cf625c8c7 100644
--- a/lispref/macros.texi
+++ b/lispref/macros.texi
@@ -203,6 +203,7 @@ called interactively.
203@section Backquote 203@section Backquote
204@cindex backquote (list substitution) 204@cindex backquote (list substitution)
205@cindex ` (list substitution) 205@cindex ` (list substitution)
206@findex `
206 207
207 Macros often need to construct large list structures from a mixture of 208 Macros often need to construct large list structures from a mixture of
208constants and nonconstant parts. To make this easier, use the macro 209constants and nonconstant parts. To make this easier, use the macro
@@ -215,11 +216,11 @@ two forms yield identical results:
215 216
216@example 217@example
217@group 218@group
218(` (a list of (+ 2 3) elements)) 219`(a list of (+ 2 3) elements)
219 @result{} (a list of (+ 2 3) elements) 220 @result{} (a list of (+ 2 3) elements)
220@end group 221@end group
221@group 222@group
222(quote (a list of (+ 2 3) elements)) 223'(a list of (+ 2 3) elements)
223 @result{} (a list of (+ 2 3) elements) 224 @result{} (a list of (+ 2 3) elements)
224@end group 225@end group
225@end example 226@end example
@@ -235,7 +236,7 @@ argument of @code{,} and puts the value in the list structure:
235 @result{} (a list of 5 elements) 236 @result{} (a list of 5 elements)
236@end group 237@end group
237@group 238@group
238(` (a list of (, (+ 2 3)) elements)) 239`(a list of ,(+ 2 3) elements)
239 @result{} (a list of 5 elements) 240 @result{} (a list of 5 elements)
240@end group 241@end group
241@end example 242@end example
@@ -258,7 +259,7 @@ Here are some examples:
258 @result{} (1 2 3 4 2 3) 259 @result{} (1 2 3 4 2 3)
259@end group 260@end group
260@group 261@group
261(` (1 (,@@ some-list) 4 (,@@ some-list))) 262`(1 ,@@some-list 4 ,@@some-list)
262 @result{} (1 2 3 4 2 3) 263 @result{} (1 2 3 4 2 3)
263@end group 264@end group
264 265
@@ -273,57 +274,22 @@ Here are some examples:
273 @result{} (use the words foo bar as elements) 274 @result{} (use the words foo bar as elements)
274@end group 275@end group
275@group 276@group
276(` (use the words (,@@ (cdr list)) as elements)) 277`(use the words ,@@(cdr list) as elements)
277 @result{} (use the words foo bar as elements) 278 @result{} (use the words foo bar as elements)
278@end group 279@end group
279@end example 280@end example
280 281
281Emacs 18 had a bug that made the previous example fail. The bug
282affected @code{,@@} followed only by constant elements. If you are
283concerned with Emacs 18 compatibility, you can work around the bug like
284this:
285
286@example
287(` (use the words (,@@ (cdr list)) as elements @code{(,@@ nil)}))
288@end example
289
290@noindent
291@code{(,@@ nil)} avoids the problem by being a nonconstant element that
292does not affect the result.
293
294@defmac ` list
295This macro quotes @var{list} except for any sublists of the form
296@code{(, @var{subexp})} or @code{(,@@ @var{listexp})}. Backquote
297replaces these sublists with the value of @var{subexp} (as a single
298element) or @var{listexp} (by splicing). Backquote copies the structure
299of @var{list} down to the places where variable parts are substituted.
300
301@ignore @c these work now!
302There are certain contexts in which @samp{,} would not be recognized and
303should not be used:
304
305@smallexample
306@group
307;; @r{Use of a @samp{,} expression as the @sc{cdr} of a list.}
308(` (a . (, 1))) ; @r{Not @code{(a . 1)}}
309 @result{} (a \, 1)
310@end group
311
312@group
313;; @r{Use of @samp{,} in a vector.}
314(` [a (, 1) c]) ; @r{Not @code{[a 1 c]}}
315 @error{} Wrong type argument
316@end group
317@end smallexample
318@end ignore
319@end defmac
320
321@cindex CL note---@samp{,}, @samp{,@@} as functions
322@quotation 282@quotation
323@b{Common Lisp note:} In Common Lisp, @samp{,} and @samp{,@@} are 283Before Emacs version 19.29, @code{`} used a different syntax which
324implemented as reader macros, so they do not require parentheses. In 284required an extra level of parentheses around the entire backquote
325Emacs Lisp they use function call syntax because reader macros are not 285construct. Likewise, each @code{,} or @code{,@@} substition required an
326supported (for simplicity's sake). 286extra level of parentheses surrounding both the @code{,} or @code{,@@}
287and the following expression. The old syntax required whitespace
288between the @code{`}, @code{,} or @code{,@@} and the following
289expression.
290
291This syntax is still accepted, but no longer recommended except for
292compatibility with old Emacs versions.
327@end quotation 293@end quotation
328 294
329@node Problems with Macros 295@node Problems with Macros
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index fa78ec1f8bd..10dc146535e 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -554,7 +554,7 @@ too short). Both of those begin with the string @samp{foobar}.
554@end smallexample 554@end smallexample
555@end defun 555@end defun
556 556
557@defun all-completions string collection &optional predicate 557@defun all-completions string collection &optional predicate nospace
558This function returns a list of all possible completions of 558This function returns a list of all possible completions of
559@var{string}. The parameters to this function are the same as to 559@var{string}. The parameters to this function are the same as to
560@code{try-completion}. 560@code{try-completion}.
@@ -563,6 +563,9 @@ If @var{collection} is a function, it is called with three arguments:
563@var{string}, @var{predicate} and @code{t}; then @code{all-completions} 563@var{string}, @var{predicate} and @code{t}; then @code{all-completions}
564returns whatever the function returns. @xref{Programmed Completion}. 564returns whatever the function returns. @xref{Programmed Completion}.
565 565
566If @var{nospace} is non-@code{nil}, completions that start with a space
567are ignored unless @var{string} also starts with a space.
568
566Here is an example, using the function @code{test} shown in the 569Here is an example, using the function @code{test} shown in the
567example for @code{try-completion}: 570example for @code{try-completion}:
568 571
@@ -1369,12 +1372,17 @@ The current value of this variable is used to rebind @code{help-form}
1369locally inside the minibuffer (@pxref{Help Functions}). 1372locally inside the minibuffer (@pxref{Help Functions}).
1370@end defvar 1373@end defvar
1371 1374
1375@defun active-minibuffer-window
1376This function returns the currently active minibuffer window, or
1377@code{nil} if none is currently active.
1378@end defun
1379
1372@defun minibuffer-window &optional frame 1380@defun minibuffer-window &optional frame
1373This function returns the window that is used for the minibuffer. In 1381This function returns the minibuffer window used for frame @var{frame}.
1374Emacs 18, there is one and only one minibuffer window; this window 1382If @var{frame} is @code{nil}, that stands for the current frame. Note
1375always exists and cannot be deleted. In Emacs 19, each frame can have 1383that the minibuffer window used by a frame need not be part of that
1376its own minibuffer, and this function returns the minibuffer window used 1384frame---a frame that has no minibuffer of its own necessarily uses some
1377for frame @var{frame} (which defaults to the currently selected frame). 1385other frame's minibuffer window.
1378@end defun 1386@end defun
1379 1387
1380@c Emacs 19 feature 1388@c Emacs 19 feature
diff --git a/lispref/modes.texi b/lispref/modes.texi
index b0b8263200a..1927797080b 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -547,6 +547,16 @@ those such as Dired and Rmail that are useful only with text that has
547been specially prepared. 547been specially prepared.
548@end defopt 548@end defopt
549 549
550@defun set-buffer-major-mode buffer
551This function sets the major mode of @var{buffer} to the value of
552@code{default-major-mode}. If that variable is @code{nil}, it uses
553the current buffer's major mode (if that is suitable).
554
555The low-level primitives for creating buffers do not use this function,
556but medium-level commands such as @code{switch-to-buffer} should use it
557whenever they create buffers.
558@end defun
559
550@defvar initial-major-mode 560@defvar initial-major-mode
551@cindex @samp{*scratch*} 561@cindex @samp{*scratch*}
552The value of this variable determines the major mode of the initial 562The value of this variable determines the major mode of the initial
@@ -929,7 +939,8 @@ Force redisplay of the current buffer's mode line.
929strings, symbols, and numbers kept in the buffer-local variable 939strings, symbols, and numbers kept in the buffer-local variable
930@code{mode-line-format}. The data structure is called a @dfn{mode line 940@code{mode-line-format}. The data structure is called a @dfn{mode line
931construct}, and it is built in recursive fashion out of simpler mode line 941construct}, and it is built in recursive fashion out of simpler mode line
932constructs. 942constructs. The same data structure is used for constructing
943frame titles (pxref{Frame Titles}).
933 944
934@defvar mode-line-format 945@defvar mode-line-format
935The value of this variable is a mode line construct with overall 946The value of this variable is a mode line construct with overall
@@ -1177,20 +1188,39 @@ The current buffer name, obtained with the @code{buffer-name} function.
1177The visited file name, obtained with the @code{buffer-file-name} 1188The visited file name, obtained with the @code{buffer-file-name}
1178function. @xref{Buffer File Name}. 1189function. @xref{Buffer File Name}.
1179 1190
1191@item %F
1192The name of the selected frame.
1193
1194@item %c
1195The current column number of point.
1196
1197@item %l
1198The current line number of point.
1199
1180@item %* 1200@item %*
1181@samp{%} if the buffer is read only (see @code{buffer-read-only}); @* 1201@samp{%} if the buffer is read only (see @code{buffer-read-only}); @*
1182@samp{*} if the buffer is modified (see @code{buffer-modified-p}); @* 1202@samp{*} if the buffer is modified (see @code{buffer-modified-p}); @*
1183@samp{-} otherwise. @xref{Buffer Modification}. 1203@samp{-} otherwise. @xref{Buffer Modification}.
1184 1204
1185@item %+ 1205@item %+
1206@samp{*} if the buffer is modified (see @code{buffer-modified-p}); @*
1207@samp{%} if the buffer is read only (see @code{buffer-read-only}); @*
1208@samp{-} otherwise. This differs from @samp{%*} only for a modified
1209read-only buffer. @xref{Buffer Modification}.
1210
1211@item %&
1186@samp{*} if the buffer is modified, and @samp{-} otherwise. 1212@samp{*} if the buffer is modified, and @samp{-} otherwise.
1187 1213
1188@item %s 1214@item %s
1189The status of the subprocess belonging to the current buffer, obtained with 1215The status of the subprocess belonging to the current buffer, obtained with
1190@code{process-status}. @xref{Process Information}. 1216@code{process-status}. @xref{Process Information}.
1191 1217
1218@item %t
1219Whether the visited file is a text file or a binary file. (This is a
1220meaningful distinction only on certain operating systems.)
1221
1192@item %p 1222@item %p
1193The percent of the buffer above the @strong{top} of window, or 1223The percentage of the buffer text above the @strong{top} of window, or
1194@samp{Top}, @samp{Bottom} or @samp{All}. 1224@samp{Top}, @samp{Bottom} or @samp{All}.
1195 1225
1196@item %P 1226@item %P
@@ -1353,7 +1383,7 @@ For example, here's how @code{emacs-lisp-hooks} runs its mode hook:
1353@end example 1383@end example
1354@end defun 1384@end defun
1355 1385
1356@defun add-hook hook function &optional append 1386@defun add-hook hook function &optional append local
1357This function is the handy way to add function @var{function} to hook 1387This function is the handy way to add function @var{function} to hook
1358variable @var{hook}. The argument @var{function} may be any valid Lisp 1388variable @var{hook}. The argument @var{function} may be any valid Lisp
1359function with the proper number of arguments. For example, 1389function with the proper number of arguments. For example,
@@ -1376,27 +1406,29 @@ executed first (barring another @code{add-hook} call).
1376 1406
1377If the optional argument @var{append} is non-@code{nil}, the new hook 1407If the optional argument @var{append} is non-@code{nil}, the new hook
1378function goes at the end of the hook list and will be executed last. 1408function goes at the end of the hook list and will be executed last.
1409
1410If @var{local} is non-@code{nil}, that says to make the new hook
1411function local to the current buffer. Before you can do this, you must
1412make the hook itself buffer-local by calling @code{make-local-hook}
1413(@strong{not} @code{make-local-variable}). If the hook itself is not
1414buffer-local, then the value of @var{local} makes no difference---the
1415hook function is always global.
1379@end defun 1416@end defun
1380 1417
1381@defun remove-hook hook function 1418@defun remove-hook hook function &optional local
1382This function removes @var{function} from the hook variable @var{hook}. 1419This function removes @var{function} from the hook variable @var{hook}.
1383@end defun
1384 1420
1385@ignore @c Should no longer be necessary 1421If @var{local} is non-@code{nil}, that says to remove @var{function}
1386If you make a hook variable buffer-local, copy its value before you use 1422from the local hook list instead of from the global hook list. If the
1387@code{add-hook} or @code{remove-hook} to change it. For example, 1423hook itself is not buffer-local, then the value of @var{local} makes no
1424difference.
1425@end defun
1388 1426
1389@example 1427@defun make-local-hook hook
1390(defun my-major-mode () 1428This function makes the hook variable @code{hook} local to the current
1391 @dots{} 1429buffer. When a hook variable is local, it can have local and global
1392 (make-local-variable 'foo-hook) 1430hook functions, and @code{run-hooks} runs all of them.
1393 (if (boundp 'foo-hook)
1394 (setq foo-hook (copy-sequence foo-hook)))
1395 (add-hook 'foo-hook 'my-foo-function)"
1396 @dots{}
1397 )
1398@end example
1399 1431
1400Otherwise you may accidentally alter the list structure that forms part 1432Do not use @code{make-local-variable} directly for hook variables; it is
1401of the global value of the hook variable. 1433not sufficient.
1402@end ignore 1434@end defun
diff --git a/lispref/numbers.texi b/lispref/numbers.texi
index b3226c0f1cd..0c331545e1d 100644
--- a/lispref/numbers.texi
+++ b/lispref/numbers.texi
@@ -372,8 +372,8 @@ commonly used.
372if any argument is floating. 372if any argument is floating.
373 373
374 It is important to note that in GNU Emacs Lisp, arithmetic functions 374 It is important to note that in GNU Emacs Lisp, arithmetic functions
375do not check for overflow. Thus @code{(1+ 8388607)} may evaluate to 375do not check for overflow. Thus @code{(1+ 134217727)} may evaluate to
376@minus{}8388608, depending on your hardware. 376@minus{}134217728, depending on your hardware.
377 377
378@defun 1+ number-or-marker 378@defun 1+ number-or-marker
379This function returns @var{number-or-marker} plus 1. 379This function returns @var{number-or-marker} plus 1.
@@ -642,11 +642,11 @@ number.
642 642
643The function @code{lsh}, like all Emacs Lisp arithmetic functions, does 643The function @code{lsh}, like all Emacs Lisp arithmetic functions, does
644not check for overflow, so shifting left can discard significant bits 644not check for overflow, so shifting left can discard significant bits
645and change the sign of the number. For example, left shifting 8,388,607 645and change the sign of the number. For example, left shifting
646produces @minus{}2 on a 24-bit machine: 646134,217,727 produces @minus{}2 on a 28-bit machine:
647 647
648@example 648@example
649(lsh 8388607 1) ; @r{left shift} 649(lsh 134217727 1) ; @r{left shift}
650 @result{} -2 650 @result{} -2
651@end example 651@end example
652 652
@@ -1009,8 +1009,17 @@ This function returns a pseudo-random integer. Repeated calls return a
1009series of pseudo-random integers. 1009series of pseudo-random integers.
1010 1010
1011If @var{limit} is @code{nil}, then the value may in principle be any 1011If @var{limit} is @code{nil}, then the value may in principle be any
1012integer. If @var{limit} is a positive integer, the value is chosen to 1012integer. However, on machines where integers have more than 32 bits,
1013be nonnegative and less than @var{limit} (only in Emacs 19). 1013the possible values may be limited to the interval
1014@tex
1015$[0,2^{32})$.
1016@end tex
1017@ifinfo
1018[0,2**32).
1019@end ifinfo
1020
1021If @var{limit} is a positive integer, the value is chosen to be
1022nonnegative and less than @var{limit} (only in Emacs 19).
1014 1023
1015If @var{limit} is @code{t}, it means to choose a new seed based on the 1024If @var{limit} is @code{t}, it means to choose a new seed based on the
1016current time of day and on Emacs's process @sc{id} number. 1025current time of day and on Emacs's process @sc{id} number.
diff --git a/lispref/objects.texi b/lispref/objects.texi
index 5d9762ee268..fc06466112c 100644
--- a/lispref/objects.texi
+++ b/lispref/objects.texi
@@ -1229,11 +1229,34 @@ pass an argument to @code{+} that it cannot handle:
1229 1229
1230@cindex type predicates 1230@cindex type predicates
1231@cindex testing types 1231@cindex testing types
1232 Lisp provides functions, called @dfn{type predicates}, to test whether 1232 If you want your program to handle different types differently, you
1233an object is a member of a given type. (Following a convention of long 1233must do explicit type checking. The most common way to check the type
1234standing, the names of most Emacs Lisp predicates end in @samp{p}.) 1234of an object is to call a @dfn{type predicate} function. Emacs has a
1235type predicate for each type, as well as some predicates for
1236combinations of types.
1235 1237
1236Here is a table of predefined type predicates, in alphabetical order, 1238 A type predicate function takes one argument; it returns @code{t} if
1239the argument belongs to the appropriate type, and @code{nil} otherwise.
1240Following a general Lisp convention for predicate functions, most type
1241predicates' names end with @samp{p}.
1242
1243 Here is an example which uses the predicates @code{listp} to check for
1244a list and @code{symbolp} to check for a symbol.
1245
1246@example
1247(defun add-on (x)
1248 (cond ((symbolp x)
1249 ;; If X is a symbol, put it on LIST.
1250 (setq list (cons x list)))
1251 ((listp x)
1252 ;; If X is a list, add its elements to LIST.
1253 (setq list (append x list)))
1254 (t
1255 ;; We only handle symbols and lists.
1256 (error "Invalid argument %s in add-on" x))))
1257@end example
1258
1259 Here is a table of predefined type predicates, in alphabetical order,
1237with references to further information. 1260with references to further information.
1238 1261
1239@table @code 1262@table @code
@@ -1334,6 +1357,33 @@ with references to further information.
1334@xref{Basic Windows, windowp}. 1357@xref{Basic Windows, windowp}.
1335@end table 1358@end table
1336 1359
1360 The most general way to check the type of an object is to call the
1361function @code{type-of}. Recall that each object belongs to one and
1362only one primitive type; @code{type-of} tells you which one (@pxref{Lisp
1363Data Types}). But @code{type-of} knows nothing about non-primitive
1364types. In most cases, it is more convenient to use type predicates than
1365@code{type-of}.
1366
1367@defun type-of object
1368This function returns a symbol naming the primitive type of
1369@var{object}. The value is one of @code{symbol}, @code{integer},
1370@code{float}, @code{string}, @code{cons}, @code{vector}, @code{marker},
1371@code{overlay}, @code{window}, @code{buffer}, @code{subr},
1372@code{compiled-function}, @code{window-configuration}, or
1373@code{process}.
1374
1375@example
1376(type-of 1)
1377 @result{} integer
1378(type-of 'nil)
1379 @result{} symbol
1380(type-of '()) ; @r{@code{()} is @code{nil}.}
1381 @result{} symbol
1382(type-of '(x))
1383 @result{} cons
1384@end example
1385@end defun
1386
1337@node Equality Predicates 1387@node Equality Predicates
1338@section Equality Predicates 1388@section Equality Predicates
1339@cindex equality 1389@cindex equality
@@ -1460,7 +1510,10 @@ arguments to see if their elements are the same. So, if two objects are
1460@end group 1510@end group
1461@end example 1511@end example
1462 1512
1463Comparison of strings uses @code{string=}, and is case-sensitive. 1513Comparison of strings is case-sensitive and takes account of text
1514properties as well as the characters in the strings. To compare
1515two strings' characters without comparing their text properties,
1516use @code{string=} (@pxref{Text Comparison}).
1464 1517
1465@example 1518@example
1466@group 1519@group
diff --git a/lispref/os.texi b/lispref/os.texi
index e7b7b076e08..e39c6ca752c 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -20,6 +20,8 @@ pertaining to the terminal and the screen.
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* Time of Day:: Getting the current time. 22* Time of Day:: Getting the current time.
23* Time Conversion:: Converting a time from numeric form to a string, or
24 to calendrical data (or vice versa).
23* Timers:: Setting a timer to call a function at a certain time. 25* Timers:: Setting a timer to call a function at a certain time.
24* Terminal Input:: Recording terminal input for debugging. 26* Terminal Input:: Recording terminal input for debugging.
25* Terminal Output:: Recording terminal output for debugging. 27* Terminal Output:: Recording terminal output for debugging.
@@ -598,6 +600,23 @@ This function returns the name of the machine you are running on.
598@end example 600@end example
599@end defun 601@end defun
600 602
603@vindex system-name
604 The symbol @code{system-name} is a variable as well as a function. In
605fact, the function returns whatever value the variable
606@code{system-name} currently holds. Thus, you can set the variable
607@code{system-name} in case Emacs is confused about the name of your
608system. The variable is also useful for constructing frame titles
609(@pxref{Frame Titles}).
610
611@defvar mail-host-address
612If this variable is non-@code{nil}, it is used instead of
613@code{system-name} for purposes of generating email addresses. For
614example, it is used when constructing the default value of
615@code{user-mail-address}. @xref{User Identification}. (Since this is
616done when Emacs starts up, the value actually used is the one saved when
617Emacs was dumped. @xref{Building Emacs}.)
618@end defvar
619
601@defun getenv var 620@defun getenv var
602@cindex environment variable access 621@cindex environment variable access
603This function returns the value of the environment variable @var{var}, 622This function returns the value of the environment variable @var{var},
@@ -631,6 +650,13 @@ function works by modifying @code{process-environment}; binding that
631variable with @code{let} is also reasonable practice. 650variable with @code{let} is also reasonable practice.
632@end deffn 651@end deffn
633 652
653@defvar path-separator
654This variable holds a string which says which character separates
655directories in a search path (as found in an environment variable). Its
656value is @code{":"} for Unix and GNU systems, and @code{";"} for MS-DOS
657and Windows NT.
658@end defvar
659
634@defvar process-environment 660@defvar process-environment
635This variable is a list of strings, each describing one environment 661This variable is a list of strings, each describing one environment
636variable. The functions @code{getenv} and @code{setenv} work by means 662variable. The functions @code{getenv} and @code{setenv} work by means
@@ -708,12 +734,21 @@ indicating whether the privilege is currently enabled.
708@node User Identification 734@node User Identification
709@section User Identification 735@section User Identification
710 736
711@defun user-login-name 737@defvar user-mail-address
712This function returns the name under which the user is logged in. If 738This holds the nominal email address of the user who is using Emacs.
713the environment variable @code{LOGNAME} is set, that value is used. 739When Emacs starts up, it computes a default value that is usually right,
714Otherwise, if the environment variable @code{USER} is set, that value is 740but users often set this themselves when the default value is not right.
715used. Otherwise, the value is based on the effective @sc{uid}, not the 741@end defvar
716real @sc{uid}. 742
743@defun user-login-name &optional uid
744If you don't specify @var{uid}, this function returns the name under
745which the user is logged in. If the environment variable @code{LOGNAME}
746is set, that value is used. Otherwise, if the environment variable
747@code{USER} is set, that value is used. Otherwise, the value is based
748on the effective @sc{uid}, not the real @sc{uid}.
749
750If you specify @var{uid}, the value is the user name that corresponds
751to @var{uid} (which should be an integer).
717 752
718@example 753@example
719@group 754@group
@@ -740,6 +775,28 @@ This function returns the full name of the user.
740@end example 775@end example
741@end defun 776@end defun
742 777
778@vindex user-full-name
779@vindex user-real-login-name
780@vindex user-login-name
781 The symbols @code{user-login-name}, @code{user-real-login-name} and
782@code{user-full-name} are variables as well as functions. The functions
783return the same values that the variables hold. These variables allow
784you to ``fake out'' Emacs by telling the functions what to return. The
785variables are also useful for constructing frame titles (@pxref{Frame
786Titles}).
787
788@defvar user-real-login-name
789This variable holds the same value that the function
790@code{user-real-login-name} returns. The variable lets you alter the value;
791also, you can use variables for constructing frame titles.
792@end defvar
793
794@defvar user-full-name
795This variable holds the same value that the function
796@code{user-full-name} returns. The variable lets you alter the value;
797also, you can use variables for constructing frame titles.
798@end defvar
799
743@defun user-real-uid 800@defun user-real-uid
744This function returns the real @sc{uid} of the user. 801This function returns the real @sc{uid} of the user.
745 802
@@ -825,7 +882,149 @@ The argument @var{time-value}, if given, specifies a time to analyze
825instead of the current time. The argument should be a cons cell 882instead of the current time. The argument should be a cons cell
826containing two integers, or a list whose first two elements are 883containing two integers, or a list whose first two elements are
827integers. Thus, you can use times obtained from @code{current-time} 884integers. Thus, you can use times obtained from @code{current-time}
828(see below) and from @code{file-attributes} (@pxref{File Attributes}). 885(see above) and from @code{file-attributes} (@pxref{File Attributes}).
886@end defun
887
888@node Time Conversion
889@section Time Conversion
890
891 These functions convert time values (lists of two or three integers)
892to strings or to calendrical information. There is also a function to
893convert calendrical information to a time value. You can get time
894values from the functions @code{current-time} (@pxref{Time of Day}) and
895@code{file-attributes} (@pxref{File Attributes}).
896
897@defun format-time-string format-string time
898This function converts @var{time} to a string according to
899@var{format-string}. The argument @var{format-string} may contain
900@samp{%}-sequences which say to substitute parts of the time. Here is a
901table of what the @samp{%}-sequences mean:
902
903@table @samp
904@item %a
905This stands for the abbreviated name of the day of week.
906@item %A
907This stands for the full name of the day of week.
908@item %b
909This stands for the abbreviated name of the month.
910@item %B
911This stands for the full name of the month.
912@item %c
913This is a synonym for @samp{%x %X}.
914@item %C
915This has a locale-specific meaning. In the C locale, it is equivalent
916to @samp{%A, %B %e, %Y}.
917@item %d
918This stands for the day of month, zero-padded.
919@item %D
920This is a synonym for @samp{%m/%d/%y}.
921@item %e
922This stands for the day of month, blank-padded.
923@item %h
924This is a synonym for @samp{%b}.
925@item %H
926This stands for the hour (00-23).
927@item %I
928This stands for the hour (00-12).
929@item %j
930This stands for the day of the year (001-366).
931@item %k
932This stands for the hour (0-23), blank padded.
933@item %l
934This stands for the hour (1-12), blank padded.
935@item %m
936This stands for the month (01-12).
937@item %M
938This stands for the minute (00-59).
939@item %n
940This stands for a newline.
941@item %p
942This stands for @samp{AM} or @samp{PM}, as appropriate.
943@item %r
944This is a synonym for @samp{%I:%M:%S %p}.
945@item %R
946This is a synonym for @samp{%H:%M}.
947@item %S
948This stands for the seconds (00-60).
949@item %t
950This stands for a tab character.
951@item %T
952This is a synonym for @samp{%H:%M:%S}.
953@item %U
954This stands for the week of the year (01-52), assuming that weeks
955start on Sunday.
956@item %w
957This stands for the numeric day of week (0-6). Sunday is day 0.
958@item %W
959This stands for the week of the year (01-52), assuming that weeks
960start on Monday.
961@item %x
962This has a locale-specific meaning. In the C locale, it is equivalent
963to @samp{%D}.
964@item %X
965This has a locale-specific meaning. In the C locale, it is equivalent
966to @samp{%T}.
967@item %y
968This stands for the year without century (00-99).
969@item %Y
970This stands for the year with century.
971@item %Z
972This stands for the time zone abbreviation.
973@end table
974@end defun
975
976@defun decode-time time
977This function converts a time value into calendrical form. The return
978value is a list of nine elements, as follows:
979
980@example
981(@var{seconds} @var{minutes} @var{hour} @var{day} @var{month} @var{year} @var{dow} @var{dst} @var{zone})
982@end example
983
984Here is what the elements mean:
985
986@table @var
987@item sec
988The number of seconds past the minute, as an integer between 0 and 59.
989@item minute
990The number of minutes past the hour, as an integer between 0 and 59.
991@item hour
992The hour of the day, as an integer between 0 and 23.
993@item day
994The day of the month, as an integer between 1 and 31.
995@item month
996The month of the year, as an integer between 1 and 12.
997@item year
998The year, an integer typically greater than 1900.
999@item dow
1000The day of week, as an integer between 0 and 6, where 0 stands for
1001Sunday.
1002@item dst
1003@code{t} if daylight savings time is effect, otherwise @code{nil}.
1004@item zone
1005An integer indicating the number of seconds east of Greenwich.
1006@end table
1007
1008Note that Common Lisp has different meanings for @var{dow} and
1009@var{zone}.
1010@end defun
1011
1012@defun encode-time seconds minutes hour day month year &optional zone
1013This function is the inverse of @code{decode-time}. It converts seven
1014items of calendrical data into a time value.
1015
1016For the meanings of the arguments, see the table above under
1017@code{decode-time}.
1018
1019Year numbers less than 100 are treated just like other year numbers. If
1020you them to stand for years above 1900, you must alter them yourself
1021before you call @code{encode-time}.
1022
1023The optional argument @var{zone} defaults to the current time zone and
1024its daylight savings time rules. If specified, it can be either a list
1025(as you would get from @code{current-time-zone}) or an integer (as you
1026would get from @code{decode-time}). The specified zone is used without
1027any further alteration for daylight savings time.
829@end defun 1028@end defun
830 1029
831@node Timers 1030@node Timers
@@ -1271,6 +1470,9 @@ by HP X servers whose numeric code is (1 << 28) + 168.
1271It is not a problem if the alist defines keysyms for other X servers, as 1470It is not a problem if the alist defines keysyms for other X servers, as
1272long as they don't conflict with the ones used by the X server actually 1471long as they don't conflict with the ones used by the X server actually
1273in use. 1472in use.
1473
1474The variable is always local to the current X terminal and cannot be
1475buffer-local. @xref{Multiple Displays}.
1274@end defvar 1476@end defvar
1275 1477
1276@node Flow Control 1478@node Flow Control
diff --git a/lispref/processes.texi b/lispref/processes.texi
index e71d7efeaaf..a089ba0994d 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -148,23 +148,52 @@ user types another @kbd{C-g}, that kills the subprocess instantly with
14818. In version 19, they return an indication of how the process 14818. In version 19, they return an indication of how the process
149terminated. 149terminated.
150 150
151@defun call-process program &optional infile buffer-or-name display &rest args 151@defun call-process program &optional infile destination display &rest args
152This function calls @var{program} in a separate process and waits for 152This function calls @var{program} in a separate process and waits for
153it to finish. 153it to finish.
154 154
155The standard input for the process comes from file @var{infile} if 155The standard input for the process comes from file @var{infile} if
156@var{infile} is not @code{nil} and from @file{/dev/null} otherwise. The 156@var{infile} is not @code{nil} and from @file{/dev/null} otherwise.
157process output gets inserted in buffer @var{buffer-or-name} before point, 157The argument @var{destination} says where to put the process output.
158if that argument names a buffer. If @var{buffer-or-name} is @code{t}, 158Here are the possibilities:
159output is sent to the current buffer; if @var{buffer-or-name} is 159
160@code{nil}, output is discarded. 160@table @asis
161 161@item a buffer
162If @var{buffer-or-name} is the integer 0, @code{call-process} returns 162Insert the output in that buffer, before point. This includes both the
163@code{nil} immediately and discards any output. In this case, the 163standard output stream and the standard error stream of the process.
164process is not truly synchronous, since it can run in parallel with 164
165Emacs; but you can think of it as synchronous in that Emacs is 165@item a string
166essentially finished with the subprocess as soon as this function 166Find or create a buffer with that name, then insert
167returns. 167the output in that buffer, before point.
168
169@item @code{t}
170Insert the output in the current buffer, before point.
171
172@item @code{nil}
173Discard the output.
174
175@item 0
176Discard the output, and return immediately without waiting
177for the subprocess to finish.
178
179In this case, the process is not truly synchronous, since it can run in
180parallel with Emacs; but you can think of it as synchronous in that
181Emacs is essentially finished with the subprocess as soon as this
182function returns.
183
184@item (@var{real-destination} @var{error-destination})
185Keep the standard output stream separate from the standard error stream;
186deal with the ordinary output as specified by @var{real-destination},
187and dispose of the error output according to @var{error-destination}.
188The value @code{nil} means discard it, @code{t} means mix it with the
189ordinary output, and a string specifies a file name to redirect error
190output into.
191
192You can't directly specify a buffer to put the error output in; that is
193too difficult to implement. But you can achieve this result by sending
194the error output to a temporary file and then inserting the file into a
195buffer.
196@end table
168 197
169If @var{display} is non-@code{nil}, then @code{call-process} redisplays 198If @var{display} is non-@code{nil}, then @code{call-process} redisplays
170the buffer as output is inserted. Otherwise the function does no 199the buffer as output is inserted. Otherwise the function does no
@@ -216,16 +245,16 @@ of @code{call-process}:
216@end smallexample 245@end smallexample
217@end defun 246@end defun
218 247
219@defun call-process-region start end program &optional delete buffer-or-name display &rest args 248@defun call-process-region start end program &optional delete destination display &rest args
220This function sends the text between @var{start} to @var{end} as 249This function sends the text between @var{start} to @var{end} as
221standard input to a process running @var{program}. It deletes the text 250standard input to a process running @var{program}. It deletes the text
222sent if @var{delete} is non-@code{nil}; this is useful when @var{buffer} 251sent if @var{delete} is non-@code{nil}; this is useful when @var{buffer}
223is @code{t}, to insert the output in the current buffer. 252is @code{t}, to insert the output in the current buffer.
224 253
225The arguments @var{buffer-or-name} and @var{display} control what to do 254The arguments @var{destination} and @var{display} control what to do
226with the output from the subprocess, and whether to update the display 255with the output from the subprocess, and whether to update the display
227as it comes in. For details, see the description of 256as it comes in. For details, see the description of
228@code{call-process}, above. If @var{buffer-or-name} is the integer 0, 257@code{call-process}, above. If @var{destination} is the integer 0,
229@code{call-process-region} discards the output and returns @code{nil} 258@code{call-process-region} discards the output and returns @code{nil}
230immediately, without waiting for the subprocess to finish. 259immediately, without waiting for the subprocess to finish.
231 260
@@ -241,7 +270,7 @@ In the following example, we use @code{call-process-region} to run the
241@code{cat} utility, with standard input being the first five characters 270@code{cat} utility, with standard input being the first five characters
242in buffer @samp{foo} (the word @samp{input}). @code{cat} copies its 271in buffer @samp{foo} (the word @samp{input}). @code{cat} copies its
243standard input into its standard output. Since the argument 272standard input into its standard output. Since the argument
244@var{buffer-or-name} is @code{t}, this output is inserted in the current 273@var{destination} is @code{t}, this output is inserted in the current
245buffer. 274buffer.
246 275
247@smallexample 276@smallexample
@@ -390,6 +419,10 @@ with one subprocess by binding the variable around the call to
390 (start-process @dots{})) 419 (start-process @dots{}))
391@end group 420@end group
392@end smallexample 421@end smallexample
422
423To determine whether a given subprocess actually got a pipe or a
424@sc{pty}, use the function @code{process-tty-name} (@pxref{Process
425Information}).
393@end defvar 426@end defvar
394 427
395@node Deleting Processes 428@node Deleting Processes
@@ -560,6 +593,13 @@ determine which of those it is.) If @var{process} has not yet
560terminated, the value is 0. 593terminated, the value is 0.
561@end defun 594@end defun
562 595
596@defun process-tty-name process
597This function returns the terminal name that @var{process} is using for
598its communication with Emacs---or @code{nil} if it is using pipes
599instead of a terminal (see @code{process-connection-type} in
600@ref{Asynchronous Processes}).
601@end defun
602
563@node Input to Processes 603@node Input to Processes
564@section Sending Input to Processes 604@section Sending Input to Processes
565@cindex process input 605@cindex process input
@@ -846,6 +886,13 @@ command would be unpredictable. If you want to permit quitting inside a
846filter function, bind @code{inhibit-quit} to @code{nil}. 886filter function, bind @code{inhibit-quit} to @code{nil}.
847@xref{Quitting}. 887@xref{Quitting}.
848 888
889 If an error happens during execution of a filter function, it is
890caught automatically, so that it doesn't stop the execution of whatever
891programs was running when the filter function was started. However, if
892@code{debug-on-error} is non-@code{nil}, the error-catching is turned
893off. This makes it possible to use the Lisp debugger to debug the
894filter function. @xref{Debugger}.
895
849 Many filter functions sometimes or always insert the text in the 896 Many filter functions sometimes or always insert the text in the
850process's buffer, mimicking the actions of Emacs when there is no 897process's buffer, mimicking the actions of Emacs when there is no
851filter. Such filter functions need to use @code{set-buffer} in order to 898filter. Such filter functions need to use @code{set-buffer} in order to
@@ -1057,6 +1104,13 @@ matching had to explicitly save and restore the match data. Now Emacs
1057does this automatically; sentinels never need to do it explicitly. 1104does this automatically; sentinels never need to do it explicitly.
1058@xref{Match Data}. 1105@xref{Match Data}.
1059 1106
1107 If an error happens during execution of a sentinel, it is caught
1108automatically, so that it doesn't stop the execution of whatever
1109programs was running when the sentinel was started. However, if
1110@code{debug-on-error} is non-@code{nil}, the error-catching is turned
1111off. This makes it possible to use the Lisp debugger to debug the
1112sentinel. @xref{Debugger}.
1113
1060@defun set-process-sentinel process sentinel 1114@defun set-process-sentinel process sentinel
1061This function associates @var{sentinel} with @var{process}. If 1115This function associates @var{sentinel} with @var{process}. If
1062@var{sentinel} is @code{nil}, then the process will have no sentinel. 1116@var{sentinel} is @code{nil}, then the process will have no sentinel.
diff --git a/lispref/searching.texi b/lispref/searching.texi
index ec082152aad..7919804d35c 100644
--- a/lispref/searching.texi
+++ b/lispref/searching.texi
@@ -17,6 +17,7 @@ portions of it.
17* String Search:: Search for an exact match. 17* String Search:: Search for an exact match.
18* Regular Expressions:: Describing classes of strings. 18* Regular Expressions:: Describing classes of strings.
19* Regexp Search:: Searching for a match for a regexp. 19* Regexp Search:: Searching for a match for a regexp.
20* POSIX Regexps:: Searching POSIX-style for the longest match.
20* Search and Replace:: Internals of @code{query-replace}. 21* Search and Replace:: Internals of @code{query-replace}.
21* Match Data:: Finding out which part of the text matched 22* Match Data:: Finding out which part of the text matched
22 various parts of a regexp, after regexp search. 23 various parts of a regexp, after regexp search.
@@ -226,12 +227,12 @@ The next alternative is for @samp{a*} to match only two @samp{a}s.
226With this choice, the rest of the regexp matches successfully.@refill 227With this choice, the rest of the regexp matches successfully.@refill
227 228
228Nested repetition operators can be extremely slow if they specify 229Nested repetition operators can be extremely slow if they specify
229backtracking loops. For example, @samp{\(x+y*\)*a} could take hours to 230backtracking loops. For example, it could take hours for the regular
230match the sequence @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}. The 231expression @samp{\(x+y*\)*a} to match the sequence
231slowness is because Emacs must try each imaginable way of grouping the 232@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}. The slowness is because
23235 @samp{x}'s before concluding that none of them can work. To make 233Emacs must try each imaginable way of grouping the 35 @samp{x}'s before
233sure your regular expressions run fast, check nested repetitions 234concluding that none of them can work. To make sure your regular
234carefully. 235expressions run fast, check nested repetitions carefully.
235 236
236@item + 237@item +
237@cindex @samp{+} in regexp 238@cindex @samp{+} in regexp
@@ -715,6 +716,48 @@ comes back" twice.
715@end example 716@end example
716@end defun 717@end defun
717 718
719@node POSIX Regexps
720@section POSIX Regular Expression Searching
721
722 The usual regular expression functions do backtracking when necessary
723to handle the @samp{\|} and repetition constructs, but they continue
724this only until they find @emph{some} match. Then they succeed and
725report the first match found.
726
727 This section describes alternative search functions which perform the
728full backtracking specified by the POSIX standard for regular expression
729matching. They continue backtracking until they have tried all
730possibilities and found all matches, so they can report the longest
731match, as required by POSIX. This is much slower, so use these
732functions only when you really need the longest match.
733
734 In Emacs versions prior to 19.29, these functions did not exist, and
735the functions described above implemented full POSIX backtracking.
736
737@defun posix-search-forward regexp &optional limit noerror repeat
738This is like @code{re-search-forward} except that it performs the full
739backtracking specified by the POSIX standard for regular expression
740matching.
741@end defun
742
743@defun posix-search-backward regexp &optional limit noerror repeat
744This is like @code{re-search-backward} except that it performs the full
745backtracking specified by the POSIX standard for regular expression
746matching.
747@end defun
748
749@defun posix-looking-at regexp
750This is like @code{looking-at} except that it performs the full
751backtracking specified by the POSIX standard for regular expression
752matching.
753@end defun
754
755@defun posix-string-match regexp string &optional start
756This is like @code{string-match} except that it performs the full
757backtracking specified by the POSIX standard for regular expression
758matching.
759@end defun
760
718@ignore 761@ignore
719@deffn Command delete-matching-lines regexp 762@deffn Command delete-matching-lines regexp
720This function is identical to @code{delete-non-matching-lines}, save 763This function is identical to @code{delete-non-matching-lines}, save
@@ -909,34 +952,56 @@ match data around it, to prevent it from being overwritten.
909@node Simple Match Data 952@node Simple Match Data
910@subsection Simple Match Data Access 953@subsection Simple Match Data Access
911 954
912 This section explains how to use the match data to find the starting 955 This section explains how to use the match data to find out what was
913point or ending point of the text that was matched by a particular 956matched by the last search or match operation.
914search, or by a particular parenthetical subexpression of a regular 957
915expression. 958 You can ask about the entire matching text, or about a particular
959parenthetical subexpression of a regular expression. The @var{count}
960argument in the functions below specifies which. If @var{count} is
961zero, you are asking about the entire match. If @var{count} is
962positive, it specifies which subexpression you want.
963
964 Recall that the subexpressions of a regular expression are those
965expressions grouped with escaped parentheses, @samp{\(@dots{}\)}. The
966@var{count}th subexpression is found by counting occurrences of
967@samp{\(} from the beginning of the whole regular expression. The first
968subexpression is numbered 1, the second 2, and so on. Only regular
969expressions can have subexpressions---after a simple string search, the
970only information available is about the entire match.
971
972@defun match-string count &optional in-string
973This function returns, as a string, the text matched in the last search
974or match operation. It returns the entire text if @var{count} is zero,
975or just the portion corresponding to the @var{count}th parenthetical
976subexpression, if @var{count} is positive. If @var{count} is out of
977range, the value is @code{nil}.
978
979If the last such operation was done against a string with
980@code{string-match}, then you should pass the same string as the
981argument @var{in-string}. Otherwise, after a buffer search or match,
982you should omit @var{in-string} or pass @code{nil} for it; but you
983should make sure that the current buffer when you call
984@code{match-string} is the one in which you did the searching or
985matching.
986@end defun
916 987
917@defun match-beginning count 988@defun match-beginning count
918This function returns the position of the start of text matched by the 989This function returns the position of the start of text matched by the
919last regular expression searched for, or a subexpression of it. 990last regular expression searched for, or a subexpression of it.
920 991
921If @var{count} is zero, then the value is the position of the start of 992If @var{count} is zero, then the value is the position of the start of
922the text matched by the whole regexp. Otherwise, @var{count}, specifies 993the entire match. Otherwise, @var{count}, specifies a subexpression in
923a subexpression in the regular expresion. The value of the function is 994the regular expresion, and the value of the function is the starting
924the starting position of the match for that subexpression. 995position of the match for that subexpression.
925 996
926Subexpressions of a regular expression are those expressions grouped 997The value is @code{nil} for a subexpression inside a @samp{\|}
927with escaped parentheses, @samp{\(@dots{}\)}. The @var{count}th 998alternative that wasn't used in the match.
928subexpression is found by counting occurrences of @samp{\(} from the
929beginning of the whole regular expression. The first subexpression is
930numbered 1, the second 2, and so on.
931
932The value is @code{nil} for a subexpression inside a
933@samp{\|} alternative that wasn't used in the match.
934@end defun 999@end defun
935 1000
936@defun match-end count 1001@defun match-end count
937This function returns the position of the end of the text that matched 1002This function is like @code{match-beginning} except that it returns the
938the last regular expression searched for, or a subexpression of it. 1003position of the end of the match, rather than the position of the
939This function is otherwise similar to @code{match-beginning}. 1004beginning.
940@end defun 1005@end defun
941 1006
942 Here is an example of using the match data, with a comment showing the 1007 Here is an example of using the match data, with a comment showing the
@@ -951,6 +1016,15 @@ positions within the text:
951@end group 1016@end group
952 1017
953@group 1018@group
1019(match-string 0 "The quick fox jumped quickly.")
1020 @result{} "quick"
1021(match-string 1 "The quick fox jumped quickly.")
1022 @result{} "qu"
1023(match-string 2 "The quick fox jumped quickly.")
1024 @result{} "ick"
1025@end group
1026
1027@group
954(match-beginning 1) ; @r{The beginning of the match} 1028(match-beginning 1) ; @r{The beginning of the match}
955 @result{} 4 ; @r{with @samp{qu} is at index 4.} 1029 @result{} 4 ; @r{with @samp{qu} is at index 4.}
956@end group 1030@end group
@@ -1004,11 +1078,15 @@ character of the buffer counts as 1.)
1004@var{replacement}. 1078@var{replacement}.
1005 1079
1006@cindex case in replacements 1080@cindex case in replacements
1007@defun replace-match replacement &optional fixedcase literal 1081@defun replace-match replacement &optional fixedcase literal string
1008This function replaces the buffer text matched by the last search, with 1082This function replaces the text in the buffer (or in @var{string}) that
1009@var{replacement}. It applies only to buffers; you can't use 1083was matched by the last search. It replaces that text with
1010@code{replace-match} to replace a substring found with 1084@var{replacement}.
1011@code{string-match}. 1085
1086If @var{string} is @code{nil}, @code{replace-match} does the replacement
1087by editing the buffer; it leaves point at the end of the replacement
1088text, and returns @code{t}. If @var{string} is a string, it does the
1089replacement by constructing and returning a new string.
1012 1090
1013If @var{fixedcase} is non-@code{nil}, then the case of the replacement 1091If @var{fixedcase} is non-@code{nil}, then the case of the replacement
1014text is not changed; otherwise, the replacement text is converted to a 1092text is not changed; otherwise, the replacement text is converted to a
@@ -1044,9 +1122,6 @@ Subexpressions are those expressions grouped inside @samp{\(@dots{}\)}.
1044@cindex @samp{\} in replacement 1122@cindex @samp{\} in replacement
1045@samp{\\} stands for a single @samp{\} in the replacement text. 1123@samp{\\} stands for a single @samp{\} in the replacement text.
1046@end table 1124@end table
1047
1048@code{replace-match} leaves point at the end of the replacement text,
1049and returns @code{t}.
1050@end defun 1125@end defun
1051 1126
1052@node Entire Match Data 1127@node Entire Match Data
@@ -1239,19 +1314,27 @@ default value is @code{"^\014"} (i.e., @code{"^^L"} or @code{"^\C-l"});
1239this matches a line that starts with a formfeed character. 1314this matches a line that starts with a formfeed character.
1240@end defvar 1315@end defvar
1241 1316
1317 The following two regular expressions should @emph{not} assume the
1318match always starts at the beginning of a line; they should not use
1319@samp{^} to anchor the match. Most often, the paragraph commands do
1320check for a match only at the beginning of a line, which means that
1321@samp{^} would be superfluous. When there is a left margin, they accept
1322matches that start after the left margin. In that case, a @samp{^}
1323would be incorrect.
1324
1242@defvar paragraph-separate 1325@defvar paragraph-separate
1243This is the regular expression for recognizing the beginning of a line 1326This is the regular expression for recognizing the beginning of a line
1244that separates paragraphs. (If you change this, you may have to 1327that separates paragraphs. (If you change this, you may have to
1245change @code{paragraph-start} also.) The default value is 1328change @code{paragraph-start} also.) The default value is
1246@w{@code{"^[@ \t\f]*$"}}, which matches a line that consists entirely of 1329@w{@code{"[@ \t\f]*$"}}, which matches a line that consists entirely of
1247spaces, tabs, and form feeds. 1330spaces, tabs, and form feeds (after its left margin).
1248@end defvar 1331@end defvar
1249 1332
1250@defvar paragraph-start 1333@defvar paragraph-start
1251This is the regular expression for recognizing the beginning of a line 1334This is the regular expression for recognizing the beginning of a line
1252that starts @emph{or} separates paragraphs. The default value is 1335that starts @emph{or} separates paragraphs. The default value is
1253@w{@code{"^[@ \t\n\f]"}}, which matches a line starting with a space, tab, 1336@w{@code{"[@ \t\n\f]"}}, which matches a line starting with a space, tab,
1254newline, or form feed. 1337newline, or form feed (after its left margin).
1255@end defvar 1338@end defvar
1256 1339
1257@defvar sentence-end 1340@defvar sentence-end
diff --git a/lispref/sequences.texi b/lispref/sequences.texi
index c1e7f3dc2d0..0982b19c743 100644
--- a/lispref/sequences.texi
+++ b/lispref/sequences.texi
@@ -462,11 +462,12 @@ existing vector.
462@end group 462@end group
463@end example 463@end example
464 464
465When an argument is an integer (not a sequence of integers), it is 465The @code{vconcat} function also allows integers as arguments. It
466converted to a string of digits making up the decimal printed 466converts them to strings of digits, making up the decimal print
467representation of the integer. This special case exists for 467representation of the integer, and then uses the strings instead of the
468compatibility with Mocklisp, and we don't recommend you take advantage 468original integers. @strong{Don't use this feature; we plan to eliminate
469of it. If you want to convert an integer to digits in this way, use 469it. If you already use this feature, change your programs now!} The
470proper way to convert an integer to a decimal number in this way is with
470@code{format} (@pxref{Formatting Strings}) or @code{number-to-string} 471@code{format} (@pxref{Formatting Strings}) or @code{number-to-string}
471(@pxref{String Conversion}). 472(@pxref{String Conversion}).
472 473
diff --git a/lispref/strings.texi b/lispref/strings.texi
index 1ca59d81f69..a0321476dc0 100644
--- a/lispref/strings.texi
+++ b/lispref/strings.texi
@@ -218,10 +218,10 @@ not @code{eq} to any existing string.
218 218
219When an argument is an integer (not a sequence of integers), it is 219When an argument is an integer (not a sequence of integers), it is
220converted to a string of digits making up the decimal printed 220converted to a string of digits making up the decimal printed
221representation of the integer. @string{Don't use this feature---it 221representation of the integer. @strong{Don't use this feature; we plan
222exists for historical compatibility only, and we plan to change it by 222to eliminate it. If you already use this feature, change your programs
223and by.} If you wish to convert an integer to a decimal number in this 223now!} The proper way to convert an integer to a decimal number in this
224way, use @code{format} (@pxref{Formatting Strings}) or 224way is with @code{format} (@pxref{Formatting Strings}) or
225@code{number-to-string} (@pxref{String Conversion}). 225@code{number-to-string} (@pxref{String Conversion}).
226 226
227@example 227@example
@@ -270,6 +270,10 @@ match exactly; case is significant.
270(string= "ab" "ABC") 270(string= "ab" "ABC")
271 @result{} nil 271 @result{} nil
272@end example 272@end example
273
274The function @code{string=} ignores the text properties of the
275two strings. To compare strings in a way that compares their text
276properties also, use @code{equal} (@pxref{Equality Predicates}).
273@end defun 277@end defun
274 278
275@defun string-equal string1 string2 279@defun string-equal string1 string2
diff --git a/lispref/symbols.texi b/lispref/symbols.texi
index f3d13ebdad7..caba9a9bd7e 100644
--- a/lispref/symbols.texi
+++ b/lispref/symbols.texi
@@ -350,6 +350,20 @@ See @code{documentation} in @ref{Accessing Documentation}, for another
350example using @code{mapatoms}. 350example using @code{mapatoms}.
351@end defun 351@end defun
352 352
353@defun unintern symbol &optional obarray
354This function deletes @var{symbol} from the obarray @var{obarray}. If
355@code{symbol} is not actually in the obarray, @code{unintern} does
356nothing. If @var{obarray} is @code{nil}, the current obarray is used.
357
358If you provide a string instead of a symbol as @var{symbol}, it stands
359for a symbol name. Then @code{unintern} deletes the symbol (if any) in
360the obarray which has that name. If there is no such symbol,
361@code{unintern} does nothing.
362
363If @code{unintern} does delete a symbol, it returns @code{t}. Otherwise
364it returns @code{nil}.
365@end defun
366
353@node Property Lists,, Creating Symbols, Symbols 367@node Property Lists,, Creating Symbols, Symbols
354@section Property Lists 368@section Property Lists
355@cindex property list 369@cindex property list
@@ -379,6 +393,16 @@ objects, but the names are usually symbols. They are compared using
379Here @code{lisp-indent-function} and @code{byte-compile} are property 393Here @code{lisp-indent-function} and @code{byte-compile} are property
380names, and the other two elements are the corresponding values. 394names, and the other two elements are the corresponding values.
381 395
396@menu
397* Plists and Alists:: Comparison of the advantages of property
398 lists and association lists.
399* Symbol Plists:: Functions to access symbols' property lists.
400* Other Plists:: Accessing property lists stored elsewhere.
401@end menu
402
403@node Plists and Alists
404@subsection Property Lists and Association Lists
405
382@cindex property lists vs association lists 406@cindex property lists vs association lists
383 Association lists (@pxref{Association Lists}) are very similar to 407 Association lists (@pxref{Association Lists}) are very similar to
384property lists. In contrast to association lists, the order of the 408property lists. In contrast to association lists, the order of the
@@ -408,12 +432,15 @@ name.) An association list may be used like a stack where associations
408are pushed on the front of the list and later discarded; this is not 432are pushed on the front of the list and later discarded; this is not
409possible with a property list. 433possible with a property list.
410 434
435@node Symbol Plists
436@subsection Property List Functions for Symbols
437
411@defun symbol-plist symbol 438@defun symbol-plist symbol
412This function returns the property list of @var{symbol}. 439This function returns the property list of @var{symbol}.
413@end defun 440@end defun
414 441
415@defun setplist symbol plist 442@defun setplist symbol plist
416 This function sets @var{symbol}'s property list to @var{plist}. 443This function sets @var{symbol}'s property list to @var{plist}.
417Normally, @var{plist} should be a well-formed property list, but this is 444Normally, @var{plist} should be a well-formed property list, but this is
418not enforced. 445not enforced.
419 446
@@ -458,3 +485,37 @@ The @code{put} function returns @var{value}.
458 @result{} (verb transitive noun (a buzzing little bug)) 485 @result{} (verb transitive noun (a buzzing little bug))
459@end smallexample 486@end smallexample
460@end defun 487@end defun
488
489@node Other Plists
490@subsection Property Lists Outside Symbols
491
492 These two functions are useful for manipulating property lists
493that are stored in places other than symbols:
494
495@defun plist-get plist property
496This returns the value of the @var{property} property
497stored in the property list @var{plist}. For example,
498
499@example
500(plist-get '(foo 4) 'foo)
501 @result{} 4
502@end example
503@end defun
504
505@defun plist-put plist property value
506This stores @var{value} as the value of the @var{property} property
507stored in the property list @var{plist}. It may modify @var{plist}
508destructively, or it may construct new list structure without altering
509the old. The function returns the modified property list, so you can
510store that back in the place where you got @var{plist}. For example,
511
512@example
513(setq my-plist '(bar t foo 4))
514 @result{} (bar t foo 4)
515(setq my-plist (plist-put my-plist 'foo 69))
516 @result{} (bar t foo 69)
517(setq my-plist (plist-put my-plist 'quux '(a)))
518 @result{} (quux (a) bar t foo 5)
519@end example
520@end defun
521
diff --git a/lispref/text.texi b/lispref/text.texi
index 6153bdb69f1..eefd2c30259 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -156,6 +156,11 @@ It is not necessary for @var{start} to be less than @var{end}; the
156arguments can be given in either order. But most often the smaller 156arguments can be given in either order. But most often the smaller
157argument is written first. 157argument is written first.
158 158
159If the text being copied has any text properties, these are copied into
160the string along with the characters they belong to. @xref{Text
161Properties}. However, overlays (@pxref{Overlays}) in the buffer and
162their properties are ignored, not copied.
163
159@example 164@example
160@group 165@group
161---------- Buffer: foo ---------- 166---------- Buffer: foo ----------
@@ -176,6 +181,24 @@ This is the contents of buffer foo
176@end example 181@end example
177@end defun 182@end defun
178 183
184@defun buffer-substring-without-properties start end
185This is like @code{buffer-substring}, except that it does not copy text
186properties, just the characters themselves. @xref{Text Properties}.
187Here's an example of using this function to get a word to look up in an
188alist:
189
190@example
191(setq flammable
192 (assoc (buffer-substring start end)
193 '(("wood" . t) ("paper" . t)
194 ("steel" . nil) ("asbestos" . nil))))
195@end example
196
197If this were written using @code{buffer-substring} instead, it would not
198work reliably; any text properties that happened to be in the word
199copied from the buffer would make the comparisons fail.
200@end defun
201
179@defun buffer-string 202@defun buffer-string
180This function returns the contents of the accessible portion of the 203This function returns the contents of the accessible portion of the
181current buffer as a string. This is the portion between 204current buffer as a string. This is the portion between
@@ -343,18 +366,17 @@ it except to install it on a keymap.
343 366
344In an interactive call, @var{count} is the numeric prefix argument. 367In an interactive call, @var{count} is the numeric prefix argument.
345 368
346This function calls @code{auto-fill-function} if the current column number 369This command calls @code{auto-fill-function} whenever that is
347is greater than the value of @code{fill-column} and the character 370non-@code{nil} and the character inserted is a space or a newline
348inserted is a space (@pxref{Auto Filling}). 371(@pxref{Auto Filling}).
349 372
350@c Cross refs reworded to prevent overfull hbox. --rjc 15mar92 373@c Cross refs reworded to prevent overfull hbox. --rjc 15mar92
351This function performs abbrev expansion if Abbrev mode is enabled and 374This command performs abbrev expansion if Abbrev mode is enabled and
352the inserted character does not have word-constituent 375the inserted character does not have word-constituent
353syntax. (@xref{Abbrevs}, and @ref{Syntax Class Table}.) 376syntax. (@xref{Abbrevs}, and @ref{Syntax Class Table}.)
354 377
355This function is also responsible for calling 378This is also responsible for calling @code{blink-paren-function} when
356@code{blink-paren-function} when the inserted character has close 379the inserted character has close parenthesis syntax (@pxref{Blinking}).
357parenthesis syntax (@pxref{Blinking}).
358@end deffn 380@end deffn
359 381
360@deffn Command newline &optional number-of-newlines 382@deffn Command newline &optional number-of-newlines
@@ -710,6 +732,9 @@ the kill ring, but does not delete the text from the buffer. It returns
710@code{nil}. It also indicates the extent of the text copied by moving 732@code{nil}. It also indicates the extent of the text copied by moving
711the cursor momentarily, or by displaying a message in the echo area. 733the cursor momentarily, or by displaying a message in the echo area.
712 734
735The command does not set @code{this-command} to @code{kill-region}, so a
736subsequent kill command does not append to the same kill ring entry.
737
713Don't call @code{copy-region-as-kill} in Lisp programs unless you aim to 738Don't call @code{copy-region-as-kill} in Lisp programs unless you aim to
714support Emacs 18. For Emacs 19, it is better to use @code{kill-new} or 739support Emacs 18. For Emacs 19, it is better to use @code{kill-new} or
715@code{kill-append} instead. @xref{Low-Level Kill Ring}. 740@code{kill-append} instead. @xref{Low-Level Kill Ring}.
@@ -1073,8 +1098,11 @@ specified width. The width is controlled by the variable
1073automatically as you insert it, but changes to existing text may leave 1098automatically as you insert it, but changes to existing text may leave
1074it improperly filled. Then you must fill the text explicitly. 1099it improperly filled. Then you must fill the text explicitly.
1075 1100
1076 Most of the functions in this section return values that are not 1101 Most of the commands in this section return values that are not
1077meaningful. 1102meaningful. All the functions that do filling take note of the current
1103left margin, current right margin, and current justification style. If
1104the current justification style is @code{none}, the filling functions
1105don't actually do anything.
1078 1106
1079@deffn Command fill-paragraph justify-flag 1107@deffn Command fill-paragraph justify-flag
1080@cindex filling a paragraph 1108@cindex filling a paragraph
@@ -1123,8 +1151,11 @@ described above.
1123This command considers a region of text as a paragraph and fills it. If 1151This command considers a region of text as a paragraph and fills it. If
1124the region was made up of many paragraphs, the blank lines between 1152the region was made up of many paragraphs, the blank lines between
1125paragraphs are removed. This function justifies as well as filling when 1153paragraphs are removed. This function justifies as well as filling when
1126@var{justify-flag} is non-@code{nil}. In an interactive call, any 1154@var{justify-flag} is non-@code{nil}. The precise value of
1127prefix argument requests justification. 1155@var{justify-flag} specifies a style of justification, as in
1156@code{justify-current-line}, below.
1157
1158In an interactive call, any prefix argument requests justification.
1128 1159
1129In Adaptive Fill mode, which is enabled by default, 1160In Adaptive Fill mode, which is enabled by default,
1130@code{fill-region-as-paragraph} on an indented paragraph when there is 1161@code{fill-region-as-paragraph} on an indented paragraph when there is
@@ -1132,12 +1163,38 @@ no fill prefix uses the indentation of the second line of the paragraph
1132as the fill prefix. 1163as the fill prefix.
1133@end deffn 1164@end deffn
1134 1165
1135@deffn Command justify-current-line 1166@deffn Command justify-current-line how eop nosqueeze
1136This command inserts spaces between the words of the current line so 1167This command inserts spaces between the words of the current line so
1137that the line ends exactly at @code{fill-column}. It returns 1168that the line ends exactly at @code{fill-column}. It returns
1138@code{nil}. 1169@code{nil}.
1170
1171The argument @var{how}, if non-@code{nil} specifies explicitly the style
1172of justification. It can be @code{left}, @code{right}, @code{full},
1173@code{center}, or @code{none}. If it is @code{t}, that means to do
1174follow specified justification style (see @code{current-justification},
1175below). @code{nil} means to do full justification.
1176
1177If @var{eop} is non-@code{nil}, that means do left-justification when
1178@code{current-justification} specifies full justification. This is used
1179for the last line of a paragraph; even if the paragraph as a whole is
1180fully justified, the last line should not be.
1181
1182If @var{nosqueeze} is non-@code{nil}, that means do not change interior
1183whitespace.
1139@end deffn 1184@end deffn
1140 1185
1186@defopt default-justification
1187This variable's value specifies the style of justification to use for
1188text that doesn't specify a style with a text property. The possible
1189values are @code{left}, @code{right}, @code{full}, @code{center}, or
1190@code{none}.
1191@end defopt
1192
1193@defun current-justification
1194This function returns the proper justification style to use for filling
1195the text around point.
1196@end defun
1197
1141@defopt fill-prefix 1198@defopt fill-prefix
1142This variable specifies a string of text that appears at the beginning 1199This variable specifies a string of text that appears at the beginning
1143of normal text lines and should be disregarded when filling them. Any 1200of normal text lines and should be disregarded when filling them. Any
@@ -1168,6 +1225,67 @@ buffers that do not override it. This is the same as
1168The default value for @code{default-fill-column} is 70. 1225The default value for @code{default-fill-column} is 70.
1169@end defvar 1226@end defvar
1170 1227
1228@defvar fill-paragraph-function
1229This variable provides a way for major modes to override the filling of
1230paragraphs. If the value is non-@code{nil}, @code{fill-paragraph} calls
1231this function to do the work. If the function returns a non-@code{nil}
1232value, @code{fill-paragraph} assumes the job is done, and immediately
1233returns that value.
1234
1235The usual use of this feature is to fill comments in programming
1236language modes. If the function needs to fill a paragraph in the usual
1237way, it can do so as follows:
1238
1239@example
1240(let ((fill-paragraph-function nil))
1241 (fill-paragraph arg))
1242@end example
1243@end defvar
1244
1245@deffn Command set-left-margin from to margin
1246This sets the @code{left-margin} property on the text from @var{from} to
1247@var{to} to the value @var{margin}. If Auto Fill mode is enabled, this
1248command also refills the region to fit the new margin.
1249@end deffn
1250
1251@deffn Command set-right-margin from to margin
1252This sets the @code{fill-colmn} property on the text from @var{from} to
1253@var{to} so as to yield a right margin of width @var{margin}. If Auto
1254Fill mode is enabled, this command also refills the region to fit the
1255new margin.
1256@end deffn
1257
1258@defun current-left-margin
1259This function returns the proper left margin value to use for filling
1260the text around point. The value is the sum of the @code{left-margin}
1261property of the character at the start of the current line (or zero if
1262none), plus the value of the variable @code{left-margin}.
1263@end defun
1264
1265@defun current-fill-column
1266This function returns the proper fill column value to use for filling
1267the text around point. The value is the value of the @code{fill-column}
1268variable, minus the value of the @code{right-margin} property of the
1269character after point.
1270@end defun
1271
1272@deffn Command move-to-left-margin &optional n force
1273This function moves point to the left margin of the current line. The
1274column moved to is determined by calling the function
1275@code{current-left-margin}. If the argument @var{n} is specified,
1276@code{move-to-left-margin} moves forward @var{n}@minus{}1 lines first.
1277
1278If @var{force} is non-@code{nil}, that says to fix the line's
1279indentation if that doesn't match the left margin value.
1280@end deffn
1281
1282@defun delete-to-left-margin from to
1283This function removes left margin indentation from the text
1284between @var{from} and @var{to}. The amount of indentation
1285to delete is determined by calling @code{current-left-margin}.
1286In no case does this function delete non-whitespace.
1287@end defun
1288
1171@node Auto Filling 1289@node Auto Filling
1172@comment node-name, next, previous, up 1290@comment node-name, next, previous, up
1173@section Auto Filling 1291@section Auto Filling
@@ -1180,10 +1298,9 @@ For a description of functions that you can call explicitly to fill and
1180justify existing text, see @ref{Filling}. 1298justify existing text, see @ref{Filling}.
1181 1299
1182@defvar auto-fill-function 1300@defvar auto-fill-function
1183The value of this variable should be a function (of no arguments) to 1301The value of this variable should be a function (of no arguments) to be
1184be called after self-inserting a space at a column beyond 1302called after self-inserting a space or a newline. It may be @code{nil},
1185@code{fill-column}. It may be @code{nil}, in which case nothing 1303in which case nothing special is done in that case.
1186special is done.
1187 1304
1188The value of @code{auto-fill-function} is @code{do-auto-fill} when 1305The value of @code{auto-fill-function} is @code{do-auto-fill} when
1189Auto-Fill mode is enabled. That is a function whose sole purpose is to 1306Auto-Fill mode is enabled. That is a function whose sole purpose is to
@@ -1935,6 +2052,7 @@ along with the characters; this includes such diverse functions as
1935* Changing Properties:: Setting the properties of a range of text. 2052* Changing Properties:: Setting the properties of a range of text.
1936* Property Search:: Searching for where a property changes value. 2053* Property Search:: Searching for where a property changes value.
1937* Special Properties:: Particular properties with special meanings. 2054* Special Properties:: Particular properties with special meanings.
2055* Format Properties:: Properties for representing formatting of text.
1938* Sticky Properties:: How inserted text gets properties from 2056* Sticky Properties:: How inserted text gets properties from
1939 neighboring text. 2057 neighboring text.
1940* Saving Properties:: Saving text properties in files, and reading 2058* Saving Properties:: Saving text properties in files, and reading
@@ -1986,6 +2104,22 @@ This function returns the entire property list of the character at
1986@code{nil}, it defaults to the current buffer. 2104@code{nil}, it defaults to the current buffer.
1987@end defun 2105@end defun
1988 2106
2107@defvar default-text-properties
2108This variable holds a property list giving default values for text
2109properties. Whenever a character does not specify a value for a
2110property, the value stored in this list is used instead. Here is an
2111example:
2112
2113@example
2114(setq default-text-properties '(foo 69))
2115;; @r{Make sure character 1 has no properties of its own.}
2116(set-text-properties 1 2 nil)
2117;; @r{What we get, when we ask, is the default value.}
2118(get-text-property 1 'foo)
2119 @result{} 69
2120@end example
2121@end defvar
2122
1989@node Changing Properties 2123@node Changing Properties
1990@subsection Changing Text Properties 2124@subsection Changing Text Properties
1991 2125
@@ -2068,6 +2202,10 @@ from the specified range of text. Here's an example:
2068@end example 2202@end example
2069@end defun 2203@end defun
2070 2204
2205See also the function @code{buffer-substring-without-properties}
2206(@pxref{Buffer Contents}) which copies text from the buffer
2207but does not copy its properties.
2208
2071@node Property Search 2209@node Property Search
2072@subsection Property Search Functions 2210@subsection Property Search Functions
2073 2211
@@ -2188,9 +2326,9 @@ of the symbol serve as defaults for the properties of the character.
2188@cindex face codes of text 2326@cindex face codes of text
2189@kindex face @r{(text property)} 2327@kindex face @r{(text property)}
2190You can use the property @code{face} to control the font and color of 2328You can use the property @code{face} to control the font and color of
2191text. @xref{Faces}, for more information. This feature is temporary; 2329text. Its value is a face name or a list of face names. @xref{Faces},
2192in the future, we may replace it with other ways of specifying how to 2330for more information. This feature may be temporary; in the future, we
2193display text. 2331may replace it with other ways of specifying how to display text.
2194 2332
2195@item mouse-face 2333@item mouse-face
2196@kindex mouse-face @r{(text property)} 2334@kindex mouse-face @r{(text property)}
@@ -2225,16 +2363,19 @@ and then remove the property. @xref{Read Only Buffers}.
2225 2363
2226@item invisible 2364@item invisible
2227@kindex invisible @r{(text property)} 2365@kindex invisible @r{(text property)}
2228A non-@code{nil} @code{invisible} property means a character does not 2366A non-@code{nil} @code{invisible} property can make a character invisible
2229appear on the screen. This works much like selective display. Details 2367on the screen. @xref{Invisible Text}, for details.
2230of this feature are likely to change in future versions, so check the
2231@file{etc/NEWS} file in the version you are using.
2232 2368
2233@item intangible 2369@item intangible
2234@kindex intangible @r{(text property)} 2370@kindex intangible @r{(text property)}
2235A non-@code{nil} @code{intangible} property on a character prevents 2371If a group of consecutive characters have equal and non-@code{nil}
2236putting point before that character. If you try, point actually goes 2372@code{intangible} properties, then you cannot place point between them.
2237after the character (and after all succeeding intangible characters). 2373If you move point forward into the group, point actually moves to the
2374end of the group. If you try to move point backward into the group,
2375point actually moves to the start of the group.
2376
2377When the variable @code{inhibit-point-motion-hooks} is non-@code{nil},
2378the @code{intangible} property is ignored.
2238 2379
2239@item modification-hooks 2380@item modification-hooks
2240@cindex change hooks for a character 2381@cindex change hooks for a character
@@ -2298,9 +2439,36 @@ value of point runs these hook functions.
2298 2439
2299@defvar inhibit-point-motion-hooks 2440@defvar inhibit-point-motion-hooks
2300When this variable is non-@code{nil}, @code{point-left} and 2441When this variable is non-@code{nil}, @code{point-left} and
2301@code{point-entered} hooks are not run. 2442@code{point-entered} hooks are not run, and the @code{intangible}
2443property has no effect.
2302@end defvar 2444@end defvar
2303 2445
2446@node Format Properties
2447@section Formatted Text Properties
2448
2449 These text properties affect the behavior of the fill commands. They
2450are used for representing formatted text. @xref{Filling}.
2451
2452@table code
2453@item hard
2454If a newline character has this property, it is a ``hard'' newline.
2455The fill commands do not alter hard newlines and do not move words
2456across them. However, this property takes effect only if the variable
2457@code{use-hard-newlines} is non-@code{nil}.
2458
2459@item right-margin
2460This property specifies the right margin for filling this part of the
2461text.
2462
2463@item left-margin
2464This property specifies the left margin for filling this part of the
2465text.
2466
2467@item justification
2468This property specifies the style of justification for filling this part
2469of the text.
2470@end table
2471
2304@node Sticky Properties 2472@node Sticky Properties
2305@subsection Stickiness of Text Properties 2473@subsection Stickiness of Text Properties
2306@cindex sticky text properties 2474@cindex sticky text properties
diff --git a/lispref/variables.texi b/lispref/variables.texi
index cc69742be50..fb08a390c6d 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -708,6 +708,39 @@ always affects the most local existing binding.
708@end quotation 708@end quotation
709@end defun 709@end defun
710 710
711 One other function for setting a variable is designed to add
712an element to a list if it is not already present in the list.
713
714@defun add-to-list symbol element
715This function sets the variable @var{symbol} by consing @var{element}
716onto the old value, if @var{element} is not already a member of that
717value. The value of @var{symbol} had better be a list already.
718
719Here's a scenario showing how to use @code{add-to-list}:
720
721@example
722(setq foo '(a b))
723 @result{} (a b)
724
725(add-to-list 'foo 'c) ;; @r{Add @code{c}.}
726 @result{} (c a b)
727
728(add-to-list 'foo 'b) ;; @r{No effect.}
729 @result{} (c a b)
730
731foo ;; @r{@code{foo} was changed.}
732 @result{} (c a b)
733@end example
734@end defun
735
736 An equivalent expression for @code{(add-to-list '@var{var}
737@var{value})} is this:
738
739@example
740(or (member @var{value} @var{var})
741 (setq @var{var} (cons @var{value} @var{var})))
742@end example
743
711@node Variable Scoping 744@node Variable Scoping
712@section Scoping Rules for Variable Bindings 745@section Scoping Rules for Variable Bindings
713 746
@@ -921,7 +954,8 @@ languages in one form or another. Emacs also supports another, unusual
921kind of variable binding: @dfn{buffer-local} bindings, which apply only 954kind of variable binding: @dfn{buffer-local} bindings, which apply only
922to one buffer. Emacs Lisp is meant for programming editing commands, 955to one buffer. Emacs Lisp is meant for programming editing commands,
923and having different values for a variable in different buffers is an 956and having different values for a variable in different buffers is an
924important customization method. 957important customization method. (A few variables have bindings that
958are local to a given X terminal; see @ref{Multiple Displays}.)
925 959
926@menu 960@menu
927* Intro to Buffer-Local:: Introduction and concepts. 961* Intro to Buffer-Local:: Introduction and concepts.
@@ -1072,6 +1106,9 @@ Making a variable buffer-local within a @code{let}-binding for that
1072variable does not work. This is because @code{let} does not distinguish 1106variable does not work. This is because @code{let} does not distinguish
1073between different kinds of bindings; it knows only which variable the 1107between different kinds of bindings; it knows only which variable the
1074binding was made for. 1108binding was made for.
1109
1110@strong{Note:} do not use @code{make-local-variable} for a hook
1111variable. Instead, use @code{make-local-hook}. @xref{Hooks}.
1075@end deffn 1112@end deffn
1076 1113
1077@deffn Command make-variable-buffer-local variable 1114@deffn Command make-variable-buffer-local variable
@@ -1116,6 +1153,12 @@ Note that storing new values into the @sc{cdr}s of cons cells in this
1116list does @emph{not} change the local values of the variables. 1153list does @emph{not} change the local values of the variables.
1117@end defun 1154@end defun
1118 1155
1156@defun local-variable-p variable
1157This returns @code{t} if @var{variable} is buffer-local in the current
1158buffer. It is much faster to get the answer this way than to examine
1159the value of @code{buffer-local-variables}.
1160@end defun
1161
1119@deffn Command kill-local-variable variable 1162@deffn Command kill-local-variable variable
1120This function deletes the buffer-local binding (if any) for 1163This function deletes the buffer-local binding (if any) for
1121@var{variable} (a symbol) in the current buffer. As a result, the 1164@var{variable} (a symbol) in the current buffer. As a result, the
@@ -1277,4 +1320,3 @@ evaluated.
1277@end group 1320@end group
1278@end example 1321@end example
1279@end defun 1322@end defun
1280
diff --git a/lispref/windows.texi b/lispref/windows.texi
index 708862ab18b..b1dcd2d6e0e 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -659,8 +659,10 @@ Contrast this with @code{set-buffer}, which makes @var{buffer-or-name}
659the current buffer but does not display it in the selected window. 659the current buffer but does not display it in the selected window.
660@xref{Current Buffer}. 660@xref{Current Buffer}.
661 661
662If @var{buffer-or-name} does not identify an existing buffer, then 662If @var{buffer-or-name} does not identify an existing buffer, then a new
663a new buffer by that name is created. 663buffer by that name is created. The major mode for the new buffer is
664set according to the variable @code{default-major-mode}. @xref{Auto
665Major Mode}.
664 666
665Normally the specified buffer is put at the front of the buffer list. 667Normally the specified buffer is put at the front of the buffer list.
666This affects the operation of @code{other-buffer}. However, if 668This affects the operation of @code{other-buffer}. However, if
@@ -715,7 +717,9 @@ already displayed in the selected window and @var{other-window} is
715for @var{buffer-or-name}, so that nothing needs to be done. 717for @var{buffer-or-name}, so that nothing needs to be done.
716 718
717If @var{buffer-or-name} is a string that does not name an existing 719If @var{buffer-or-name} is a string that does not name an existing
718buffer, a buffer by that name is created. 720buffer, a buffer by that name is created. The major mode for the new
721buffer is set according to the variable @code{default-major-mode}.
722@xref{Auto Major Mode}.
719@end defun 723@end defun
720 724
721@node Choosing Window 725@node Choosing Window
@@ -1520,6 +1524,23 @@ created narrower than this. The absolute minimum width is one; any
1520value below that is ignored. The default value is 10. 1524value below that is ignored. The default value is 10.
1521@end defopt 1525@end defopt
1522 1526
1527@defvar window-size-change-functions
1528This variable holds a list of functions to be called if the size of any
1529window changes for any reason. The functions are called just once per
1530redisplay, and just once for each frame on which size changes have
1531occurred.
1532
1533Each function receives the frame as its sole argument. There is no
1534direct way to find out which windows changed size, or precisely how;
1535however, if your size-change function keeps track, after each change, of
1536the windows that interest you, you can figure out what has changed by
1537comparing the old size data with the new.
1538
1539Creating or deleting windows counts as a size change, and therefore
1540causes these functions to be called. Changing the frame size also
1541counts, because it changes the sizes of the existing windows.
1542@end defvar
1543
1523@node Coordinates and Windows 1544@node Coordinates and Windows
1524@section Coordinates and Windows 1545@section Coordinates and Windows
1525 1546