aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lispref/commands.texi52
1 files changed, 36 insertions, 16 deletions
diff --git a/lispref/commands.texi b/lispref/commands.texi
index ec3c972e28a..803a7c51efa 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -74,15 +74,15 @@ character causes @dfn{quitting} (@pxref{Quitting}).
74The editor command loop runs this normal hook before each command. At 74The editor command loop runs this normal hook before each command. At
75that time, @code{this-command} contains the command that is about to 75that time, @code{this-command} contains the command that is about to
76run, and @code{last-command} describes the previous command. 76run, and @code{last-command} describes the previous command.
77@xref{Hooks}. 77@xref{Command Loop Info}.
78@end defvar 78@end defvar
79 79
80@defvar post-command-hook 80@defvar post-command-hook
81The editor command loop runs this normal hook after each command 81The editor command loop runs this normal hook after each command
82(including commands terminated prematurely by quitting or by errors), 82(including commands terminated prematurely by quitting or by errors),
83and also when the command loop is first entered. At that time, 83and also when the command loop is first entered. At that time,
84@code{this-command} describes the command that just ran, and 84@code{this-command} refers to the command that just ran, and
85@code{last-command} describes the command before that. @xref{Hooks}. 85@code{last-command} refers to the command before that.
86@end defvar 86@end defvar
87 87
88 Quitting is suppressed while running @code{pre-command-hook} and 88 Quitting is suppressed while running @code{pre-command-hook} and
@@ -840,21 +840,21 @@ If the last event came from a keyboard macro, the value is @code{macro}.
840@node Adjusting Point 840@node Adjusting Point
841@section Adjusting Point After Commands 841@section Adjusting Point After Commands
842 842
843 It is not easy to display a value of point in the middle of a sequence 843 It is not easy to display a value of point in the middle of a
844of text that has the @code{display} or @code{composition} property. So 844sequence of text that has the @code{display}, @code{composition} or
845after a command finishes and returns to the command loop, if point is 845@code{intangible} property, or is invisible. Therefore, after a
846within such a sequence, the command loop normally moves point to the 846command finishes and returns to the command loop, if point is within
847edge of the sequence. 847such a sequence, the command loop normally moves point to the edge of
848the sequence.
848 849
849 A command can inhibit this feature by setting the variable 850 A command can inhibit this feature by setting the variable
850@code{disable-point-adjustment}: 851@code{disable-point-adjustment}:
851 852
852@defvar disable-point-adjustment 853@defvar disable-point-adjustment
853@tindex disable-point-adjustment 854@tindex disable-point-adjustment
854If this variable is non-@code{nil} when a command returns to the command 855If this variable is non-@code{nil} when a command returns to the
855loop, then the command loop does not check for text properties such as 856command loop, then the command loop does not check for those text
856@code{display} and @code{composition}, and does not move point out of 857properties, and does not move point out of sequences that have them.
857sequences that have these properties.
858 858
859The command loop sets this variable to @code{nil} before each command, 859The command loop sets this variable to @code{nil} before each command,
860so if a command sets it, the effect applies only to that command. 860so if a command sets it, the effect applies only to that command.
@@ -2051,7 +2051,7 @@ can use for translating or modifying input events while reading them.
2051@code{read-key-sequence}. Lisp programs can also call this function; 2051@code{read-key-sequence}. Lisp programs can also call this function;
2052for example, @code{describe-key} uses it to read the key to describe. 2052for example, @code{describe-key} uses it to read the key to describe.
2053 2053
2054@defun read-key-sequence prompt 2054@defun read-key-sequence prompt &optional continue-echo dont-downcase-last switch-frame-ok command-loop
2055@cindex key sequence 2055@cindex key sequence
2056This function reads a key sequence and returns it as a string or 2056This function reads a key sequence and returns it as a string or
2057vector. It keeps reading events until it has accumulated a complete key 2057vector. It keeps reading events until it has accumulated a complete key
@@ -2066,8 +2066,28 @@ Otherwise, it returns a vector, since a vector can hold all kinds of
2066events---characters, symbols, and lists. The elements of the string or 2066events---characters, symbols, and lists. The elements of the string or
2067vector are the events in the key sequence. 2067vector are the events in the key sequence.
2068 2068
2069The argument @var{prompt} is either a string to be displayed in the echo 2069The argument @var{prompt} is either a string to be displayed in the
2070area as a prompt, or @code{nil}, meaning not to display a prompt. 2070echo area as a prompt, or @code{nil}, meaning not to display a prompt.
2071The argument @var{continue-echo}, if non-@code{nil}, means to echo
2072this key as a continuation of the previous key.
2073
2074Normally any upper case event is converted to lower case if the
2075original event is undefined and the lower case equivalent is defined.
2076The argument @var{dont-downcase-last}, if non-@code{nil}, means do not
2077convert the last event to lower case. This is appropriate for reading
2078a key sequence to be defined.
2079
2080The argument @var{switch-frame-ok}, if non-@code{nil}, means that this
2081function should process a @code{switch-frame} event if the user
2082switches frames before typing anything. If the user switches frames
2083in the middle of a key sequence, or at the start of the sequence but
2084@var{switch-frame-ok} is @code{nil}, then the event will be put off
2085until after the current key sequence.
2086
2087The argument @var{command-loop}, if non-@code{nil}, means that this
2088key sequence is being read by something that will read commands one
2089after another. It should be @code{nil} if the caller will read just
2090one key sequence.
2071 2091
2072In the example below, the prompt @samp{?} is displayed in the echo area, 2092In the example below, the prompt @samp{?} is displayed in the echo area,
2073and the user types @kbd{C-x C-f}. 2093and the user types @kbd{C-x C-f}.
@@ -2089,7 +2109,7 @@ typed while reading with this function works like any other character,
2089and does not set @code{quit-flag}. @xref{Quitting}. 2109and does not set @code{quit-flag}. @xref{Quitting}.
2090@end defun 2110@end defun
2091 2111
2092@defun read-key-sequence-vector prompt 2112@defun read-key-sequence-vector prompt &optional continue-echo dont-downcase-last switch-frame-ok command-loop
2093This is like @code{read-key-sequence} except that it always 2113This is like @code{read-key-sequence} except that it always
2094returns the key sequence as a vector, never as a string. 2114returns the key sequence as a vector, never as a string.
2095@xref{Strings of Events}. 2115@xref{Strings of Events}.