diff options
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/ChangeLog | 45 | ||||
| -rw-r--r-- | lispref/commands.texi | 183 | ||||
| -rw-r--r-- | lispref/hooks.texi | 2 | ||||
| -rw-r--r-- | lispref/minibuf.texi | 1 | ||||
| -rw-r--r-- | lispref/objects.texi | 4 | ||||
| -rw-r--r-- | lispref/os.texi | 14 |
6 files changed, 180 insertions, 69 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 146f2173864..5f4f8901637 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,48 @@ | |||
| 1 | 2004-08-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2 | |||
| 3 | * objects.texi (Character Type): Reposition `@anchor' to prevent | ||
| 4 | double space inside sentence in Info. | ||
| 5 | |||
| 6 | * hooks.texi (Standard Hooks): `disabled-command-hook' has been | ||
| 7 | renamed to `disabled-command-function'. | ||
| 8 | * commands.texi (Key Sequence Input): Remove unnecessary anchor, | ||
| 9 | (Command Loop Info): Replace reference to it. | ||
| 10 | (Disabling Commands): `disabled-command-hook' has been renamed to | ||
| 11 | `disabled-command-function'. | ||
| 12 | |||
| 13 | 2004-08-07 Luc Teirlinck <teirllm@auburn.edu> | ||
| 14 | |||
| 15 | * os.texi (Translating Input): Only non-prefix bindings in | ||
| 16 | `key-translation-map' override actual key bindings. Warn about | ||
| 17 | possible indirect effect of actual key bindings on non-prefix | ||
| 18 | bindings in `key-translation-map'. | ||
| 19 | |||
| 20 | 2004-08-06 Luc Teirlinck <teirllm@auburn.edu> | ||
| 21 | |||
| 22 | * minibuf.texi (High-Level Completion): Add anchor for definition | ||
| 23 | of `read-variable'. | ||
| 24 | |||
| 25 | * commands.texi: Various changes in addition to: | ||
| 26 | (Using Interactive): Clarify description of `interactive-form'. | ||
| 27 | (Interactive Call): Mention default for KEYS argument to | ||
| 28 | `call-interactively'. | ||
| 29 | (Command Loop Info): Clarify description of `this-command-keys'. | ||
| 30 | Mention KEEP-RECORD argument to `clear-this-command-keys'. | ||
| 31 | Value of `last-event-frame' can be `macro'. | ||
| 32 | (Repeat Events): `double-click-fuzz' is also used to distinguish | ||
| 33 | clicks and drags. | ||
| 34 | (Classifying Events): Clarify descriptions of `event-modifiers' | ||
| 35 | `event-basic-type' and `event-convert-list'. | ||
| 36 | (Accessing Events): `posn-timestamp' takes POSITION argument. | ||
| 37 | (Quoted Character Input): Clarify description of | ||
| 38 | `read-quoted-char' and fix example. | ||
| 39 | (Quitting): Add `with-local-quit'. | ||
| 40 | (Disabling Commands): Correct and clarify descriptions of | ||
| 41 | `enable-command' and `disable-command'. | ||
| 42 | Mention what happens if `disabled-command-hook' is nil. | ||
| 43 | (Keyboard Macros): Mention LOOPFUNC arg to `execute-kbd-macro'. | ||
| 44 | Describe `executing-kbd-macro' instead of obsolete `executing-macro'. | ||
| 45 | |||
| 1 | 2004-07-24 Luc Teirlinck <teirllm@auburn.edu> | 46 | 2004-07-24 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 47 | ||
| 3 | * frames.texi: Various changes in addition to: | 48 | * frames.texi: Various changes in addition to: |
diff --git a/lispref/commands.texi b/lispref/commands.texi index 7a014080e89..796fc45f5f3 100644 --- a/lispref/commands.texi +++ b/lispref/commands.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, 1995, 1998, 1999 | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 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/commands | 6 | @setfilename ../info/commands |
| @@ -119,7 +119,7 @@ controls the reading of arguments for an interactive call. | |||
| 119 | 119 | ||
| 120 | This section describes how to write the @code{interactive} form that | 120 | This section describes how to write the @code{interactive} form that |
| 121 | makes a Lisp function an interactively-callable command, and how to | 121 | makes a Lisp function an interactively-callable command, and how to |
| 122 | examine a commands's @code{interactive} form. | 122 | examine a command's @code{interactive} form. |
| 123 | 123 | ||
| 124 | @defspec interactive arg-descriptor | 124 | @defspec interactive arg-descriptor |
| 125 | @cindex argument descriptors | 125 | @cindex argument descriptors |
| @@ -235,12 +235,13 @@ string (starting with the first character that is not @samp{*} or | |||
| 235 | 235 | ||
| 236 | @cindex examining the @code{interactive} form | 236 | @cindex examining the @code{interactive} form |
| 237 | @defun interactive-form function | 237 | @defun interactive-form function |
| 238 | This function returns the @code{interactive} form of @var{function}. If | 238 | This function returns the @code{interactive} form of @var{function}. |
| 239 | @var{function} is a command (@pxref{Interactive Call}), the value is a | 239 | If @var{function} is an interactively callable function |
| 240 | list of the form @code{(interactive @var{spec})}, where @var{spec} is | 240 | (@pxref{Interactive Call}), the value is the command's |
| 241 | the descriptor specification used by the command's @code{interactive} | 241 | @code{interactive} form @code{(interactive @var{spec})}, which |
| 242 | form to compute the function's arguments. If @var{function} is not a | 242 | specifies how to compute its arguments. Otherwise, the value is |
| 243 | command, @code{interactive-form} returns @code{nil}. | 243 | @code{nil}. If @var{function} is a symbol, its function definition is |
| 244 | used. | ||
| 244 | @end defun | 245 | @end defun |
| 245 | 246 | ||
| 246 | @node Interactive Codes | 247 | @node Interactive Codes |
| @@ -416,8 +417,9 @@ the string.) Other characters that normally terminate a symbol (e.g., | |||
| 416 | parentheses and brackets) do not do so here. Prompt. | 417 | parentheses and brackets) do not do so here. Prompt. |
| 417 | 418 | ||
| 418 | @item v | 419 | @item v |
| 419 | A variable declared to be a user option (i.e., satisfying the predicate | 420 | A variable declared to be a user option (i.e., satisfying the |
| 420 | @code{user-variable-p}). @xref{High-Level Completion}. Existing, | 421 | predicate @code{user-variable-p}). This reads the variable using |
| 422 | @code{read-variable}. @xref{Definition of read-variable}. Existing, | ||
| 421 | Completion, Prompt. | 423 | Completion, Prompt. |
| 422 | 424 | ||
| 423 | @item x | 425 | @item x |
| @@ -528,10 +530,12 @@ realistic example of using @code{commandp}. | |||
| 528 | @defun call-interactively command &optional record-flag keys | 530 | @defun call-interactively command &optional record-flag keys |
| 529 | This function calls the interactively callable function @var{command}, | 531 | This function calls the interactively callable function @var{command}, |
| 530 | reading arguments according to its interactive calling specifications. | 532 | reading arguments according to its interactive calling specifications. |
| 531 | An error is signaled if @var{command} is not a function or if it cannot | 533 | It returns whatever @var{command} returns. An error is signaled if |
| 532 | be called interactively (i.e., is not a command). Note that keyboard | 534 | @var{command} is not a function or if it cannot be called |
| 533 | macros (strings and vectors) are not accepted, even though they are | 535 | interactively (i.e., is not a command). Note that keyboard macros |
| 534 | considered commands, because they are not functions. | 536 | (strings and vectors) are not accepted, even though they are |
| 537 | considered commands, because they are not functions. If @var{command} | ||
| 538 | is a symbol, then @code{call-interactively} uses its function definition. | ||
| 535 | 539 | ||
| 536 | @cindex record command history | 540 | @cindex record command history |
| 537 | If @var{record-flag} is non-@code{nil}, then this command and its | 541 | If @var{record-flag} is non-@code{nil}, then this command and its |
| @@ -541,6 +545,8 @@ an argument. @xref{Command History}. | |||
| 541 | 545 | ||
| 542 | The argument @var{keys}, if given, specifies the sequence of events to | 546 | The argument @var{keys}, if given, specifies the sequence of events to |
| 543 | supply if the command inquires which events were used to invoke it. | 547 | supply if the command inquires which events were used to invoke it. |
| 548 | If @var{keys} is omitted or @code{nil}, the return value of | ||
| 549 | @code{this-command-keys} is used. @xref{Definition of this-command-keys}. | ||
| 544 | @end defun | 550 | @end defun |
| 545 | 551 | ||
| 546 | @defun command-execute command &optional record-flag keys special | 552 | @defun command-execute command &optional record-flag keys special |
| @@ -551,7 +557,8 @@ callable function or a keyboard macro. | |||
| 551 | 557 | ||
| 552 | A string or vector as @var{command} is executed with | 558 | A string or vector as @var{command} is executed with |
| 553 | @code{execute-kbd-macro}. A function is passed to | 559 | @code{execute-kbd-macro}. A function is passed to |
| 554 | @code{call-interactively}, along with the optional @var{record-flag}. | 560 | @code{call-interactively}, along with the optional @var{record-flag} |
| 561 | and @var{keys}. | ||
| 555 | 562 | ||
| 556 | A symbol is handled by using its function definition in its place. A | 563 | A symbol is handled by using its function definition in its place. A |
| 557 | symbol with an @code{autoload} definition counts as a command if it was | 564 | symbol with an @code{autoload} definition counts as a command if it was |
| @@ -559,9 +566,6 @@ declared to stand for an interactively callable function. Such a | |||
| 559 | definition is handled by loading the specified library and then | 566 | definition is handled by loading the specified library and then |
| 560 | rechecking the definition of the symbol. | 567 | rechecking the definition of the symbol. |
| 561 | 568 | ||
| 562 | The argument @var{keys}, if given, specifies the sequence of events to | ||
| 563 | supply if the command inquires which events were used to invoke it. | ||
| 564 | |||
| 565 | The argument @var{special}, if given, means to ignore the prefix | 569 | The argument @var{special}, if given, means to ignore the prefix |
| 566 | argument and not clear it. This is used for executing special events | 570 | argument and not clear it. This is used for executing special events |
| 567 | (@pxref{Special Events}). | 571 | (@pxref{Special Events}). |
| @@ -741,10 +745,14 @@ was specified to run but remapped into another command. | |||
| 741 | @end defvar | 745 | @end defvar |
| 742 | 746 | ||
| 743 | @defun this-command-keys | 747 | @defun this-command-keys |
| 748 | @anchor{Definition of this-command-keys} | ||
| 744 | This function returns a string or vector containing the key sequence | 749 | This function returns a string or vector containing the key sequence |
| 745 | that invoked the present command, plus any previous commands that | 750 | that invoked the present command, plus any previous commands that |
| 746 | generated the prefix argument for this command. The value is a string | 751 | generated the prefix argument for this command. However, if the |
| 747 | if all those events were characters. @xref{Input Events}. | 752 | command has called @code{read-key-sequence}, it returns the last read |
| 753 | key sequence. @xref{Key Sequence Input}. The value is a string if | ||
| 754 | all events in the sequence were characters that fit in a string. | ||
| 755 | @xref{Input Events}. | ||
| 748 | 756 | ||
| 749 | @example | 757 | @example |
| 750 | @group | 758 | @group |
| @@ -762,13 +770,13 @@ input events in a string (@pxref{Strings of Events}). | |||
| 762 | @end defun | 770 | @end defun |
| 763 | 771 | ||
| 764 | @tindex clear-this-command-keys | 772 | @tindex clear-this-command-keys |
| 765 | @defun clear-this-command-keys | 773 | @defun clear-this-command-keys &optional keep-record |
| 766 | This function empties out the table of events for | 774 | This function empties out the table of events for |
| 767 | @code{this-command-keys} to return, and also empties the records that | 775 | @code{this-command-keys} to return. Unless @var{keep-record} is |
| 768 | the function @code{recent-keys} (@pxref{Recording Input}) will | 776 | non-@code{nil}, it also empties the records that the function |
| 769 | subsequently return. This is useful after reading a password, to | 777 | @code{recent-keys} (@pxref{Recording Input}) will subsequently return. |
| 770 | prevent the password from echoing inadvertently as part of the next | 778 | This is useful after reading a password, to prevent the password from |
| 771 | command in certain cases. | 779 | echoing inadvertently as part of the next command in certain cases. |
| 772 | @end defun | 780 | @end defun |
| 773 | 781 | ||
| 774 | @defvar last-nonmenu-event | 782 | @defvar last-nonmenu-event |
| @@ -809,6 +817,8 @@ Usually this is the frame that was selected when the event was | |||
| 809 | generated, but if that frame has redirected input focus to another | 817 | generated, but if that frame has redirected input focus to another |
| 810 | frame, the value is the frame to which the event was redirected. | 818 | frame, the value is the frame to which the event was redirected. |
| 811 | @xref{Input Focus}. | 819 | @xref{Input Focus}. |
| 820 | |||
| 821 | If the last event came from a keyboard macro, the value is @code{macro}. | ||
| 812 | @end defvar | 822 | @end defvar |
| 813 | 823 | ||
| 814 | @node Adjusting Point | 824 | @node Adjusting Point |
| @@ -1155,7 +1165,7 @@ the marginal areas, @var{position} has this form: | |||
| 1155 | 1165 | ||
| 1156 | @example | 1166 | @example |
| 1157 | (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} | 1167 | (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} |
| 1158 | @var{object} @var{text-pos} (@var{col} . @var{row}) | 1168 | @var{object} @var{text-pos} (@var{col} . @var{row}) |
| 1159 | @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height})) | 1169 | @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height})) |
| 1160 | @end example | 1170 | @end example |
| 1161 | 1171 | ||
| @@ -1387,22 +1397,25 @@ the value is 3 or greater. If @var{event} is an ordinary mouse event | |||
| 1387 | (not a repeat event), the value is 1. | 1397 | (not a repeat event), the value is 1. |
| 1388 | @end defun | 1398 | @end defun |
| 1389 | 1399 | ||
| 1390 | @defvar double-click-fuzz | 1400 | @defopt double-click-fuzz |
| 1391 | To generate repeat events, successive mouse button presses must be at | 1401 | To generate repeat events, successive mouse button presses must be at |
| 1392 | approximately the same screen position. The value of | 1402 | approximately the same screen position. The value of |
| 1393 | @code{double-click-fuzz} specifies the maximum number of pixels the | 1403 | @code{double-click-fuzz} specifies the maximum number of pixels the |
| 1394 | mouse may be moved between two successive clicks to make a | 1404 | mouse may be moved (horizontally or vertically) between two successive |
| 1395 | double-click. | 1405 | clicks to make a double-click. |
| 1396 | @end defvar | ||
| 1397 | 1406 | ||
| 1398 | @defvar double-click-time | 1407 | This variable is also the threshold for motion of the mouse to count |
| 1408 | as a drag. | ||
| 1409 | @end defopt | ||
| 1410 | |||
| 1411 | @defopt double-click-time | ||
| 1399 | To generate repeat events, the number of milliseconds between | 1412 | To generate repeat events, the number of milliseconds between |
| 1400 | successive button presses must be less than the value of | 1413 | successive button presses must be less than the value of |
| 1401 | @code{double-click-time}. Setting @code{double-click-time} to | 1414 | @code{double-click-time}. Setting @code{double-click-time} to |
| 1402 | @code{nil} disables multi-click detection entirely. Setting it to | 1415 | @code{nil} disables multi-click detection entirely. Setting it to |
| 1403 | @code{t} removes the time limit; Emacs then detects multi-clicks by | 1416 | @code{t} removes the time limit; Emacs then detects multi-clicks by |
| 1404 | position only. | 1417 | position only. |
| 1405 | @end defvar | 1418 | @end defopt |
| 1406 | 1419 | ||
| 1407 | @node Motion Events | 1420 | @node Motion Events |
| 1408 | @subsection Motion Events | 1421 | @subsection Motion Events |
| @@ -1593,16 +1606,22 @@ This function returns a list of the modifiers that @var{event} has. The | |||
| 1593 | modifiers are symbols; they include @code{shift}, @code{control}, | 1606 | modifiers are symbols; they include @code{shift}, @code{control}, |
| 1594 | @code{meta}, @code{alt}, @code{hyper} and @code{super}. In addition, | 1607 | @code{meta}, @code{alt}, @code{hyper} and @code{super}. In addition, |
| 1595 | the modifiers list of a mouse event symbol always contains one of | 1608 | the modifiers list of a mouse event symbol always contains one of |
| 1596 | @code{click}, @code{drag}, and @code{down}. | 1609 | @code{click}, @code{drag}, and @code{down}. For double or triple |
| 1610 | events, it also contains @code{double} or @code{triple}. | ||
| 1597 | 1611 | ||
| 1598 | The argument @var{event} may be an entire event object, or just an event | 1612 | The argument @var{event} may be an entire event object, or just an |
| 1599 | type. | 1613 | event type. If @var{event} is a symbol that has never been used in an |
| 1614 | event that has been read as input in the current Emacs session, then | ||
| 1615 | @code{event-modifiers} can return @code{nil}, even when @var{event} | ||
| 1616 | actually has modifiers. | ||
| 1600 | 1617 | ||
| 1601 | Here are some examples: | 1618 | Here are some examples: |
| 1602 | 1619 | ||
| 1603 | @example | 1620 | @example |
| 1604 | (event-modifiers ?a) | 1621 | (event-modifiers ?a) |
| 1605 | @result{} nil | 1622 | @result{} nil |
| 1623 | (event-modifiers ?A) | ||
| 1624 | @result{} (shift) | ||
| 1606 | (event-modifiers ?\C-a) | 1625 | (event-modifiers ?\C-a) |
| 1607 | @result{} (control) | 1626 | @result{} (control) |
| 1608 | (event-modifiers ?\C-%) | 1627 | (event-modifiers ?\C-%) |
| @@ -1627,7 +1646,8 @@ but the event symbol name itself does not contain @samp{click}. | |||
| 1627 | 1646 | ||
| 1628 | @defun event-basic-type event | 1647 | @defun event-basic-type event |
| 1629 | This function returns the key or mouse button that @var{event} | 1648 | This function returns the key or mouse button that @var{event} |
| 1630 | describes, with all modifiers removed. For example: | 1649 | describes, with all modifiers removed. The @var{event} argument is as |
| 1650 | in @code{event-modifiers}. For example: | ||
| 1631 | 1651 | ||
| 1632 | @example | 1652 | @example |
| 1633 | (event-basic-type ?a) | 1653 | (event-basic-type ?a) |
| @@ -1656,7 +1676,8 @@ event. | |||
| 1656 | 1676 | ||
| 1657 | @defun event-convert-list list | 1677 | @defun event-convert-list list |
| 1658 | This function converts a list of modifier names and a basic event type | 1678 | This function converts a list of modifier names and a basic event type |
| 1659 | to an event type which specifies all of them. For example, | 1679 | to an event type which specifies all of them. The basic event type |
| 1680 | must be the last element of the list. For example, | ||
| 1660 | 1681 | ||
| 1661 | @example | 1682 | @example |
| 1662 | (event-convert-list '(control ?a)) | 1683 | (event-convert-list '(control ?a)) |
| @@ -1788,7 +1809,7 @@ is a buffer position, return the size of the character at that position. | |||
| 1788 | 1809 | ||
| 1789 | @cindex mouse event, timestamp | 1810 | @cindex mouse event, timestamp |
| 1790 | @cindex timestamp of a mouse event | 1811 | @cindex timestamp of a mouse event |
| 1791 | @defun posn-timestamp | 1812 | @defun posn-timestamp position |
| 1792 | Return the timestamp in @var{position}. This is the time at which the | 1813 | Return the timestamp in @var{position}. This is the time at which the |
| 1793 | event occurred, in milliseconds. | 1814 | event occurred, in milliseconds. |
| 1794 | @end defun | 1815 | @end defun |
| @@ -2001,7 +2022,9 @@ for example, @code{describe-key} uses it to read the key to describe. | |||
| 2001 | This function reads a key sequence and returns it as a string or | 2022 | This function reads a key sequence and returns it as a string or |
| 2002 | vector. It keeps reading events until it has accumulated a complete key | 2023 | vector. It keeps reading events until it has accumulated a complete key |
| 2003 | sequence; that is, enough to specify a non-prefix command using the | 2024 | sequence; that is, enough to specify a non-prefix command using the |
| 2004 | currently active keymaps. | 2025 | currently active keymaps. (Remember that a key sequence that starts |
| 2026 | with a mouse event is read using the keymaps of the buffer in the | ||
| 2027 | window that the mouse was in, not the current buffer.) | ||
| 2005 | 2028 | ||
| 2006 | If the events are all characters and all can fit in a string, then | 2029 | If the events are all characters and all can fit in a string, then |
| 2007 | @code{read-key-sequence} returns a string (@pxref{Strings of Events}). | 2030 | @code{read-key-sequence} returns a string (@pxref{Strings of Events}). |
| @@ -2101,6 +2124,8 @@ from the terminal---not counting those generated by keyboard macros. | |||
| 2101 | The lowest level functions for command input are those that read a | 2124 | The lowest level functions for command input are those that read a |
| 2102 | single event. | 2125 | single event. |
| 2103 | 2126 | ||
| 2127 | None of the three functions below suppresses quitting. | ||
| 2128 | |||
| 2104 | @defun read-event &optional prompt inherit-input-method | 2129 | @defun read-event &optional prompt inherit-input-method |
| 2105 | This function reads and returns the next event of command input, waiting | 2130 | This function reads and returns the next event of command input, waiting |
| 2106 | if necessary until an event is available. Events can come directly from | 2131 | if necessary until an event is available. Events can come directly from |
| @@ -2122,8 +2147,8 @@ If @code{cursor-in-echo-area} is non-@code{nil}, then @code{read-event} | |||
| 2122 | moves the cursor temporarily to the echo area, to the end of any message | 2147 | moves the cursor temporarily to the echo area, to the end of any message |
| 2123 | displayed there. Otherwise @code{read-event} does not move the cursor. | 2148 | displayed there. Otherwise @code{read-event} does not move the cursor. |
| 2124 | 2149 | ||
| 2125 | If @code{read-event} gets an event that is defined as a help character, in | 2150 | If @code{read-event} gets an event that is defined as a help character, |
| 2126 | some cases @code{read-event} processes the event directly without | 2151 | then in some cases @code{read-event} processes the event directly without |
| 2127 | returning. @xref{Help Functions}. Certain other events, called | 2152 | returning. @xref{Help Functions}. Certain other events, called |
| 2128 | @dfn{special events}, are also processed directly within | 2153 | @dfn{special events}, are also processed directly within |
| 2129 | @code{read-event} (@pxref{Special Events}). | 2154 | @code{read-event} (@pxref{Special Events}). |
| @@ -2235,7 +2260,10 @@ The command @code{quoted-insert} uses this function. | |||
| 2235 | This function is like @code{read-char}, except that if the first | 2260 | This function is like @code{read-char}, except that if the first |
| 2236 | character read is an octal digit (0-7), it reads any number of octal | 2261 | character read is an octal digit (0-7), it reads any number of octal |
| 2237 | digits (but stopping if a non-octal digit is found), and returns the | 2262 | digits (but stopping if a non-octal digit is found), and returns the |
| 2238 | character represented by that numeric character code. | 2263 | character represented by that numeric character code. If the |
| 2264 | character that terminates the sequence of octal digits is @key{RET}, | ||
| 2265 | it is discarded. Any other terminating character is used as input | ||
| 2266 | after this function returns. | ||
| 2239 | 2267 | ||
| 2240 | Quitting is suppressed when the first character is read, so that the | 2268 | Quitting is suppressed when the first character is read, so that the |
| 2241 | user can enter a @kbd{C-g}. @xref{Quitting}. | 2269 | user can enter a @kbd{C-g}. @xref{Quitting}. |
| @@ -2252,7 +2280,7 @@ is 127 in decimal). | |||
| 2252 | 2280 | ||
| 2253 | @group | 2281 | @group |
| 2254 | ---------- Echo Area ---------- | 2282 | ---------- Echo Area ---------- |
| 2255 | What character-@kbd{177} | 2283 | What character @kbd{1 7 7}- |
| 2256 | ---------- Echo Area ---------- | 2284 | ---------- Echo Area ---------- |
| 2257 | 2285 | ||
| 2258 | @result{} 127 | 2286 | @result{} 127 |
| @@ -2370,7 +2398,8 @@ during the sleep. | |||
| 2370 | @cindex special events | 2398 | @cindex special events |
| 2371 | Special events are handled at a very low level---as soon as they are | 2399 | Special events are handled at a very low level---as soon as they are |
| 2372 | read. The @code{read-event} function processes these events itself, and | 2400 | read. The @code{read-event} function processes these events itself, and |
| 2373 | never returns them. | 2401 | never returns them. Instead, it keeps waiting for the first event |
| 2402 | that is not special and returns that one. | ||
| 2374 | 2403 | ||
| 2375 | Events that are handled in this way do not echo, they are never grouped | 2404 | Events that are handled in this way do not echo, they are never grouped |
| 2376 | into key sequences, and they never appear in the value of | 2405 | into key sequences, and they never appear in the value of |
| @@ -2544,6 +2573,28 @@ is set to a value other than @code{nil}. If @code{inhibit-quit} is | |||
| 2544 | non-@code{nil}, then @code{quit-flag} has no special effect. | 2573 | non-@code{nil}, then @code{quit-flag} has no special effect. |
| 2545 | @end defvar | 2574 | @end defvar |
| 2546 | 2575 | ||
| 2576 | @defmac with-local-quit forms@dots{} | ||
| 2577 | This macro executes @var{forms} in sequence, but allows quitting, at | ||
| 2578 | least locally, within @var{body} even if @code{inhibit-quit} was | ||
| 2579 | non-@code{nil} outside this construct. It returns the value of the | ||
| 2580 | last form in @var{forms}. | ||
| 2581 | |||
| 2582 | If @code{inhibit-quit} is @code{nil} on entry to @code{with-local-quit}, | ||
| 2583 | it only executes the @var{forms}, and setting @code{quit-flag} causes | ||
| 2584 | a normal quit. However, if @code{inhibit-quit} is non-@code{nil} so | ||
| 2585 | that ordinary quitting is delayed, a non-@code{nil} @code{quit-flag} | ||
| 2586 | triggers a special kind of local quit. This ends the execution of | ||
| 2587 | @var{forms} and exits the @code{with-local-quit} form with | ||
| 2588 | @code{quit-flag} still non-@code{nil}, so that another (ordinary) quit | ||
| 2589 | will happen as soon as that is allowed. If @code{quit-flag} is | ||
| 2590 | already non-@code{nil} at the beginning of @var{forms}, the local quit | ||
| 2591 | happens immediately and they don't execute at all. | ||
| 2592 | |||
| 2593 | This macro is mainly useful in functions that can be called from | ||
| 2594 | timers, @code{pre-command-hook}, @code{post-command-hook} and other | ||
| 2595 | places where @code{inhibit-quit} is normally bound to @code{t}. | ||
| 2596 | @end defmac | ||
| 2597 | |||
| 2547 | @deffn Command keyboard-quit | 2598 | @deffn Command keyboard-quit |
| 2548 | This function signals the @code{quit} condition with @code{(signal 'quit | 2599 | This function signals the @code{quit} condition with @code{(signal 'quit |
| 2549 | nil)}. This is the same thing that quitting does. (See @code{signal} | 2600 | nil)}. This is the same thing that quitting does. (See @code{signal} |
| @@ -2844,25 +2895,28 @@ Disabling a command has no effect on calling it as a function from Lisp | |||
| 2844 | programs. | 2895 | programs. |
| 2845 | 2896 | ||
| 2846 | @deffn Command enable-command command | 2897 | @deffn Command enable-command command |
| 2847 | Allow @var{command} to be executed without special confirmation from now | 2898 | Allow @var{command} (a symbol) to be executed without special |
| 2848 | on, and (if the user confirms) alter the user's init file (@pxref{Init | 2899 | confirmation from now on, and alter the user's init file (@pxref{Init |
| 2849 | File}) so that this will apply to future sessions. | 2900 | File}) so that this will apply to future sessions. |
| 2850 | @end deffn | 2901 | @end deffn |
| 2851 | 2902 | ||
| 2852 | @deffn Command disable-command command | 2903 | @deffn Command disable-command command |
| 2853 | Require special confirmation to execute @var{command} from now on, and | 2904 | Require special confirmation to execute @var{command} from now on, and |
| 2854 | (if the user confirms) alter the user's init file so that this | 2905 | alter the user's init file so that this will apply to future sessions. |
| 2855 | will apply to future sessions. | ||
| 2856 | @end deffn | 2906 | @end deffn |
| 2857 | 2907 | ||
| 2858 | @defvar disabled-command-hook | 2908 | @defvar disabled-command-function |
| 2859 | When the user invokes a disabled command interactively, this normal hook | 2909 | The value of this variable should be a function. When the user |
| 2860 | is run instead of the disabled command. The hook functions can use | 2910 | invokes a disabled command interactively, this function is called |
| 2861 | @code{this-command-keys} to determine what the user typed to run the | 2911 | instead of the disabled command. It can use @code{this-command-keys} |
| 2862 | command, and thus find the command itself. @xref{Hooks}. | 2912 | to determine what the user typed to run the command, and thus find the |
| 2913 | command itself. | ||
| 2914 | |||
| 2915 | The value may also be @code{nil}. Then all commands work normally, | ||
| 2916 | even disabled ones. | ||
| 2863 | 2917 | ||
| 2864 | By default, @code{disabled-command-hook} contains a function that asks | 2918 | By default, the value is a function that asks the user whether to |
| 2865 | the user whether to proceed. | 2919 | proceed. |
| 2866 | @end defvar | 2920 | @end defvar |
| 2867 | 2921 | ||
| 2868 | @node Command History | 2922 | @node Command History |
| @@ -2918,7 +2972,7 @@ representation of a keyboard macro is a string or vector containing the | |||
| 2918 | events. Don't confuse keyboard macros with Lisp macros | 2972 | events. Don't confuse keyboard macros with Lisp macros |
| 2919 | (@pxref{Macros}). | 2973 | (@pxref{Macros}). |
| 2920 | 2974 | ||
| 2921 | @defun execute-kbd-macro kbdmacro &optional count | 2975 | @defun execute-kbd-macro kbdmacro &optional count loopfunc |
| 2922 | This function executes @var{kbdmacro} as a sequence of events. If | 2976 | This function executes @var{kbdmacro} as a sequence of events. If |
| 2923 | @var{kbdmacro} is a string or vector, then the events in it are executed | 2977 | @var{kbdmacro} is a string or vector, then the events in it are executed |
| 2924 | exactly as if they had been input by the user. The sequence is | 2978 | exactly as if they had been input by the user. The sequence is |
| @@ -2935,10 +2989,14 @@ many times. If @var{count} is omitted or @code{nil}, @var{kbdmacro} is | |||
| 2935 | executed once. If it is 0, @var{kbdmacro} is executed over and over until it | 2989 | executed once. If it is 0, @var{kbdmacro} is executed over and over until it |
| 2936 | encounters an error or a failing search. | 2990 | encounters an error or a failing search. |
| 2937 | 2991 | ||
| 2992 | If @var{loopfunc} is non-@code{nil}, it is a function that is called, | ||
| 2993 | without arguments, prior to each iteration of the macro. If | ||
| 2994 | @var{loopfunc} returns @code{nil}, then this stops execution of the macro. | ||
| 2995 | |||
| 2938 | @xref{Reading One Event}, for an example of using @code{execute-kbd-macro}. | 2996 | @xref{Reading One Event}, for an example of using @code{execute-kbd-macro}. |
| 2939 | @end defun | 2997 | @end defun |
| 2940 | 2998 | ||
| 2941 | @defvar executing-macro | 2999 | @defvar executing-kbd-macro |
| 2942 | This variable contains the string or vector that defines the keyboard | 3000 | This variable contains the string or vector that defines the keyboard |
| 2943 | macro that is currently executing. It is @code{nil} if no macro is | 3001 | macro that is currently executing. It is @code{nil} if no macro is |
| 2944 | currently executing. A command can test this variable so as to behave | 3002 | currently executing. A command can test this variable so as to behave |
| @@ -2947,10 +3005,11 @@ yourself. | |||
| 2947 | @end defvar | 3005 | @end defvar |
| 2948 | 3006 | ||
| 2949 | @defvar defining-kbd-macro | 3007 | @defvar defining-kbd-macro |
| 2950 | This variable indicates whether a keyboard macro is being defined. A | 3008 | This variable is non-@code{nil} if and only if a keyboard macro is |
| 2951 | command can test this variable so as to behave differently while a macro | 3009 | being defined. A command can test this variable so as to behave |
| 2952 | is being defined. The commands @code{start-kbd-macro} and | 3010 | differently while a macro is being defined. The commands |
| 2953 | @code{end-kbd-macro} set this variable---do not set it yourself. | 3011 | @code{start-kbd-macro} and @code{end-kbd-macro} set this variable---do |
| 3012 | not set it yourself. | ||
| 2954 | 3013 | ||
| 2955 | The variable is always local to the current terminal and cannot be | 3014 | The variable is always local to the current terminal and cannot be |
| 2956 | buffer-local. @xref{Multiple Displays}. | 3015 | buffer-local. @xref{Multiple Displays}. |
diff --git a/lispref/hooks.texi b/lispref/hooks.texi index 5c424bd8de2..ad5d709e720 100644 --- a/lispref/hooks.texi +++ b/lispref/hooks.texi | |||
| @@ -64,7 +64,7 @@ however, we have renamed all of those.) | |||
| 64 | @item diary-display-hook | 64 | @item diary-display-hook |
| 65 | @item diary-hook | 65 | @item diary-hook |
| 66 | @item dired-mode-hook | 66 | @item dired-mode-hook |
| 67 | @item disabled-command-hook | 67 | @item disabled-command-function |
| 68 | @item echo-area-clear-hook | 68 | @item echo-area-clear-hook |
| 69 | @item edit-picture-hook | 69 | @item edit-picture-hook |
| 70 | @item electric-buffer-menu-mode-hook | 70 | @item electric-buffer-menu-mode-hook |
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi index c0ee5c85881..7b762a654e6 100644 --- a/lispref/minibuf.texi +++ b/lispref/minibuf.texi | |||
| @@ -1118,6 +1118,7 @@ complete in the set of extant Lisp symbols, and it uses the | |||
| 1118 | @end defun | 1118 | @end defun |
| 1119 | 1119 | ||
| 1120 | @defun read-variable prompt &optional default | 1120 | @defun read-variable prompt &optional default |
| 1121 | @anchor{Definition of read-variable} | ||
| 1121 | This function reads the name of a user variable and returns it as a | 1122 | This function reads the name of a user variable and returns it as a |
| 1122 | symbol. | 1123 | symbol. |
| 1123 | 1124 | ||
diff --git a/lispref/objects.texi b/lispref/objects.texi index 7c8eff06295..e945f075e65 100644 --- a/lispref/objects.texi +++ b/lispref/objects.texi | |||
| @@ -411,8 +411,8 @@ represents the shifted-control-o character. | |||
| 411 | @cindex hyper characters | 411 | @cindex hyper characters |
| 412 | @cindex super characters | 412 | @cindex super characters |
| 413 | @cindex alt characters | 413 | @cindex alt characters |
| 414 | The X Window System defines three other @anchor{modifier bits} | 414 | The X Window System defines three other |
| 415 | modifier bits that can be set | 415 | @anchor{modifier bits}modifier bits that can be set |
| 416 | in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes | 416 | in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes |
| 417 | for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. (Case is | 417 | for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. (Case is |
| 418 | significant in these prefixes.) Thus, @samp{?\H-\M-\A-x} represents | 418 | significant in these prefixes.) Thus, @samp{?\H-\M-\A-x} represents |
diff --git a/lispref/os.texi b/lispref/os.texi index 3e1b93339ad..42a0613bfec 100644 --- a/lispref/os.texi +++ b/lispref/os.texi | |||
| @@ -1686,12 +1686,18 @@ finished; it receives the results of translation by | |||
| 1686 | @code{function-key-map}. | 1686 | @code{function-key-map}. |
| 1687 | 1687 | ||
| 1688 | @item | 1688 | @item |
| 1689 | @code{key-translation-map} overrides actual key bindings. For example, | 1689 | Non-prefix bindings in @code{key-translation-map} override actual key |
| 1690 | if @kbd{C-x f} has a binding in @code{key-translation-map}, that | 1690 | bindings. For example, if @kbd{C-x f} has a non-prefix binding in |
| 1691 | translation takes effect even though @kbd{C-x f} also has a key binding | 1691 | @code{key-translation-map}, that translation takes effect even though |
| 1692 | in the global map. | 1692 | @kbd{C-x f} also has a key binding in the global map. |
| 1693 | @end itemize | 1693 | @end itemize |
| 1694 | 1694 | ||
| 1695 | Note however that actual key bindings can have an effect on | ||
| 1696 | @code{key-translation-map}, even though they are overridden by it. | ||
| 1697 | Indeed, actual key bindings override @code{function-key-map} and thus | ||
| 1698 | may alter the key sequence that @code{key-translation-map} receives. | ||
| 1699 | Clearly, it is better to avoid to avoid this type of situation. | ||
| 1700 | |||
| 1695 | The intent of @code{key-translation-map} is for users to map one | 1701 | The intent of @code{key-translation-map} is for users to map one |
| 1696 | character set to another, including ordinary characters normally bound | 1702 | character set to another, including ordinary characters normally bound |
| 1697 | to @code{self-insert-command}. | 1703 | to @code{self-insert-command}. |