aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2008-10-15 16:47:35 +0000
committerEli Zaretskii2008-10-15 16:47:35 +0000
commitee6e73b8d939430ec9647114d84fa79085c81025 (patch)
tree2d5018adfa0251f09e91f49ae78819674776b1d7
parent0c69125233377bcca90fc7fca5ed5d7db7010937 (diff)
downloademacs-ee6e73b8d939430ec9647114d84fa79085c81025.tar.gz
emacs-ee6e73b8d939430ec9647114d84fa79085c81025.zip
(Using Interactive, Interactive Codes): Document `^'.
(Interactive Examples): Show an example of `^'. (Key Sequence Input): Document this-command-keys-shift-translated.
-rw-r--r--doc/lispref/commands.texi44
1 files changed, 37 insertions, 7 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index bf52b770f18..9928379e82f 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -186,20 +186,31 @@ give to that buffer:
186 186
187@cindex @samp{*} in @code{interactive} 187@cindex @samp{*} in @code{interactive}
188@cindex read-only buffers in interactive 188@cindex read-only buffers in interactive
189If the first character in the string is @samp{*}, then an error is 189If @samp{*} appears at the beginning of the string, then an error is
190signaled if the buffer is read-only. 190signaled if the buffer is read-only.
191 191
192@cindex @samp{@@} in @code{interactive} 192@cindex @samp{@@} in @code{interactive}
193@c Emacs 19 feature 193@c Emacs 19 feature
194If the first character in the string is @samp{@@}, and if the key 194If @samp{@@} appears at the beginning of the string, and if the key
195sequence used to invoke the command includes any mouse events, then 195sequence used to invoke the command includes any mouse events, then
196the window associated with the first of those events is selected 196the window associated with the first of those events is selected
197before the command is run. 197before the command is run.
198 198
199You can use @samp{*} and @samp{@@} together; the order does not matter. 199@cindex @samp{^} in @code{interactive}
200Actual reading of arguments is controlled by the rest of the prompt 200@cindex shift-selection, and @code{interactive} spec
201string (starting with the first character that is not @samp{*} or 201If @samp{^} appears at the beginning of the string, and if the command
202@samp{@@}). 202was invoked through @dfn{shift-translation}, set the mark and activate
203the region temporarily, or extend an already active region, before the
204command is run. If the command was invoked without shift-translation,
205and the region is temporarily active, deactivate the region before the
206command is run. Shift-translation is controlled on the user level by
207@code{shift-select-mode}; see @ref{Shift Selection,,, emacs, The GNU
208Emacs Manual}.
209
210You can use @samp{*}, @samp{@@}, and @code{^} together; the order does
211not matter. Actual reading of arguments is controlled by the rest of
212the prompt string (starting with the first character that is not
213@samp{*}, @samp{@@}, or @samp{^}).
203 214
204@item 215@item
205It may be a Lisp expression that is not a string; then it should be a 216It may be a Lisp expression that is not a string; then it should be a
@@ -316,6 +327,13 @@ Signal an error if the current buffer is read-only. Special.
316Select the window mentioned in the first mouse event in the key 327Select the window mentioned in the first mouse event in the key
317sequence that invoked this command. Special. 328sequence that invoked this command. Special.
318 329
330@item ^
331If the command was invoked through shift-translation, set the mark and
332activate the region temporarily, or extend an already active region,
333before the command is run. If the command was invoked without
334shift-translation, and the region is temporarily active, deactivate
335the region before the command is run. Special.
336
319@item a 337@item a
320A function name (i.e., a symbol satisfying @code{fboundp}). Existing, 338A function name (i.e., a symbol satisfying @code{fboundp}). Existing,
321Completion, Prompt. 339Completion, Prompt.
@@ -492,7 +510,9 @@ argument value. Completion, Existing, Prompt.
492 510
493@group 511@group
494(defun foo2 (n) ; @r{@code{foo2} takes one argument,} 512(defun foo2 (n) ; @r{@code{foo2} takes one argument,}
495 (interactive "p") ; @r{which is the numeric prefix.} 513 (interactive "^p") ; @r{which is the numeric prefix.}
514 ; @r{under @code{shift-select-mode},}
515 ; @r{will activate or extend region.}
496 (forward-word (* 2 n))) 516 (forward-word (* 2 n)))
497 @result{} foo2 517 @result{} foo2
498@end group 518@end group
@@ -2214,11 +2234,21 @@ returns the key sequence as a vector, never as a string.
2214 2234
2215@cindex upper case key sequence 2235@cindex upper case key sequence
2216@cindex downcasing in @code{lookup-key} 2236@cindex downcasing in @code{lookup-key}
2237@cindex shift-translation
2217If an input character is upper-case (or has the shift modifier) and 2238If an input character is upper-case (or has the shift modifier) and
2218has no key binding, but its lower-case equivalent has one, then 2239has no key binding, but its lower-case equivalent has one, then
2219@code{read-key-sequence} converts the character to lower case. Note 2240@code{read-key-sequence} converts the character to lower case. Note
2220that @code{lookup-key} does not perform case conversion in this way. 2241that @code{lookup-key} does not perform case conversion in this way.
2221 2242
2243@vindex this-command-keys-shift-translated
2244When reading input results in such a @dfn{shift-translation}, Emacs
2245sets the variable @code{this-command-keys-shift-translated} to a
2246non-nil value. Lisp programs can examine this variable if they need
2247to modify their behavior when invoked by shift-translated keys. For
2248example, the function @code{handle-shift-selection} examines the value
2249of this variable to determine how to activate or deactivate the region
2250(@pxref{The Mark, handle-shift-selection}).
2251
2222The function @code{read-key-sequence} also transforms some mouse events. 2252The function @code{read-key-sequence} also transforms some mouse events.
2223It converts unbound drag events into click events, and discards unbound 2253It converts unbound drag events into click events, and discards unbound
2224button-down events entirely. It also reshuffles focus events and 2254button-down events entirely. It also reshuffles focus events and