]> code.delx.au - gnu-emacs/blobdiff - lispref/commands.texi
Fix typo.
[gnu-emacs] / lispref / commands.texi
index f5e4f90f357b53576cf7f28ddc1875c9e96db41e..4a204f5f6e716b6ffa2eae1fc56d74610cbd0c28 100644 (file)
@@ -1,6 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998 Free Software Foundation, Inc. 
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999
+@c   Free Software Foundation, Inc. 
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/commands
 @node Command Loop, Keymaps, Minibuffers, Top
@@ -18,6 +19,7 @@ are done, and the subroutines that allow Lisp programs to do them.
 * Defining Commands::   Specifying how a function should read arguments.
 * Interactive Call::    Calling a command, so that it will read arguments.
 * Command Loop Info::   Variables set by the command loop for you to examine.
+* Adjusting Point::     Adjustment of point after a command.
 * Input Events::       What input looks like when you read it.
 * Reading Input::       How to read input events from the keyboard or mouse.
 * Special Events::      Events processed immediately and individually.
@@ -524,7 +526,7 @@ The argument @var{keys}, if given, specifies the sequence of events to
 supply if the command inquires which events were used to invoke it.
 @end defun
 
-@defun command-execute command &optional record-flag keys
+@defun command-execute command &optional record-flag keys special
 @cindex keyboard macro execution
 This function executes @var{command}.  The argument @var{command} must
 satisfy the @code{commandp} predicate; i.e., it must be an interactively
@@ -542,6 +544,10 @@ rechecking the definition of the symbol.
 
 The argument @var{keys}, if given, specifies the sequence of events to
 supply if the command inquires which events were used to invoke it.
+
+The argument @var{special}, if given, means to ignore the prefix
+argument and not clear it.  This is used for executing special events
+(@pxref{Special Events}).
 @end defun
 
 @deffn Command execute-extended-command prefix-argument
@@ -661,7 +667,6 @@ This variable is always local to the current terminal and cannot be
 buffer-local.  @xref{Multiple Displays}.
 @end defvar
 
-@tindex real-last-command
 @defvar real-last-command
 This variable is set up by Emacs just like @code{last-command},
 but never altered by Lisp programs.
@@ -722,9 +727,9 @@ if all those events were characters.  @xref{Input Events}.
 @end defun
 
 @defun this-command-keys-vector
-Like @code{this-command-keys}, except that it always returns
-the events in a vector, so you do never need to deal with the complexities
-of storing input events in a string (@pxref{Strings of Events}).
+Like @code{this-command-keys}, except that it always returns the events
+in a vector, so you don't need to deal with the complexities of storing
+input events in a string (@pxref{Strings of Events}).
 @end defun
 
 @tindex clear-this-command-keys
@@ -775,6 +780,35 @@ frame, the value is the frame to which the event was redirected.
 @xref{Input Focus}.
 @end defvar
 
+@node Adjusting Point
+@section Adjusting Point After Commands
+
+  It is not easy to display a value of point in the middle of a sequence
+of text that has the @code{display} or @code{composition} property.  So
+after a command finishes and returns to the command loop, if point is
+within such a sequence, the command loop normally moves point to the
+edge of the sequence.
+
+  A command can inhibit this feature by setting the variable
+@code{disable-point-adjustment}:
+
+@defvar disable-point-adjustment
+@tindex disable-point-adjustment
+If this variable is non-@code{nil} when a command returns to the command
+loop, then the command loop does not check for text properties such as
+@code{display} and @code{composition}, and does not move point out of
+sequences that have these properties.
+
+The command loop sets this variable to @code{nil} before each command,
+so if a command sets it, the effect applies only to that command.
+@end defvar
+
+@defvar global-disable-point-adjustment
+@tindex global-disable-point-adjustment
+If you set this variable to a non-@code{nil} value, the feature of
+moving point out of these sequences is completely turned off.
+@end defvar
+
 @node Input Events
 @section Input Events
 @cindex events
@@ -836,9 +870,9 @@ The
 @tex
 @math{2^{27}}
 @end tex
-@ifinfo
+@ifnottex
 2**27
-@end ifinfo
+@end ifnottex
 bit in the character code indicates a character
 typed with the meta key held down.
 
@@ -847,9 +881,9 @@ The
 @tex
 @math{2^{26}}
 @end tex
-@ifinfo
+@ifnottex
 2**26
-@end ifinfo
+@end ifnottex
 bit in the character code indicates a non-@sc{ascii}
 control character.
 
@@ -863,9 +897,9 @@ for @kbd{%} plus
 @tex
 @math{2^{26}}
 @end tex
-@ifinfo
+@ifnottex
 2**26
-@end ifinfo
+@end ifnottex
 (assuming the terminal supports non-@sc{ascii}
 control characters).
 
@@ -874,9 +908,9 @@ The
 @tex
 @math{2^{25}}
 @end tex
-@ifinfo
+@ifnottex
 2**25
-@end ifinfo
+@end ifnottex
 bit in the character code indicates an @sc{ascii} control
 character typed with the shift key held down.
 
@@ -887,9 +921,9 @@ character with a different basic code.  In order to keep within the
 @tex
 @math{2^{25}}
 @end tex
-@ifinfo
+@ifnottex
 2**25
-@end ifinfo
+@end ifnottex
 bit for those characters.
 
 However, @sc{ascii} provides no way to distinguish @kbd{C-A} from
@@ -897,9 +931,9 @@ However, @sc{ascii} provides no way to distinguish @kbd{C-A} from
 @tex
 @math{2^{25}}
 @end tex
-@ifinfo
+@ifnottex
 2**25
-@end ifinfo
+@end ifnottex
 bit in @kbd{C-A} and not in
 @kbd{C-a}.
 
@@ -908,9 +942,9 @@ The
 @tex
 @math{2^{24}}
 @end tex
-@ifinfo
+@ifnottex
 2**24
-@end ifinfo
+@end ifnottex
 bit in the character code indicates a character
 typed with the hyper key held down.
 
@@ -919,9 +953,9 @@ The
 @tex
 @math{2^{23}}
 @end tex
-@ifinfo
+@ifnottex
 2**23
-@end ifinfo
+@end ifnottex
 bit in the character code indicates a character
 typed with the super key held down.
 
@@ -930,9 +964,9 @@ The
 @tex
 @math{2^{22}}
 @end tex
-@ifinfo
+@ifnottex
 2**22
-@end ifinfo
+@end ifnottex
 bit in the character code indicates a character typed with
 the alt key held down.  (On some terminals, the key labeled @key{ALT}
 is actually the meta key.)
@@ -1112,9 +1146,10 @@ the entire scroll bar.
 
 If the position is on a mode line or the vertical line separating
 @var{window} from its neighbor to the right, then @var{buffer-pos} is
-the symbol @code{mode-line} or @code{vertical-line}.  For the mode line,
-@var{y} does not have meaningful data.  For the vertical line, @var{x}
-does not have meaningful data.
+the symbol @code{mode-line}, @code{header-line}, or
+@code{vertical-line}.  For the mode line, @var{y} does not have
+meaningful data.  For the vertical line, @var{x} does not have
+meaningful data.
 
 In one special case, @var{buffer-pos} is a list containing a symbol (one
 of the symbols listed above) instead of just the symbol.  This happens
@@ -1187,6 +1222,7 @@ motion (by reading motion events) until the button is released.
 @cindex repeat events
 @cindex double-click events
 @cindex triple-click events
+@cindex mouse events, repeated
 
 If you press the same mouse button more than once in quick succession
 without moving the mouse, Emacs generates special @dfn{repeat} mouse
@@ -1256,9 +1292,16 @@ the value is 3 or greater.  If @var{event} is an ordinary mouse event
 (not a repeat event), the value is 1.
 @end defun
 
-@defvar double-click-time
+@defvar double-click-fuzz
 To generate repeat events, successive mouse button presses must be at
-the same screen position, and the number of milliseconds between
+approximately the same screen position.  The value of
+@code{double-click-fuzz} specifies the maximum number of pixels the
+mouse may be moved between two successive clicks to make a
+double-click.
+@end defvar
+
+@defvar double-click-time
+To generate repeat events, the number of milliseconds between
 successive button presses must be less than the value of
 @code{double-click-time}.  Setting @code{double-click-time} to
 @code{nil} disables multi-click detection entirely.  Setting it to
@@ -1524,6 +1567,8 @@ to an event type which specifies all of them.  For example,
 
 @node Accessing Events
 @subsection Accessing Events
+@cindex mouse events, accessing the data
+@cindex accessing data of mouse events
 
   This section describes convenient functions for accessing the data in
 a mouse button or motion event.
@@ -1552,6 +1597,7 @@ event, the value is actually the starting position, which is the only
 position such events have.
 @end defun
 
+@cindex mouse position list, accessing
   These five functions take a position list as described above, and
 return various parts of it.
 
@@ -1574,6 +1620,8 @@ a cons cell @code{(@var{col} . @var{row})}.  These are computed from the
 @var{x} and @var{y} values actually found in @var{position}.
 @end defun
 
+@cindex mouse event, timestamp
+@cindex timestamp of a mouse event
 @defun posn-timestamp position
 Return the timestamp in @var{position}.
 @end defun
@@ -1609,6 +1657,8 @@ of a pair of x and y coordinates.
 
 @node Strings of Events
 @subsection Putting Keyboard Events in Strings
+@cindex keyboard events in strings
+@cindex strings with keyboard events
 
   In most of the places where strings are used, we conceptualize the
 string as containing text characters---the same kind of characters found
@@ -1659,9 +1709,9 @@ character is
 @tex
 @math{2^{27}}
 @end tex
-@ifinfo
+@ifnottex
 2**27
-@end ifinfo
+@end ifnottex
 and such numbers cannot be included in a string.
 
   To support programs with @samp{\M-} in string constants, there are
@@ -1679,31 +1729,31 @@ The meta variants of those characters, with codes in the range of
 @tex
 @math{2^{27}}
 @end tex
-@ifinfo
+@ifnottex
 2**27
-@end ifinfo
+@end ifnottex
 to
 @tex
 @math{2^{27} + 127},
 @end tex
-@ifinfo
+@ifnottex
 2**27+127,
-@end ifinfo
+@end ifnottex
 can also go in the string, but you must change their
 numeric values.  You must set the
 @tex
 @math{2^{7}}
 @end tex
-@ifinfo
+@ifnottex
 2**7
-@end ifinfo
+@end ifnottex
 bit instead of the
 @tex
 @math{2^{27}}
 @end tex
-@ifinfo
+@ifnottex
 2**27
-@end ifinfo
+@end ifnottex
 bit, resulting in a value between 128 and 255.  Only a unibyte string
 can include these codes.
 
@@ -1813,17 +1863,24 @@ button-down events entirely.  It also reshuffles focus events and
 miscellaneous window events so that they never appear in a key sequence
 with any other events.
 
+@cindex @code{header-line} prefix key
+@cindex @code{mode-line} prefix key
+@cindex @code{vertical-line} prefix key
+@cindex @code{horizontal-scroll-bar} prefix key
+@cindex @code{vertical-scroll-bar} prefix key
+@cindex @code{menu-bar} prefix key
+@cindex mouse events, in special parts of frame
 When mouse events occur in special parts of a window, such as a mode
 line or a scroll bar, the event type shows nothing special---it is the
 same symbol that would normally represent that combination of mouse
 button and modifier keys.  The information about the window part is kept
 elsewhere in the event---in the coordinates.  But
 @code{read-key-sequence} translates this information into imaginary
-``prefix keys'', all of which are symbols: @code{mode-line},
-@code{vertical-line}, @code{horizontal-scroll-bar} and
-@code{vertical-scroll-bar}.  You can define meanings for mouse clicks in
-special window parts by defining key sequences using these imaginary
-prefix keys.
+``prefix keys'', all of which are symbols: @code{header-line},
+@code{horizontal-scroll-bar}, @code{menu-bar}, @code{mode-line},
+@code{vertical-line}, and @code{vertical-scroll-bar}.  You can define
+meanings for mouse clicks in special window parts by defining key
+sequences using these imaginary prefix keys.
 
 For example, if you call @code{read-key-sequence} and then click the
 mouse on the window's mode line, you get two events, like this:
@@ -1844,13 +1901,14 @@ and key sequences read from keyboard macros being executed.
 @end defvar
 
 @defvar num-nonmacro-input-events
-@tindex num-nonmacro-input-events
 This variable holds the total number of input events received so far
 from the terminal---not counting those generated by keyboard macros.
 @end defvar
 
 @node Reading One Event
 @subsection Reading One Event
+@cindex reading a single event
+@cindex event, reading only one
 
   The lowest level functions for command input are those that read a
 single event.
@@ -1955,7 +2013,8 @@ buffer.
   The input method function should return a list of events which should
 be used as input.  (If the list is @code{nil}, that means there is no
 input, so @code{read-event} waits for another event.)  These events are
-processed before the events in @code{unread-command-events}.  Events
+processed before the events in @code{unread-command-events}
+(@pxref{Event Input Misc}).  Events
 returned by the input method function are not passed to the input method
 function again, even if they are printing characters with no modifier
 bits.
@@ -2418,7 +2477,6 @@ that specify prefix arguments for the following command work by setting
 this variable.
 @end defvar
 
-@tindex last-prefix-arg
 @defvar last-prefix-arg
 The raw prefix argument value used by the previous command.
 @end defvar
@@ -2573,15 +2631,15 @@ the commands by accident.
   The low-level mechanism for disabling a command is to put a
 non-@code{nil} @code{disabled} property on the Lisp symbol for the
 command.  These properties are normally set up by the user's
-@file{.emacs} file with Lisp expressions such as this:
+init file (@pxref{Init File}) with Lisp expressions such as this:
 
 @example
 (put 'upcase-region 'disabled t)
 @end example
 
 @noindent
-For a few commands, these properties are present by default and may be
-removed by the @file{.emacs} file.
+For a few commands, these properties are present by default (you can
+remove them in your init file if you wish).
 
   If the value of the @code{disabled} property is a string, the message
 saying the command is disabled includes that string.  For example:
@@ -2598,13 +2656,13 @@ programs.
 
 @deffn Command enable-command command
 Allow @var{command} to be executed without special confirmation from now
-on, and (if the user confirms) alter the user's @file{.emacs} file so
-that this will apply to future sessions.
+on, and (if the user confirms) alter the user's init file (@pxref{Init
+File}) so that this will apply to future sessions.
 @end deffn
 
 @deffn Command disable-command command
 Require special confirmation to execute @var{command} from now on, and
-(if the user confirms) alter the user's @file{.emacs} file so that this
+(if the user confirms) alter the user's init file so that this
 will apply to future sessions.
 @end deffn