diff options
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/ChangeLog | 30 | ||||
| -rw-r--r-- | lispref/keymaps.texi | 96 | ||||
| -rw-r--r-- | lispref/modes.texi | 28 | ||||
| -rw-r--r-- | lispref/processes.texi | 27 |
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 @@ | |||
| 1 | 2004-08-22 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * modes.texi (Major Mode Conventions): Discuss rebinding of | ||
| 4 | standard key bindings. | ||
| 5 | |||
| 6 | 2004-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 | |||
| 12 | 2004-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 | |||
| 1 | 2004-08-08 Luc Teirlinck <teirllm@auburn.edu> | 31 | 2004-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}: | |||
| 103 | This macro converts the text @var{keyseq-text} (a string constant) | 103 | This macro converts the text @var{keyseq-text} (a string constant) |
| 104 | into a key sequence (a string or vector constant). The contents | 104 | into a key sequence (a string or vector constant). The contents |
| 105 | of @var{keyseq-text} should describe the key sequence using the syntax | 105 | of @var{keyseq-text} should describe the key sequence using the syntax |
| 106 | used in this manual: | 106 | used in this manual. More precisely, it uses the same syntax that |
| 107 | Edit Macro mode uses for editing keyboard macros (@pxref{Edit Keyboard | ||
| 108 | Macro,,, 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 | |||
| 144 | elements of the keymap is given @var{binding} as its binding. Default | 147 | elements of the keymap is given @var{binding} as its binding. Default |
| 145 | bindings allow a keymap to bind all possible event types without having | 148 | bindings allow a keymap to bind all possible event types without having |
| 146 | to enumerate all of them. A keymap that has a default binding | 149 | to enumerate all of them. A keymap that has a default binding |
| 147 | completely masks any lower-precedence keymap. | 150 | completely masks any lower-precedence keymap, except for events |
| 151 | explicitly bound to @code{nil} (see below). | ||
| 148 | 152 | ||
| 149 | @item @var{char-table} | 153 | @item @var{char-table} |
| 150 | If an element of a keymap is a char-table, it counts as holding | 154 | If 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 |
| 253 | This function creates and returns a new full keymap. That keymap | 257 | This function creates and returns a new full keymap. That keymap |
| 254 | contains a char-table (@pxref{Char-Tables}) with 384 slots: the first | 258 | contains a char-table (@pxref{Char-Tables}) with slots for all |
| 255 | 128 slots are for defining all the @acronym{ASCII} characters, the next 128 | 259 | characters without modifiers. The new keymap initially binds all |
| 256 | slots are for 8-bit European characters, and each one of the final 128 | 260 | these characters to @code{nil}, and does not bind any other kind of |
| 257 | slots is for one character set of non-@acronym{ASCII} characters supported by | 261 | event. |
| 258 | Emacs. 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} | ||
| 512 | This function prepares @var{symbol} for use as a prefix key's binding: | 515 | This function prepares @var{symbol} for use as a prefix key's binding: |
| 513 | it creates a sparse keymap and stores it as @var{symbol}'s function | 516 | it creates a sparse keymap and stores it as @var{symbol}'s function |
| 514 | definition. Subsequently binding a key sequence to @var{symbol} will | 517 | definition. 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 |
| 700 | If non-@code{nil}, this variable holds a keymap to use instead of the | 703 | If non-@code{nil}, this variable holds a keymap to use instead of the |
| 701 | buffer's local keymap and instead of all the minor mode keymaps. This | 704 | buffer's local keymap, text property or overlay keymaps, and instead |
| 702 | keymap, if any, overrides all other maps that would have been active, | 705 | of all the minor mode keymaps. This keymap, if any, overrides all |
| 703 | except for the current global map. | 706 | other maps that would have been active, except for the current global |
| 707 | map. | ||
| 704 | @end defvar | 708 | @end defvar |
| 705 | 709 | ||
| 706 | @defvar overriding-terminal-local-map | 710 | @defvar overriding-terminal-local-map |
| 707 | If non-@code{nil}, this variable holds a keymap to use instead of | 711 | If 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 |
| 709 | mode keymaps. | 713 | or overlay keymaps, and all the minor mode keymaps. |
| 710 | 714 | ||
| 711 | This variable is always local to the current terminal and cannot be | 715 | This variable is always local to the current terminal and cannot be |
| 712 | buffer-local. @xref{Multiple Displays}. It is used to implement | 716 | buffer-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 |
| 981 | This returns the list of keymaps that would be used by the command | 985 | This returns the list of keymaps that would be used by the command |
| 982 | loop in the current circumstances to look up a key sequence. | 986 | loop in the current circumstances to look up a key sequence. Normally |
| 987 | it ignores @code{overriding-local-map} and | ||
| 988 | @code{overriding-terminal-local-map}, but if @var{olp} is | ||
| 989 | non-@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 | |||
| 1191 | default global map. | 1198 | default 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 |
| 1194 | keys that have a certain binding and rebind them with a different | 1201 | keys that have a certain binding and rebinds them with a different |
| 1195 | binding. Another feature you can use for similar effects, but which | 1202 | binding. Another feature you can use for similar effects, but which |
| 1196 | is often cleaner, is to add a binding that remaps a command | 1203 | is 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: | |||
| 1324 | Whenever @code{my-mode-map} is an active keymap, if the user types | 1331 | Whenever @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}, |
| 1328 | so instead of running @code{kill-line}, Emacs runs | 1335 | so 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 |
| 1339 | does not have the effect of remapping @code{kill-line} into | 1346 | does 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}; |
| 1342 | if an ordinary binding specifies @code{my-kill-line}, this keymap will | 1349 | if an ordinary binding specifies @code{my-kill-line}, this keymap will |
| 1343 | remap it to @code{my-other-kill-line}. | 1350 | remap it to @code{my-other-kill-line}. |
| 1344 | 1351 | ||
| 1345 | @defun command-remapping command | 1352 | @defun command-remapping command |
| 1346 | This function returns the remapping for @var{command}, given the | 1353 | This function returns the remapping for @var{command} (a symbol), |
| 1347 | current active keymaps. If @var{command} is not remapped (which is | 1354 | given the current active keymaps. If @var{command} is not remapped |
| 1348 | the 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 | |||
| 1409 | Latin-1 character with code 246 (@kbd{M-v}). In order to use this | 1417 | Latin-1 character with code 246 (@kbd{M-v}). In order to use this |
| 1410 | binding, you need to enter the multibyte Latin-1 character as keyboard | 1418 | binding, you need to enter the multibyte Latin-1 character as keyboard |
| 1411 | input. One way to do this is by using an appropriate input method | 1419 | input. 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 |
| 1415 | construct the key sequence string using @code{multibyte-char-to-unibyte} | 1423 | construct 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 | ||
| 1501 | The elements of the alist are ordered so that the @var{key} increases | 1509 | The elements of the alist are ordered so that the @var{key} increases |
| 1502 | in length. The first element is always @code{("" .@: @var{keymap})}, | 1510 | in length. The first element is always @code{([] .@: @var{keymap})}, |
| 1503 | because the specified keymap is accessible from itself with a prefix of | 1511 | because the specified keymap is accessible from itself with a prefix of |
| 1504 | no events. | 1512 | no 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 | |||
| 1572 | for each binding in @var{keymap}. It passes two arguments, | 1580 | for each binding in @var{keymap}. It passes two arguments, |
| 1573 | the event type and the value of the binding. If @var{keymap} | 1581 | the event type and the value of the binding. If @var{keymap} |
| 1574 | has a parent, the parent's bindings are included as well. | 1582 | has a parent, the parent's bindings are included as well. |
| 1583 | This works recursively: if the parent has itself a parent, then the | ||
| 1584 | grandparent's bindings are also included and so on. | ||
| 1575 | 1585 | ||
| 1576 | This function is the cleanest way to examine all the bindings | 1586 | This function is the cleanest way to examine all the bindings |
| 1577 | in a keymap. | 1587 | in 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 |
| 1581 | This function is a subroutine used by the @code{where-is} command | 1591 | This 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 |
| 1583 | of key sequences (of any length) that are bound to @var{command} in a | 1593 | of all key sequences (of any length) that are bound to @var{command} in a |
| 1584 | set of keymaps. | 1594 | set of keymaps. |
| 1585 | 1595 | ||
| 1586 | The argument @var{command} can be any object; it is compared with all | 1596 | The argument @var{command} can be any object; it is compared with all |
| @@ -1588,7 +1598,7 @@ keymap entries using @code{eq}. | |||
| 1588 | 1598 | ||
| 1589 | If @var{keymap} is @code{nil}, then the maps used are the current active | 1599 | If @var{keymap} is @code{nil}, then the maps used are the current active |
| 1590 | keymaps, disregarding @code{overriding-local-map} (that is, pretending | 1600 | keymaps, disregarding @code{overriding-local-map} (that is, pretending |
| 1591 | its value is @code{nil}). If @var{keymap} is non-@code{nil}, then the | 1601 | its value is @code{nil}). If @var{keymap} is a keymap, then the |
| 1592 | maps searched are @var{keymap} and the global keymap. If @var{keymap} | 1602 | maps searched are @var{keymap} and the global keymap. If @var{keymap} |
| 1593 | is a list of keymaps, only those keymaps are searched. | 1603 | is 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 | ||
| 1600 | If @var{firstonly} is @code{non-ascii}, then the value is a single | 1610 | If @var{firstonly} is @code{non-ascii}, then the value is a single |
| 1601 | string representing the first key sequence found, rather than a list of | 1611 | vector representing the first key sequence found, rather than a list of |
| 1602 | all possible key sequences. If @var{firstonly} is @code{t}, then the | 1612 | all possible key sequences. If @var{firstonly} is @code{t}, then the |
| 1603 | value is the first key sequence, except that key sequences consisting | 1613 | value is the first key sequence, except that key sequences consisting |
| 1604 | entirely of @acronym{ASCII} characters (or meta variants of @acronym{ASCII} | 1614 | entirely of @acronym{ASCII} characters (or meta variants of @acronym{ASCII} |
| 1605 | characters) are preferred to all other key sequences. | 1615 | characters) are preferred to all other key sequences and that the |
| 1616 | return value can never be a menu binding. | ||
| 1606 | 1617 | ||
| 1607 | If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't | 1618 | If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't |
| 1608 | follow indirect keymap bindings. This makes it possible to search for | 1619 | follow 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 |
| 1627 | This function creates a listing of all current key bindings, and | 1638 | This function creates a listing of all current key bindings, and |
| 1628 | displays it in a buffer named @samp{*Help*}. The text is grouped by | 1639 | displays it in a buffer named @samp{*Help*}. The text is grouped by |
| 1629 | modes---minor modes first, then the major mode, then global bindings. | 1640 | modes---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 |
| 1644 | the normal printing characters, (e.g., letters, digits, punctuation, | 1655 | the normal printing characters, (e.g., letters, digits, punctuation, |
| 1645 | etc.@:); all these characters are bound to @code{self-insert-command}. | 1656 | etc.@:); all these characters are bound to @code{self-insert-command}. |
| 1657 | |||
| 1658 | If @var{buffer-or-name} is non-@code{nil}, it should be a buffer or a | ||
| 1659 | buffer name. Then @code{describe-bindings} lists that buffer's bindings, | ||
| 1660 | instead 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 | ||
| 1682 | The easiest way to construct a keymap with a prompt string is to specify | 1697 | The easiest way to construct a keymap with a prompt string is to specify |
| 1683 | the string as an argument when you call @code{make-keymap}, | 1698 | the 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 |
| 1688 | This function returns the overall prompt string of @var{keymap}, | 1704 | This 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 | |||
| 2107 | when the user selects from the menu, and they appear in the output of | 2123 | when 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 | ||
| 2127 | menu is intended for use with the keyboard, that is, if it is bound to | ||
| 2128 | a key sequence ending with a keyboard event, then the menu items | ||
| 2129 | should be bound to characters or ``real'' function keys, that can be | ||
| 2130 | typed 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. |
| 2111 | Like a real menu item, the separator has a key symbol, in this case | 2133 | Like 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. | |||
| 2389 | This function is used for making non-global tool bar items. Use it | 2411 | This function is used for making non-global tool bar items. Use it |
| 2390 | like @code{tool-bar-add-item-from-menu} except that @var{in-map} | 2412 | like @code{tool-bar-add-item-from-menu} except that @var{in-map} |
| 2391 | specifies the local map to make the definition in. The argument | 2413 | specifies 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 | |||
| 188 | characters are reserved for minor modes, and ordinary letters are | 188 | characters are reserved for minor modes, and ordinary letters are |
| 189 | reserved for users. | 189 | reserved for users. |
| 190 | 190 | ||
| 191 | It is reasonable for a major mode to rebind a key sequence with a | 191 | A major mode can also rebind the keys @kbd{M-n}, @kbd{M-p} and |
| 192 | standard 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 |
| 193 | in a way that fits the major mode better. For example, a major mode for | 193 | be some kind of ``moving forward and backward,'' but this does not |
| 194 | editing a programming language might redefine @kbd{C-M-a} to ``move to | 194 | necessarily mean cursor motion. |
| 195 | the beginning of a function'' in a way that works better for that | 195 | |
| 196 | language. | 196 | It is legitimate for a major mode to rebind a standard key sequence if |
| 197 | 197 | it provides a command that does ``the same job'' in a way better | |
| 198 | Major modes such as Dired or Rmail that do not allow self-insertion of | 198 | suited to the text this mode is used for. For example, a major mode |
| 199 | text can reasonably redefine letters and other printing characters as | 199 | for editing a programming language might redefine @kbd{C-M-a} to |
| 200 | editing commands. Dired and Rmail both do this. | 200 | ``move to the beginning of a function'' in a way that works better for |
| 201 | that language. | ||
| 202 | |||
| 203 | It is also legitimate for a major mode to rebind a standard key | ||
| 204 | sequence whose standard meaning is rarely useful in that mode. For | ||
| 205 | instance, minibuffer modes rebind @kbd{M-r}, whose standard meaning is | ||
| 206 | rarely of any use in the minibuffer. Major modes such as Dired or | ||
| 207 | Rmail that do not allow self-insertion of text can reasonably redefine | ||
| 208 | letters and other printing characters as special commands. | ||
| 201 | 209 | ||
| 202 | @item | 210 | @item |
| 203 | Major modes must not define @key{RET} to do anything other than insert | 211 | Major 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 | |||
| 929 | can arrive before you finish, if the code in between does not call any | 929 | can arrive before you finish, if the code in between does not call any |
| 930 | primitive that waits. | 930 | primitive that waits. |
| 931 | 931 | ||
| 932 | @defvar process-adaptive-read-buffering | ||
| 933 | On some systems, when Emacs reads the output from a subprocess, the | ||
| 934 | output data is read in very small blocks, potentially resulting in | ||
| 935 | very poor performance. This behaviour can be remedied to some extent | ||
| 936 | by setting the variable @var{process-adaptive-read-buffering} to a | ||
| 937 | non-nil value (the default), as it will automatically delay reading | ||
| 938 | from such processes, thus allowing them to produce more output before | ||
| 939 | Emacs 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 |
| 933 | streams of the subprocess, because Emacs normally spawns the subprocess | 943 | streams of the subprocess, because Emacs normally spawns the subprocess |
| 934 | inside a pseudo-TTY, and a pseudo-TTY has only one output channel. If | 944 | inside 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 | |||
| 1240 | explicitly permit output to arrive at a specific point, or even to wait | 1250 | explicitly permit output to arrive at a specific point, or even to wait |
| 1241 | until output arrives from a process. | 1251 | until 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 |
| 1244 | This function allows Emacs to read pending output from processes. The | 1254 | This function allows Emacs to read pending output from processes. The |
| 1245 | output is inserted in the associated buffers or given to their filter | 1255 | output is inserted in the associated buffers or given to their filter |
| 1246 | functions. If @var{process} is non-@code{nil} then this function does | 1256 | functions. 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 | |||
| 1263 | of a second; on those that do not, you get an error if you specify | 1273 | of a second; on those that do not, you get an error if you specify |
| 1264 | nonzero @var{millisec}. | 1274 | nonzero @var{millisec}. |
| 1265 | 1275 | ||
| 1276 | @c Emacs 21.4 feature | ||
| 1277 | If @var{process} is a process, and the argument @var{just-this-one} is | ||
| 1278 | non-nil, only output from that process is handled, suspending output | ||
| 1279 | from other processes until some output has been received from that | ||
| 1280 | process or the timeout expires. If @var{just-this-one} is an integer, | ||
| 1281 | also inhibit running timers. This feature is generally not | ||
| 1282 | recommended, but may be necessary for specific applications, such as | ||
| 1283 | speech synthesis. | ||
| 1284 | |||
| 1266 | The function @code{accept-process-output} returns non-@code{nil} if it | 1285 | The function @code{accept-process-output} returns non-@code{nil} if it |
| 1267 | did get some output, or @code{nil} if the timeout expired before output | 1286 | did get some output, or @code{nil} if the timeout expired before output |
| 1268 | arrived. | 1287 | arrived. |
| @@ -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 |
| 1957 | The result of the first form is @code{t} if it works to specify | 1976 | The 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 | ||
| 1982 | Here are some of the option @var{keyword}s you can test in | 2001 | Here are some of the option @var{keyword}s you can test in |
| 1983 | this way. | 2002 | this way. |