comparison lispref/commands.texi @ 52978:1a5c50faf357

Replace @sc{foo} with @acronym{FOO}.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 02 Nov 2003 06:29:59 +0000
parents fe75563f4d13
children fb4a34f4191c
comparison
equal deleted inserted replaced
52977:8af8c70252c1 52978:1a5c50faf357
338 338
339 You can use @samp{e} more than once in a single command's interactive 339 You can use @samp{e} more than once in a single command's interactive
340 specification. If the key sequence that invoked the command has 340 specification. If the key sequence that invoked the command has
341 @var{n} events that are lists, the @var{n}th @samp{e} provides the 341 @var{n} events that are lists, the @var{n}th @samp{e} provides the
342 @var{n}th such event. Events that are not lists, such as function keys 342 @var{n}th such event. Events that are not lists, such as function keys
343 and @sc{ascii} characters, do not count where @samp{e} is concerned. 343 and @acronym{ASCII} characters, do not count where @samp{e} is concerned.
344 344
345 @item f 345 @item f
346 A file name of an existing file (@pxref{File Names}). The default 346 A file name of an existing file (@pxref{File Names}). The default
347 directory is @code{default-directory}. Existing, Completion, Default, 347 directory is @code{default-directory}. Existing, Completion, Default,
348 Prompt. 348 Prompt.
795 @result{} 5 795 @result{} 5
796 @end group 796 @end group
797 @end example 797 @end example
798 798
799 @noindent 799 @noindent
800 The value is 5 because that is the @sc{ascii} code for @kbd{C-e}. 800 The value is 5 because that is the @acronym{ASCII} code for @kbd{C-e}.
801 801
802 The alias @code{last-command-char} exists for compatibility with 802 The alias @code{last-command-char} exists for compatibility with
803 Emacs version 18. 803 Emacs version 18.
804 @end defvar 804 @end defvar
805 805
914 @math{2^{26}} 914 @math{2^{26}}
915 @end tex 915 @end tex
916 @ifnottex 916 @ifnottex
917 2**26 917 2**26
918 @end ifnottex 918 @end ifnottex
919 bit in the character code indicates a non-@sc{ascii} 919 bit in the character code indicates a non-@acronym{ASCII}
920 control character. 920 control character.
921 921
922 @sc{ascii} control characters such as @kbd{C-a} have special basic 922 @sc{ascii} control characters such as @kbd{C-a} have special basic
923 codes of their own, so Emacs needs no special bit to indicate them. 923 codes of their own, so Emacs needs no special bit to indicate them.
924 Thus, the code for @kbd{C-a} is just 1. 924 Thus, the code for @kbd{C-a} is just 1.
925 925
926 But if you type a control combination not in @sc{ascii}, such as 926 But if you type a control combination not in @acronym{ASCII}, such as
927 @kbd{%} with the control key, the numeric value you get is the code 927 @kbd{%} with the control key, the numeric value you get is the code
928 for @kbd{%} plus 928 for @kbd{%} plus
929 @tex 929 @tex
930 @math{2^{26}} 930 @math{2^{26}}
931 @end tex 931 @end tex
932 @ifnottex 932 @ifnottex
933 2**26 933 2**26
934 @end ifnottex 934 @end ifnottex
935 (assuming the terminal supports non-@sc{ascii} 935 (assuming the terminal supports non-@acronym{ASCII}
936 control characters). 936 control characters).
937 937
938 @item shift 938 @item shift
939 The 939 The
940 @tex 940 @tex
941 @math{2^{25}} 941 @math{2^{25}}
942 @end tex 942 @end tex
943 @ifnottex 943 @ifnottex
944 2**25 944 2**25
945 @end ifnottex 945 @end ifnottex
946 bit in the character code indicates an @sc{ascii} control 946 bit in the character code indicates an @acronym{ASCII} control
947 character typed with the shift key held down. 947 character typed with the shift key held down.
948 948
949 For letters, the basic code itself indicates upper versus lower case; 949 For letters, the basic code itself indicates upper versus lower case;
950 for digits and punctuation, the shift key selects an entirely different 950 for digits and punctuation, the shift key selects an entirely different
951 character with a different basic code. In order to keep within the 951 character with a different basic code. In order to keep within the
952 @sc{ascii} character set whenever possible, Emacs avoids using the 952 @acronym{ASCII} character set whenever possible, Emacs avoids using the
953 @tex 953 @tex
954 @math{2^{25}} 954 @math{2^{25}}
955 @end tex 955 @end tex
956 @ifnottex 956 @ifnottex
957 2**25 957 2**25
958 @end ifnottex 958 @end ifnottex
959 bit for those characters. 959 bit for those characters.
960 960
961 However, @sc{ascii} provides no way to distinguish @kbd{C-A} from 961 However, @acronym{ASCII} provides no way to distinguish @kbd{C-A} from
962 @kbd{C-a}, so Emacs uses the 962 @kbd{C-a}, so Emacs uses the
963 @tex 963 @tex
964 @math{2^{25}} 964 @math{2^{25}}
965 @end tex 965 @end tex
966 @ifnottex 966 @ifnottex
1030 Here are a few special cases in the symbol-naming convention for 1030 Here are a few special cases in the symbol-naming convention for
1031 function keys: 1031 function keys:
1032 1032
1033 @table @asis 1033 @table @asis
1034 @item @code{backspace}, @code{tab}, @code{newline}, @code{return}, @code{delete} 1034 @item @code{backspace}, @code{tab}, @code{newline}, @code{return}, @code{delete}
1035 These keys correspond to common @sc{ascii} control characters that have 1035 These keys correspond to common @acronym{ASCII} control characters that have
1036 special keys on most keyboards. 1036 special keys on most keyboards.
1037 1037
1038 In @sc{ascii}, @kbd{C-i} and @key{TAB} are the same character. If the 1038 In @acronym{ASCII}, @kbd{C-i} and @key{TAB} are the same character. If the
1039 terminal can distinguish between them, Emacs conveys the distinction to 1039 terminal can distinguish between them, Emacs conveys the distinction to
1040 Lisp programs by representing the former as the integer 9, and the 1040 Lisp programs by representing the former as the integer 9, and the
1041 latter as the symbol @code{tab}. 1041 latter as the symbol @code{tab}.
1042 1042
1043 Most of the time, it's not useful to distinguish the two. So normally 1043 Most of the time, it's not useful to distinguish the two. So normally
1045 @code{tab} into 9. Thus, a key binding for character code 9 (the 1045 @code{tab} into 9. Thus, a key binding for character code 9 (the
1046 character @kbd{C-i}) also applies to @code{tab}. Likewise for the other 1046 character @kbd{C-i}) also applies to @code{tab}. Likewise for the other
1047 symbols in this group. The function @code{read-char} likewise converts 1047 symbols in this group. The function @code{read-char} likewise converts
1048 these events into characters. 1048 these events into characters.
1049 1049
1050 In @sc{ascii}, @key{BS} is really @kbd{C-h}. But @code{backspace} 1050 In @acronym{ASCII}, @key{BS} is really @kbd{C-h}. But @code{backspace}
1051 converts into the character code 127 (@key{DEL}), not into code 8 1051 converts into the character code 127 (@key{DEL}), not into code 8
1052 (@key{BS}). This is what most users prefer. 1052 (@key{BS}). This is what most users prefer.
1053 1053
1054 @item @code{left}, @code{up}, @code{right}, @code{down} 1054 @item @code{left}, @code{up}, @code{right}, @code{down}
1055 Cursor arrow keys 1055 Cursor arrow keys
1094 @node Mouse Events 1094 @node Mouse Events
1095 @subsection Mouse Events 1095 @subsection Mouse Events
1096 1096
1097 Emacs supports four kinds of mouse events: click events, drag events, 1097 Emacs supports four kinds of mouse events: click events, drag events,
1098 button-down events, and motion events. All mouse events are represented 1098 button-down events, and motion events. All mouse events are represented
1099 as lists. The @sc{car} of the list is the event type; this says which 1099 as lists. The @acronym{CAR} of the list is the event type; this says which
1100 mouse button was involved, and which modifier keys were used with it. 1100 mouse button was involved, and which modifier keys were used with it.
1101 The event type can also distinguish double or triple button presses 1101 The event type can also distinguish double or triple button presses
1102 (@pxref{Repeat Events}). The rest of the list elements give position 1102 (@pxref{Repeat Events}). The rest of the list elements give position
1103 and time information. 1103 and time information.
1104 1104
1519 1519
1520 Every event has an @dfn{event type}, which classifies the event for 1520 Every event has an @dfn{event type}, which classifies the event for
1521 key binding purposes. For a keyboard event, the event type equals the 1521 key binding purposes. For a keyboard event, the event type equals the
1522 event value; thus, the event type for a character is the character, and 1522 event value; thus, the event type for a character is the character, and
1523 the event type for a function key symbol is the symbol itself. For 1523 the event type for a function key symbol is the symbol itself. For
1524 events that are lists, the event type is the symbol in the @sc{car} of 1524 events that are lists, the event type is the symbol in the @acronym{CAR} of
1525 the list. Thus, the event type is always a symbol or a character. 1525 the list. Thus, the event type is always a symbol or a character.
1526 1526
1527 Two events of the same type are equivalent where key bindings are 1527 Two events of the same type are equivalent where key bindings are
1528 concerned; thus, they always run the same command. That does not 1528 concerned; thus, they always run the same command. That does not
1529 necessarily mean they do the same things, however, as some commands look 1529 necessarily mean they do the same things, however, as some commands look
1808 @end ifnottex 1808 @end ifnottex
1809 bit, resulting in a value between 128 and 255. Only a unibyte string 1809 bit, resulting in a value between 128 and 255. Only a unibyte string
1810 can include these codes. 1810 can include these codes.
1811 1811
1812 @item 1812 @item
1813 Non-@sc{ascii} characters above 256 can be included in a multibyte string. 1813 Non-@acronym{ASCII} characters above 256 can be included in a multibyte string.
1814 1814
1815 @item 1815 @item
1816 Other keyboard character events cannot fit in a string. This includes 1816 Other keyboard character events cannot fit in a string. This includes
1817 keyboard events in the range of 128 to 255. 1817 keyboard events in the range of 128 to 255.
1818 @end itemize 1818 @end itemize
1977 the events that led to or were read by the current command. @xref{The 1977 the events that led to or were read by the current command. @xref{The
1978 Echo Area}. 1978 Echo Area}.
1979 1979
1980 If @var{inherit-input-method} is non-@code{nil}, then the current input 1980 If @var{inherit-input-method} is non-@code{nil}, then the current input
1981 method (if any) is employed to make it possible to enter a 1981 method (if any) is employed to make it possible to enter a
1982 non-@sc{ascii} character. Otherwise, input method handling is disabled 1982 non-@acronym{ASCII} character. Otherwise, input method handling is disabled
1983 for reading this event. 1983 for reading this event.
1984 1984
1985 If @code{cursor-in-echo-area} is non-@code{nil}, then @code{read-event} 1985 If @code{cursor-in-echo-area} is non-@code{nil}, then @code{read-event}
1986 moves the cursor temporarily to the echo area, to the end of any message 1986 moves the cursor temporarily to the echo area, to the end of any message
1987 displayed there. Otherwise @code{read-event} does not move the cursor. 1987 displayed there. Otherwise @code{read-event} does not move the cursor.
2007 This function reads and returns a character of command input. If the 2007 This function reads and returns a character of command input. If the
2008 user generates an event which is not a character (i.e. a mouse click or 2008 user generates an event which is not a character (i.e. a mouse click or
2009 function key event), @code{read-char} signals an error. The arguments 2009 function key event), @code{read-char} signals an error. The arguments
2010 work as in @code{read-event}. 2010 work as in @code{read-event}.
2011 2011
2012 In the first example, the user types the character @kbd{1} (@sc{ascii} 2012 In the first example, the user types the character @kbd{1} (@acronym{ASCII}
2013 code 49). The second example shows a keyboard macro definition that 2013 code 49). The second example shows a keyboard macro definition that
2014 calls @code{read-char} from the minibuffer using @code{eval-expression}. 2014 calls @code{read-char} from the minibuffer using @code{eval-expression}.
2015 @code{read-char} reads the keyboard macro's very next character, which 2015 @code{read-char} reads the keyboard macro's very next character, which
2016 is @kbd{1}. Then @code{eval-expression} displays its return value in 2016 is @kbd{1}. Then @code{eval-expression} displays its return value in
2017 the echo area. 2017 the echo area.
2187 @defvarx last-input-char 2187 @defvarx last-input-char
2188 This variable records the last terminal input event read, whether 2188 This variable records the last terminal input event read, whether
2189 as part of a command or explicitly by a Lisp program. 2189 as part of a command or explicitly by a Lisp program.
2190 2190
2191 In the example below, the Lisp program reads the character @kbd{1}, 2191 In the example below, the Lisp program reads the character @kbd{1},
2192 @sc{ascii} code 49. It becomes the value of @code{last-input-event}, 2192 @acronym{ASCII} code 49. It becomes the value of @code{last-input-event},
2193 while @kbd{C-e} (we assume @kbd{C-x C-e} command is used to evaluate 2193 while @kbd{C-e} (we assume @kbd{C-x C-e} command is used to evaluate
2194 this expression) remains the value of @code{last-command-event}. 2194 this expression) remains the value of @code{last-command-event}.
2195 2195
2196 @example 2196 @example
2197 @group 2197 @group
2511 @defun prefix-numeric-value arg 2511 @defun prefix-numeric-value arg
2512 This function returns the numeric meaning of a valid raw prefix argument 2512 This function returns the numeric meaning of a valid raw prefix argument
2513 value, @var{arg}. The argument may be a symbol, a number, or a list. 2513 value, @var{arg}. The argument may be a symbol, a number, or a list.
2514 If it is @code{nil}, the value 1 is returned; if it is @code{-}, the 2514 If it is @code{nil}, the value 1 is returned; if it is @code{-}, the
2515 value @minus{}1 is returned; if it is a number, that number is returned; 2515 value @minus{}1 is returned; if it is a number, that number is returned;
2516 if it is a list, the @sc{car} of that list (which should be a number) is 2516 if it is a list, the @acronym{CAR} of that list (which should be a number) is
2517 returned. 2517 returned.
2518 @end defun 2518 @end defun
2519 2519
2520 @defvar current-prefix-arg 2520 @defvar current-prefix-arg
2521 This variable holds the raw prefix argument for the @emph{current} 2521 This variable holds the raw prefix argument for the @emph{current}