aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
Diffstat (limited to 'lispref')
-rw-r--r--lispref/ChangeLog30
-rw-r--r--lispref/keymaps.texi96
-rw-r--r--lispref/modes.texi28
-rw-r--r--lispref/processes.texi27
4 files changed, 130 insertions, 51 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 5f4f8901637..894d78646d1 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,33 @@
12004-08-22 Richard M. Stallman <rms@gnu.org>
2
3 * modes.texi (Major Mode Conventions): Discuss rebinding of
4 standard key bindings.
5
62004-08-18 Kim F. Storm <storm@cua.dk>
7
8 * processes.texi (Accepting Output): Add `just-this-one' arg to
9 `accept-process-output'.
10 (Output from Processes): New var `process-adaptive-read-buffering'.
11
122004-08-10 Luc Teirlinck <teirllm@auburn.edu>
13
14 * keymaps.texi: Various changes in addition to:
15 (Keymap Terminology): `kbd' uses same syntax as Edit Macro mode.
16 Give more varied examples for `kbd'.
17 (Creating Keymaps): Char tables have slots for all characters
18 without modifiers.
19 (Active Keymaps): `overriding-local-map' and
20 `overriding-terminal-local-map' also override text property and
21 overlay keymaps.
22 (Functions for Key Lookup): Mention OLP arg to `current-active-maps'.
23 (Scanning Keymaps): `accessible-keymaps' uses `[]' instead of `""'
24 to denote a prefix of no events.
25 `map-keymap' includes parent's bindings _recursively_.
26 Clarify and correct description of `where-is-internal'.
27 Mention BUFFER-OR-NAME arg to `describe-bindings'.
28 (Menu Example): For menus intended for use with the keyboard, the
29 menu items should be bound to characters or real function keys.
30
12004-08-08 Luc Teirlinck <teirllm@auburn.edu> 312004-08-08 Luc Teirlinck <teirllm@auburn.edu>
2 32
3 * objects.texi (Character Type): Reposition `@anchor' to prevent 33 * objects.texi (Character Type): Reposition `@anchor' to prevent
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index 12246f0b236..089d29fc4ee 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000, 2004
4@c Free Software Foundation, Inc. 4@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/keymaps 6@setfilename ../info/keymaps
@@ -103,16 +103,19 @@ representation; it is also convenient to use @code{kbd}:
103This macro converts the text @var{keyseq-text} (a string constant) 103This macro converts the text @var{keyseq-text} (a string constant)
104into a key sequence (a string or vector constant). The contents 104into a key sequence (a string or vector constant). The contents
105of @var{keyseq-text} should describe the key sequence using the syntax 105of @var{keyseq-text} should describe the key sequence using the syntax
106used in this manual: 106used in this manual. More precisely, it uses the same syntax that
107Edit Macro mode uses for editing keyboard macros (@pxref{Edit Keyboard
108Macro,,, emacs, The GNU Emacs Manual}).
107 109
108@example 110@example
109(kbd "C-x") @result{} "\C-x" 111(kbd "C-x") @result{} "\C-x"
110(kbd "C-x C-f") @result{} "\C-x\C-f" 112(kbd "C-x C-f") @result{} "\C-x\C-f"
111(kbd "C-c C-c") @result{} "\C-c\C-c"
112(kbd "C-x 4 C-f") @result{} "\C-x4\C-f" 113(kbd "C-x 4 C-f") @result{} "\C-x4\C-f"
113(kbd "X") @result{} "X" 114(kbd "X") @result{} "X"
114(kbd "RET") @result{} "\^M" 115(kbd "RET") @result{} "\^M"
115(kbd "C-c 3") @result{} "\C-c3" 116(kbd "C-c SPC") @result{} "\C-c@ "
117(kbd "<f1> SPC") @result{} [f1 32]
118(kbd "C-M-<down>") @result{} [C-M-down]
116@end example 119@end example
117@end defmac 120@end defmac
118 121
@@ -144,7 +147,8 @@ This specifies a @dfn{default key binding}; any event not bound by other
144elements of the keymap is given @var{binding} as its binding. Default 147elements of the keymap is given @var{binding} as its binding. Default
145bindings allow a keymap to bind all possible event types without having 148bindings allow a keymap to bind all possible event types without having
146to enumerate all of them. A keymap that has a default binding 149to enumerate all of them. A keymap that has a default binding
147completely masks any lower-precedence keymap. 150completely masks any lower-precedence keymap, except for events
151explicitly bound to @code{nil} (see below).
148 152
149@item @var{char-table} 153@item @var{char-table}
150If an element of a keymap is a char-table, it counts as holding 154If an element of a keymap is a char-table, it counts as holding
@@ -251,17 +255,15 @@ satisfies @code{keymapp}.
251@c ??? This should come after make-sparse-keymap 255@c ??? This should come after make-sparse-keymap
252@defun make-keymap &optional prompt 256@defun make-keymap &optional prompt
253This function creates and returns a new full keymap. That keymap 257This function creates and returns a new full keymap. That keymap
254contains a char-table (@pxref{Char-Tables}) with 384 slots: the first 258contains a char-table (@pxref{Char-Tables}) with slots for all
255128 slots are for defining all the @acronym{ASCII} characters, the next 128 259characters without modifiers. The new keymap initially binds all
256slots are for 8-bit European characters, and each one of the final 128 260these characters to @code{nil}, and does not bind any other kind of
257slots is for one character set of non-@acronym{ASCII} characters supported by 261event.
258Emacs. The new keymap initially binds all these characters to
259@code{nil}, and does not bind any other kind of event.
260 262
261@example 263@example
262@group 264@group
263(make-keymap) 265(make-keymap)
264 @result{} (keymap [nil nil nil @dots{} nil nil]) 266 @result{} (keymap #^[t nil nil nil @dots{} nil nil keymap])
265@end group 267@end group
266@end example 268@end example
267 269
@@ -509,6 +511,7 @@ active keymap.
509 511
510@defun define-prefix-command symbol &optional mapvar prompt 512@defun define-prefix-command symbol &optional mapvar prompt
511@cindex prefix command 513@cindex prefix command
514@anchor{Definition of define-prefix-command}
512This function prepares @var{symbol} for use as a prefix key's binding: 515This function prepares @var{symbol} for use as a prefix key's binding:
513it creates a sparse keymap and stores it as @var{symbol}'s function 516it creates a sparse keymap and stores it as @var{symbol}'s function
514definition. Subsequently binding a key sequence to @var{symbol} will 517definition. Subsequently binding a key sequence to @var{symbol} will
@@ -698,15 +701,16 @@ all buffers.
698 701
699@defvar overriding-local-map 702@defvar overriding-local-map
700If non-@code{nil}, this variable holds a keymap to use instead of the 703If non-@code{nil}, this variable holds a keymap to use instead of the
701buffer's local keymap and instead of all the minor mode keymaps. This 704buffer's local keymap, text property or overlay keymaps, and instead
702keymap, if any, overrides all other maps that would have been active, 705of all the minor mode keymaps. This keymap, if any, overrides all
703except for the current global map. 706other maps that would have been active, except for the current global
707map.
704@end defvar 708@end defvar
705 709
706@defvar overriding-terminal-local-map 710@defvar overriding-terminal-local-map
707If non-@code{nil}, this variable holds a keymap to use instead of 711If non-@code{nil}, this variable holds a keymap to use instead of
708@code{overriding-local-map}, the buffer's local keymap and all the minor 712@code{overriding-local-map}, the buffer's local keymap, text property
709mode keymaps. 713or overlay keymaps, and all the minor mode keymaps.
710 714
711This variable is always local to the current terminal and cannot be 715This variable is always local to the current terminal and cannot be
712buffer-local. @xref{Multiple Displays}. It is used to implement 716buffer-local. @xref{Multiple Displays}. It is used to implement
@@ -977,9 +981,12 @@ An error is signaled if @var{key} is not a string or a vector.
977@end example 981@end example
978@end defun 982@end defun
979 983
980@defun current-active-maps 984@defun current-active-maps &optional olp
981This returns the list of keymaps that would be used by the command 985This returns the list of keymaps that would be used by the command
982loop in the current circumstances to look up a key sequence. 986loop in the current circumstances to look up a key sequence. Normally
987it ignores @code{overriding-local-map} and
988@code{overriding-terminal-local-map}, but if @var{olp} is
989non-@code{nil} then it pays attention to them.
983@end defun 990@end defun
984 991
985@defun local-key-binding key &optional accept-defaults 992@defun local-key-binding key &optional accept-defaults
@@ -1191,7 +1198,7 @@ changing the bindings of both @kbd{C-p C-f} and @kbd{C-x C-f} in the
1191default global map. 1198default global map.
1192 1199
1193 The function @code{substitute-key-definition} scans a keymap for 1200 The function @code{substitute-key-definition} scans a keymap for
1194keys that have a certain binding and rebind them with a different 1201keys that have a certain binding and rebinds them with a different
1195binding. Another feature you can use for similar effects, but which 1202binding. Another feature you can use for similar effects, but which
1196is often cleaner, is to add a binding that remaps a command 1203is often cleaner, is to add a binding that remaps a command
1197(@pxref{Remapping Commands}). 1204(@pxref{Remapping Commands}).
@@ -1324,7 +1331,7 @@ this by making these two command-remapping bindings in its keymap:
1324Whenever @code{my-mode-map} is an active keymap, if the user types 1331Whenever @code{my-mode-map} is an active keymap, if the user types
1325@kbd{C-k}, Emacs will find the standard global binding of 1332@kbd{C-k}, Emacs will find the standard global binding of
1326@code{kill-line} (assuming nobody has changed it). But 1333@code{kill-line} (assuming nobody has changed it). But
1327@code{my-mode-map} remaps @code{kill-line} to @code{my-mode-map}, 1334@code{my-mode-map} remaps @code{kill-line} to @code{my-kill-line},
1328so instead of running @code{kill-line}, Emacs runs 1335so instead of running @code{kill-line}, Emacs runs
1329@code{my-kill-line}. 1336@code{my-kill-line}.
1330 1337
@@ -1337,15 +1344,16 @@ Remapping only works through a single level. In other words,
1337 1344
1338@noindent 1345@noindent
1339does not have the effect of remapping @code{kill-line} into 1346does not have the effect of remapping @code{kill-line} into
1340@code{my-other-kill-line}. If an ordinary key binding specifies 1347@code{my-other-kill-line}. If an ordinary key binding specifies
1341@code{kill-line}, this keymap will remap it to @code{my-kill-line}; 1348@code{kill-line}, this keymap will remap it to @code{my-kill-line};
1342if an ordinary binding specifies @code{my-kill-line}, this keymap will 1349if an ordinary binding specifies @code{my-kill-line}, this keymap will
1343remap it to @code{my-other-kill-line}. 1350remap it to @code{my-other-kill-line}.
1344 1351
1345@defun command-remapping command 1352@defun command-remapping command
1346This function returns the remapping for @var{command}, given the 1353This function returns the remapping for @var{command} (a symbol),
1347current active keymaps. If @var{command} is not remapped (which is 1354given the current active keymaps. If @var{command} is not remapped
1348the usual situation), the function returns @code{nil}. 1355(which is the usual situation), or not a symbol, the function returns
1356@code{nil}.
1349@end defun 1357@end defun
1350 1358
1351@node Key Binding Commands 1359@node Key Binding Commands
@@ -1409,7 +1417,7 @@ actually bind the multibyte character with code 2294, not the unibyte
1409Latin-1 character with code 246 (@kbd{M-v}). In order to use this 1417Latin-1 character with code 246 (@kbd{M-v}). In order to use this
1410binding, you need to enter the multibyte Latin-1 character as keyboard 1418binding, you need to enter the multibyte Latin-1 character as keyboard
1411input. One way to do this is by using an appropriate input method 1419input. One way to do this is by using an appropriate input method
1412(@pxref{Input Methods, , Input Methods, emacs,The GNU Emacs Manual}). 1420(@pxref{Input Methods, , Input Methods, emacs, The GNU Emacs Manual}).
1413 1421
1414 If you want to use a unibyte character in the key binding, you can 1422 If you want to use a unibyte character in the key binding, you can
1415construct the key sequence string using @code{multibyte-char-to-unibyte} 1423construct the key sequence string using @code{multibyte-char-to-unibyte}
@@ -1499,7 +1507,7 @@ association list with elements of the form @code{(@var{key} .@:
1499@var{keymap} is @var{map}. 1507@var{keymap} is @var{map}.
1500 1508
1501The elements of the alist are ordered so that the @var{key} increases 1509The elements of the alist are ordered so that the @var{key} increases
1502in length. The first element is always @code{("" .@: @var{keymap})}, 1510in length. The first element is always @code{([] .@: @var{keymap})},
1503because the specified keymap is accessible from itself with a prefix of 1511because the specified keymap is accessible from itself with a prefix of
1504no events. 1512no events.
1505 1513
@@ -1517,7 +1525,7 @@ definition is the sparse keymap @code{(keymap (83 .@: center-paragraph)
1517@smallexample 1525@smallexample
1518@group 1526@group
1519(accessible-keymaps (current-local-map)) 1527(accessible-keymaps (current-local-map))
1520@result{}(("" keymap 1528@result{}(([] keymap
1521 (27 keymap ; @r{Note this keymap for @key{ESC} is repeated below.} 1529 (27 keymap ; @r{Note this keymap for @key{ESC} is repeated below.}
1522 (83 . center-paragraph) 1530 (83 . center-paragraph)
1523 (115 . center-line)) 1531 (115 . center-line))
@@ -1541,7 +1549,7 @@ of a window.
1541@smallexample 1549@smallexample
1542@group 1550@group
1543(accessible-keymaps (current-global-map)) 1551(accessible-keymaps (current-global-map))
1544@result{} (("" keymap [set-mark-command beginning-of-line @dots{} 1552@result{} (([] keymap [set-mark-command beginning-of-line @dots{}
1545 delete-backward-char]) 1553 delete-backward-char])
1546@end group 1554@end group
1547@group 1555@group
@@ -1572,6 +1580,8 @@ The function @code{map-keymap} calls @var{function} once
1572for each binding in @var{keymap}. It passes two arguments, 1580for each binding in @var{keymap}. It passes two arguments,
1573the event type and the value of the binding. If @var{keymap} 1581the event type and the value of the binding. If @var{keymap}
1574has a parent, the parent's bindings are included as well. 1582has a parent, the parent's bindings are included as well.
1583This works recursively: if the parent has itself a parent, then the
1584grandparent's bindings are also included and so on.
1575 1585
1576This function is the cleanest way to examine all the bindings 1586This function is the cleanest way to examine all the bindings
1577in a keymap. 1587in a keymap.
@@ -1580,7 +1590,7 @@ in a keymap.
1580@defun where-is-internal command &optional keymap firstonly noindirect no-remap 1590@defun where-is-internal command &optional keymap firstonly noindirect no-remap
1581This function is a subroutine used by the @code{where-is} command 1591This function is a subroutine used by the @code{where-is} command
1582(@pxref{Help, , Help, emacs,The GNU Emacs Manual}). It returns a list 1592(@pxref{Help, , Help, emacs,The GNU Emacs Manual}). It returns a list
1583of key sequences (of any length) that are bound to @var{command} in a 1593of all key sequences (of any length) that are bound to @var{command} in a
1584set of keymaps. 1594set of keymaps.
1585 1595
1586The argument @var{command} can be any object; it is compared with all 1596The argument @var{command} can be any object; it is compared with all
@@ -1588,7 +1598,7 @@ keymap entries using @code{eq}.
1588 1598
1589If @var{keymap} is @code{nil}, then the maps used are the current active 1599If @var{keymap} is @code{nil}, then the maps used are the current active
1590keymaps, disregarding @code{overriding-local-map} (that is, pretending 1600keymaps, disregarding @code{overriding-local-map} (that is, pretending
1591its value is @code{nil}). If @var{keymap} is non-@code{nil}, then the 1601its value is @code{nil}). If @var{keymap} is a keymap, then the
1592maps searched are @var{keymap} and the global keymap. If @var{keymap} 1602maps searched are @var{keymap} and the global keymap. If @var{keymap}
1593is a list of keymaps, only those keymaps are searched. 1603is a list of keymaps, only those keymaps are searched.
1594 1604
@@ -1598,11 +1608,12 @@ keymaps that are active. To search only the global map, pass
1598@code{(keymap)} (an empty keymap) as @var{keymap}. 1608@code{(keymap)} (an empty keymap) as @var{keymap}.
1599 1609
1600If @var{firstonly} is @code{non-ascii}, then the value is a single 1610If @var{firstonly} is @code{non-ascii}, then the value is a single
1601string representing the first key sequence found, rather than a list of 1611vector representing the first key sequence found, rather than a list of
1602all possible key sequences. If @var{firstonly} is @code{t}, then the 1612all possible key sequences. If @var{firstonly} is @code{t}, then the
1603value is the first key sequence, except that key sequences consisting 1613value is the first key sequence, except that key sequences consisting
1604entirely of @acronym{ASCII} characters (or meta variants of @acronym{ASCII} 1614entirely of @acronym{ASCII} characters (or meta variants of @acronym{ASCII}
1605characters) are preferred to all other key sequences. 1615characters) are preferred to all other key sequences and that the
1616return value can never be a menu binding.
1606 1617
1607If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't 1618If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't
1608follow indirect keymap bindings. This makes it possible to search for 1619follow indirect keymap bindings. This makes it possible to search for
@@ -1623,7 +1634,7 @@ other command. However, if @var{no-remap} is non-@code{nil}.
1623@end smallexample 1634@end smallexample
1624@end defun 1635@end defun
1625 1636
1626@deffn Command describe-bindings &optional prefix 1637@deffn Command describe-bindings &optional prefix buffer-or-name
1627This function creates a listing of all current key bindings, and 1638This function creates a listing of all current key bindings, and
1628displays it in a buffer named @samp{*Help*}. The text is grouped by 1639displays it in a buffer named @samp{*Help*}. The text is grouped by
1629modes---minor modes first, then the major mode, then global bindings. 1640modes---minor modes first, then the major mode, then global bindings.
@@ -1643,6 +1654,10 @@ For example, in the default global map, the characters @samp{@key{SPC}
1643@kbd{~} is @acronym{ASCII} 126, and the characters between them include all 1654@kbd{~} is @acronym{ASCII} 126, and the characters between them include all
1644the normal printing characters, (e.g., letters, digits, punctuation, 1655the normal printing characters, (e.g., letters, digits, punctuation,
1645etc.@:); all these characters are bound to @code{self-insert-command}. 1656etc.@:); all these characters are bound to @code{self-insert-command}.
1657
1658If @var{buffer-or-name} is non-@code{nil}, it should be a buffer or a
1659buffer name. Then @code{describe-bindings} lists that buffer's bindings,
1660instead of the current buffer's.
1646@end deffn 1661@end deffn
1647 1662
1648@node Menu Keymaps 1663@node Menu Keymaps
@@ -1681,8 +1696,9 @@ prompt string.
1681 1696
1682The easiest way to construct a keymap with a prompt string is to specify 1697The easiest way to construct a keymap with a prompt string is to specify
1683the string as an argument when you call @code{make-keymap}, 1698the string as an argument when you call @code{make-keymap},
1684@code{make-sparse-keymap} or @code{define-prefix-command} 1699@code{make-sparse-keymap} (@pxref{Creating Keymaps}), or
1685(@pxref{Creating Keymaps}). 1700@code{define-prefix-command} (@pxref{Definition of define-prefix-command}).
1701
1686 1702
1687@defun keymap-prompt keymap 1703@defun keymap-prompt keymap
1688This function returns the overall prompt string of @var{keymap}, 1704This function returns the overall prompt string of @var{keymap},
@@ -2107,6 +2123,12 @@ functioning of the menu itself, but they are ``echoed'' in the echo area
2107when the user selects from the menu, and they appear in the output of 2123when the user selects from the menu, and they appear in the output of
2108@code{where-is} and @code{apropos}. 2124@code{where-is} and @code{apropos}.
2109 2125
2126 The menu in this example is intended for use with the mouse. If a
2127menu is intended for use with the keyboard, that is, if it is bound to
2128a key sequence ending with a keyboard event, then the menu items
2129should be bound to characters or ``real'' function keys, that can be
2130typed with the keyboard.
2131
2110 The binding whose definition is @code{("--")} is a separator line. 2132 The binding whose definition is @code{("--")} is a separator line.
2111Like a real menu item, the separator has a key symbol, in this case 2133Like a real menu item, the separator has a key symbol, in this case
2112@code{separator-ps-print}. If one menu has two separators, they must 2134@code{separator-ps-print}. If one menu has two separators, they must
@@ -2389,7 +2411,7 @@ property list elements to add to the menu item specification.
2389This function is used for making non-global tool bar items. Use it 2411This function is used for making non-global tool bar items. Use it
2390like @code{tool-bar-add-item-from-menu} except that @var{in-map} 2412like @code{tool-bar-add-item-from-menu} except that @var{in-map}
2391specifies the local map to make the definition in. The argument 2413specifies the local map to make the definition in. The argument
2392@var{from-map} si like the @var{map} argument of 2414@var{from-map} is like the @var{map} argument of
2393@code{tool-bar-add-item-from-menu}. 2415@code{tool-bar-add-item-from-menu}.
2394@end defun 2416@end defun
2395 2417
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 040c229bb00..78b8fc440d7 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -188,16 +188,24 @@ The key sequences bound in a major mode keymap should usually start with
188characters are reserved for minor modes, and ordinary letters are 188characters are reserved for minor modes, and ordinary letters are
189reserved for users. 189reserved for users.
190 190
191It is reasonable for a major mode to rebind a key sequence with a 191A major mode can also rebind the keys @kbd{M-n}, @kbd{M-p} and
192standard meaning, if it implements a command that does ``the same job'' 192@kbd{M-s}. The bindings for @kbd{M-n} and @kbd{M-p} should normally
193in a way that fits the major mode better. For example, a major mode for 193be some kind of ``moving forward and backward,'' but this does not
194editing a programming language might redefine @kbd{C-M-a} to ``move to 194necessarily mean cursor motion.
195the beginning of a function'' in a way that works better for that 195
196language. 196It is legitimate for a major mode to rebind a standard key sequence if
197 197it provides a command that does ``the same job'' in a way better
198Major modes such as Dired or Rmail that do not allow self-insertion of 198suited to the text this mode is used for. For example, a major mode
199text can reasonably redefine letters and other printing characters as 199for editing a programming language might redefine @kbd{C-M-a} to
200editing commands. Dired and Rmail both do this. 200``move to the beginning of a function'' in a way that works better for
201that language.
202
203It is also legitimate for a major mode to rebind a standard key
204sequence whose standard meaning is rarely useful in that mode. For
205instance, minibuffer modes rebind @kbd{M-r}, whose standard meaning is
206rarely of any use in the minibuffer. Major modes such as Dired or
207Rmail that do not allow self-insertion of text can reasonably redefine
208letters and other printing characters as special commands.
201 209
202@item 210@item
203Major modes must not define @key{RET} to do anything other than insert 211Major modes must not define @key{RET} to do anything other than insert
diff --git a/lispref/processes.texi b/lispref/processes.texi
index f580a774ae7..ccf8f76d87e 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -929,6 +929,16 @@ process and only then specify its buffer or filter function; no output
929can arrive before you finish, if the code in between does not call any 929can arrive before you finish, if the code in between does not call any
930primitive that waits. 930primitive that waits.
931 931
932@defvar process-adaptive-read-buffering
933On some systems, when Emacs reads the output from a subprocess, the
934output data is read in very small blocks, potentially resulting in
935very poor performance. This behaviour can be remedied to some extent
936by setting the variable @var{process-adaptive-read-buffering} to a
937non-nil value (the default), as it will automatically delay reading
938from such processes, thus allowing them to produce more output before
939Emacs tries to read it.
940@end defvar
941
932 It is impossible to separate the standard output and standard error 942 It is impossible to separate the standard output and standard error
933streams of the subprocess, because Emacs normally spawns the subprocess 943streams of the subprocess, because Emacs normally spawns the subprocess
934inside a pseudo-TTY, and a pseudo-TTY has only one output channel. If 944inside a pseudo-TTY, and a pseudo-TTY has only one output channel. If
@@ -1240,7 +1250,7 @@ or terminal input. Occasionally it is useful in a Lisp program to
1240explicitly permit output to arrive at a specific point, or even to wait 1250explicitly permit output to arrive at a specific point, or even to wait
1241until output arrives from a process. 1251until output arrives from a process.
1242 1252
1243@defun accept-process-output &optional process seconds millisec 1253@defun accept-process-output &optional process seconds millisec just-this-one
1244This function allows Emacs to read pending output from processes. The 1254This function allows Emacs to read pending output from processes. The
1245output is inserted in the associated buffers or given to their filter 1255output is inserted in the associated buffers or given to their filter
1246functions. If @var{process} is non-@code{nil} then this function does 1256functions. If @var{process} is non-@code{nil} then this function does
@@ -1263,6 +1273,15 @@ Not all operating systems support waiting periods other than multiples
1263of a second; on those that do not, you get an error if you specify 1273of a second; on those that do not, you get an error if you specify
1264nonzero @var{millisec}. 1274nonzero @var{millisec}.
1265 1275
1276@c Emacs 21.4 feature
1277If @var{process} is a process, and the argument @var{just-this-one} is
1278non-nil, only output from that process is handled, suspending output
1279from other processes until some output has been received from that
1280process or the timeout expires. If @var{just-this-one} is an integer,
1281also inhibit running timers. This feature is generally not
1282recommended, but may be necessary for specific applications, such as
1283speech synthesis.
1284
1266The function @code{accept-process-output} returns non-@code{nil} if it 1285The function @code{accept-process-output} returns non-@code{nil} if it
1267did get some output, or @code{nil} if the timeout expired before output 1286did get some output, or @code{nil} if the timeout expired before output
1268arrived. 1287arrived.
@@ -1664,7 +1683,7 @@ meaning ask the system to allocate an unused port to listen on.
1664@end defun 1683@end defun
1665 1684
1666@node Datagrams 1685@node Datagrams
1667@section Datagrams 1686@section Datagrams
1668@cindex datagrams 1687@cindex datagrams
1669 1688
1670 A datagram connection communicates with individual packets rather 1689 A datagram connection communicates with individual packets rather
@@ -1951,7 +1970,7 @@ the port number.
1951 1970
1952@example 1971@example
1953(featurep 'make-network-process '(@var{keyword} @var{value})) 1972(featurep 'make-network-process '(@var{keyword} @var{value}))
1954@end example 1973@end example
1955 1974
1956@noindent 1975@noindent
1957The result of the first form is @code{t} if it works to specify 1976The result of the first form is @code{t} if it works to specify
@@ -1977,7 +1996,7 @@ Non-@code{nil} if the system can select the port for a server.
1977 1996
1978@example 1997@example
1979(featurep 'make-network-process '@var{keyword}) 1998(featurep 'make-network-process '@var{keyword})
1980@end example 1999@end example
1981 2000
1982Here are some of the option @var{keyword}s you can test in 2001Here are some of the option @var{keyword}s you can test in
1983this way. 2002this way.