aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorMiles Bader2006-02-04 01:01:38 +0000
committerMiles Bader2006-02-04 01:01:38 +0000
commit307f5c57467e8e967f795d47ec885bf19fd5317f (patch)
tree937b5ce4db7094b06d5c1cf58413ca49b860e5db /lispref
parent50d4fbde0cd35834e2fc9f0adc4c189657ba7170 (diff)
parent6203370b5e51fe55a4132fe8ccc868c35ad8c67f (diff)
downloademacs-307f5c57467e8e967f795d47ec885bf19fd5317f.tar.gz
emacs-307f5c57467e8e967f795d47ec885bf19fd5317f.zip
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-11
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 34-42) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 14-17) - Update from CVS - Merge from emacs--devo--0
Diffstat (limited to 'lispref')
-rw-r--r--lispref/frames.texi32
-rw-r--r--lispref/keymaps.texi169
-rw-r--r--lispref/minibuf.texi4
3 files changed, 156 insertions, 49 deletions
diff --git a/lispref/frames.texi b/lispref/frames.texi
index 4b967d8989c..8212e9325f9 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -64,6 +64,7 @@ The frame is displayed on an MS-DOS terminal.
64* Dialog Boxes:: Displaying a box to ask yes or no. 64* Dialog Boxes:: Displaying a box to ask yes or no.
65* Pointer Shapes:: Specifying the shape of the mouse pointer. 65* Pointer Shapes:: Specifying the shape of the mouse pointer.
66* Window System Selections:: Transferring text to and from other X clients. 66* Window System Selections:: Transferring text to and from other X clients.
67* Drag and Drop:: Internals of Drag-and-Drop implementation.
67* Color Names:: Getting the definitions of color names. 68* Color Names:: Getting the definitions of color names.
68* Text Terminal Colors:: Defining colors for text-only terminals. 69* Text Terminal Colors:: Defining colors for text-only terminals.
69* Resources:: Getting resource values from the server. 70* Resources:: Getting resource values from the server.
@@ -469,7 +470,7 @@ frame, or control their sizes.
469The width in pixels of the frame's border. 470The width in pixels of the frame's border.
470 471
471@item internal-border-width 472@item internal-border-width
472The distance in pixels between text and the frame's border. 473The distance in pixels between text (or fringe) and the frame's border.
473 474
474@item vertical-scroll-bars 475@item vertical-scroll-bars
475Whether the frame has scroll bars for vertical scrolling, and which side 476Whether the frame has scroll bars for vertical scrolling, and which side
@@ -1685,6 +1686,35 @@ access the clipboard at all. The default is @code{nil} on most systems,
1685but @code{t} on MS-Windows. 1686but @code{t} on MS-Windows.
1686@end defopt 1687@end defopt
1687 1688
1689@node Drag and Drop
1690@section Drag and Drop
1691
1692@vindex x-dnd-test-function
1693@vindex x-dnd-known-types
1694 When a user drags something from another application over Emacs, that other
1695application expects Emacs to tell it if Emacs can handle the data that is
1696dragged. The variable @code{x-dnd-test-function} is used by Emacs to determine
1697what to reply. The default value is @code{x-dnd-default-test-function}
1698which accepts drops if the type of the data to be dropped is present in
1699@code{x-dnd-known-types}. You can customize @code{x-dnd-test-function} and/or
1700@code{x-dnd-known-types} if you want Emacs to accept or reject drops based
1701on some other criteria.
1702
1703@vindex x-dnd-types-alist
1704 If you want to change the way Emacs handles drop of different types
1705or add a new type, customize @code{x-dnd-types-alist}. This requires
1706detailed knowledge of what types other applications use for drag and
1707drop.
1708
1709@vindex dnd-protocol-alist
1710 When an URL is dropped on Emacs it may be a file, but it may also be
1711another URL type (ftp, http, etc.). Emacs first checks
1712@code{dnd-protocol-alist} to determine what to do with the URL. If
1713there is no match there and if @code{browse-url-browser-function} is
1714an alist, Emacs looks for a match there. If no match is found the
1715text for the URL is inserted. If you want to alter Emacs behavior,
1716you can customize these variables.
1717
1688@node Color Names 1718@node Color Names
1689@section Color Names 1719@section Color Names
1690 1720
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index f30fb5c9659..5a732af4ebb 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -22,10 +22,13 @@ found. The whole process is called @dfn{key lookup}.
22* Inheritance and Keymaps:: How one keymap can inherit the bindings 22* Inheritance and Keymaps:: How one keymap can inherit the bindings
23 of another keymap. 23 of another keymap.
24* Prefix Keys:: Defining a key with a keymap as its definition. 24* Prefix Keys:: Defining a key with a keymap as its definition.
25* Active Keymaps:: Each buffer has a local keymap 25* Active Keymaps:: How Emacs searches the active keymaps
26 for a key binding.
27* Searching Keymaps:: A pseudo-Lisp summary of searching active maps.
28* Controlling Active Maps:: Each buffer has a local keymap
26 to override the standard (global) bindings. 29 to override the standard (global) bindings.
27 A minor mode can also override them. 30 A minor mode can also override them.
28* Key Lookup:: How extracting elements from keymaps works. 31* Key Lookup:: Finding a key's binding in one keymap.
29* Functions for Key Lookup:: How to request key lookup. 32* Functions for Key Lookup:: How to request key lookup.
30* Changing Key Bindings:: Redefining a key in a keymap. 33* Changing Key Bindings:: Redefining a key in a keymap.
31* Remapping Commands:: Bindings that translate one command to another. 34* Remapping Commands:: Bindings that translate one command to another.
@@ -537,17 +540,38 @@ string for the keymap. The prompt string should be given for menu keymaps
537@cindex local keymap 540@cindex local keymap
538 541
539 Emacs normally contains many keymaps; at any given time, just a few 542 Emacs normally contains many keymaps; at any given time, just a few
540of them are @dfn{active} in that they participate in the 543of them are @dfn{active}, meaning that they participate in the
541interpretation of user input. All the active keymaps are used 544interpretation of user input. All the active keymaps are used
542together to determine what command to execute when a key is entered. 545together to determine what command to execute when a key is entered.
543Emacs searches these keymaps one by one, in a standard order, until it 546Emacs searches these keymaps one by one, in a standard order, until it
544finds a binding in one of the keymaps. (Searching a single keymap for a 547finds a binding in one of the keymaps.
545binding is called @dfn{key lookup}; see @ref{Key Lookup}.)
546 548
547 Normally the active keymaps are the @code{keymap} property keymap, 549 Normally the active keymaps are the @code{keymap} property keymap,
548the keymaps of any enabled minor modes, the current buffer's local 550the keymaps of any enabled minor modes, the current buffer's local
549keymap, and the global keymap, in that order. Therefore, Emacs 551keymap, and the global keymap, in that order. Therefore, Emacs
550searches for each input key sequence in all these keymaps. 552searches for each input key sequence in all these keymaps. Here is a
553pseudo-Lisp description of how this process works:
554
555@lisp
556(or (if overriding-terminal-local-map
557 (@var{find-in} overriding-terminal-local-map)
558 (if overriding-local-map
559 (@var{find-in} overriding-local-map)
560 (or (@var{find-in} (get-text-property (point) 'keymap))
561 (@var{find-in-any} emulation-mode-map-alists)
562 (@var{find-in-any} minor-mode-overriding-map-alist)
563 (@var{find-in-any} minor-mode-map-alist)
564 (if (get-text-property (point) 'local-map))
565 (@var{find-in} (get-text-property (point) 'local-map))
566 (@var{find-in} (current-local-map))))))
567 (@var{find-in} (current-global-map)))
568@end lisp
569
570@noindent
571Here, the pseudo-function @var{find-in} means to look up the key
572sequence in a single map, and @var{find-in-any} means to search the
573appropriate keymaps from an alist. (Searching a single keymap for a
574binding is called @dfn{key lookup}; see @ref{Key Lookup}.)
551 575
552 The @dfn{global keymap} holds the bindings of keys that are defined 576 The @dfn{global keymap} holds the bindings of keys that are defined
553regardless of the current buffer, such as @kbd{C-f}. The variable 577regardless of the current buffer, such as @kbd{C-f}. The variable
@@ -597,10 +621,92 @@ events within @code{read-key-sequence}. @xref{Translating Input}.
597 621
598 @xref{Standard Keymaps}, for a list of standard keymaps. 622 @xref{Standard Keymaps}, for a list of standard keymaps.
599 623
624@defun current-active-maps &optional olp
625This returns the list of active keymaps that would be used by the
626command loop in the current circumstances to look up a key sequence.
627Normally it ignores @code{overriding-local-map} and
628@code{overriding-terminal-local-map}, but if @var{olp} is
629non-@code{nil} then it pays attention to them.
630@end defun
631
632@defun key-binding key &optional accept-defaults no-remap
633This function returns the binding for @var{key} according to the
634current active keymaps. The result is @code{nil} if @var{key} is
635undefined in the keymaps.
636
637@c Emacs 19 feature
638The argument @var{accept-defaults} controls checking for default
639bindings, as in @code{lookup-key} (above).
640
641When commands are remapped (@pxref{Remapping Commands}),
642@code{key-binding} normally processes command remappings so as to
643returns the remapped command that will actually be executed. However,
644if @var{no-remap} is non-@code{nil}, @code{key-binding} ignores
645remappings and returns the binding directly specified for @var{key}.
646
647An error is signaled if @var{key} is not a string or a vector.
648
649@example
650@group
651(key-binding "\C-x\C-f")
652 @result{} find-file
653@end group
654@end example
655@end defun
656
657@node Searching Keymaps
658@section Searching the Active Keymaps
659
660 After translation of the input events (@pxref{Translating Input})
661Emacs looks for them in the active keymaps. Here is a pseudo-Lisp
662description of the order in which the active keymaps are searched:
663
664@lisp
665(or (if overriding-terminal-local-map
666 (@var{find-in} overriding-terminal-local-map)
667 (if overriding-local-map
668 (@var{find-in} overriding-local-map)
669 (or (@var{find-in} (get-text-property (point) 'keymap))
670 (@var{find-in-any} emulation-mode-map-alists)
671 (@var{find-in-any} minor-mode-overriding-map-alist)
672 (@var{find-in-any} minor-mode-map-alist)
673 (@var{find-in} (get-text-property (point) 'local-map))
674 (@var{find-in} (current-local-map)))))
675 (@var{find-in} (current-global-map)))
676@end lisp
677
678@noindent
679The @var{find-in} and @var{find-in-any} are pseudo functions that
680searches in one keymap respectively an alist of keymaps.
681
682@enumerate
683@item
684The function finally found may be remapped
685(@pxref{Remapping Commands}).
686
687@item
688Characters that are bound to @code{self-insert-command} are translated
689according to @code{translation-table-for-input} before insertion.
690
691@item
692@code{current-active-maps} returns a list of the
693currently active keymaps at point.
694
695@item
696When a match is found (@pxref{Key Lookup}), if the binding in the
697keymap is a function, the search is over. However if the keymap entry
698is a symbol with a value or a string, Emacs replaces the input key
699sequences with the variable's value or the string, and restarts the
700search of the active keymaps.
701@end enumerate
702
703@node Controlling Active Maps
704@section Controlling the Active Keymaps
705
600@defvar global-map 706@defvar global-map
601This variable contains the default global keymap that maps Emacs 707This variable contains the default global keymap that maps Emacs
602keyboard input to commands. The global keymap is normally this keymap. 708keyboard input to commands. The global keymap is normally this
603The default global keymap is a full keymap that binds 709keymap. The default global keymap is a full keymap that binds
604@code{self-insert-command} to all of the printing characters. 710@code{self-insert-command} to all of the printing characters.
605 711
606It is normal practice to change the bindings in the global keymap, but you 712It is normal practice to change the bindings in the global keymap, but you
@@ -763,14 +869,14 @@ are used before @code{minor-mode-map-alist} and
763@cindex keymap entry 869@cindex keymap entry
764 870
765 @dfn{Key lookup} is the process of finding the binding of a key 871 @dfn{Key lookup} is the process of finding the binding of a key
766sequence from a given keymap. Actual execution of the binding is not 872sequence from a given keymap. The execution or use of the binding is
767part of key lookup. 873not part of key lookup.
768 874
769 Key lookup uses just the event type of each event in the key sequence; 875 Key lookup uses just the event type of each event in the key sequence;
770the rest of the event is ignored. In fact, a key sequence used for key 876the rest of the event is ignored. In fact, a key sequence used for key
771lookup may designate a mouse event with just its types (a symbol) 877lookup may designate a mouse event with just its types (a symbol)
772instead of the entire event (a list). @xref{Input Events}. Such 878instead of the entire event (a list). @xref{Input Events}. Such
773a ``key-sequence'' is insufficient for @code{command-execute} to run, 879a ``key sequence'' is insufficient for @code{command-execute} to run,
774but it is sufficient for looking up or rebinding a key. 880but it is sufficient for looking up or rebinding a key.
775 881
776 When the key sequence consists of multiple events, key lookup 882 When the key sequence consists of multiple events, key lookup
@@ -965,39 +1071,6 @@ Used in keymaps to undefine keys. It calls @code{ding}, but does
965not cause an error. 1071not cause an error.
966@end deffn 1072@end deffn
967 1073
968@defun key-binding key &optional accept-defaults no-remap
969This function returns the binding for @var{key} in the current
970keymaps, trying all the active keymaps. The result is @code{nil} if
971@var{key} is undefined in the keymaps.
972
973@c Emacs 19 feature
974The argument @var{accept-defaults} controls checking for default
975bindings, as in @code{lookup-key} (above).
976
977When commands are remapped (@pxref{Remapping Commands}),
978@code{key-binding} normally processes command remappings so as to
979returns the remapped command that will actually be executed. However,
980if @var{no-remap} is non-@code{nil}, @code{key-binding} ignores
981remappings and returns the binding directly specified for @var{key}.
982
983An error is signaled if @var{key} is not a string or a vector.
984
985@example
986@group
987(key-binding "\C-x\C-f")
988 @result{} find-file
989@end group
990@end example
991@end defun
992
993@defun current-active-maps &optional olp
994This returns the list of keymaps that would be used by the command
995loop in the current circumstances to look up a key sequence. Normally
996it ignores @code{overriding-local-map} and
997@code{overriding-terminal-local-map}, but if @var{olp} is
998non-@code{nil} then it pays attention to them.
999@end defun
1000
1001@defun local-key-binding key &optional accept-defaults 1074@defun local-key-binding key &optional accept-defaults
1002This function returns the binding for @var{key} in the current 1075This function returns the binding for @var{key} in the current
1003local keymap, or @code{nil} if it is undefined there. 1076local keymap, or @code{nil} if it is undefined there.
@@ -1036,11 +1109,11 @@ bindings, as in @code{lookup-key} (above).
1036 1109
1037@defvar meta-prefix-char 1110@defvar meta-prefix-char
1038@cindex @key{ESC} 1111@cindex @key{ESC}
1039This variable is the meta-prefix character code. It is used when 1112This variable is the meta-prefix character code. It is used for
1040translating a meta character to a two-character sequence so it can be 1113translating a meta character to a two-character sequence so it can be
1041looked up in a keymap. For useful results, the value should be a prefix 1114looked up in a keymap. For useful results, the value should be a
1042event (@pxref{Prefix Keys}). The default value is 27, which is the 1115prefix event (@pxref{Prefix Keys}). The default value is 27, which is
1043@acronym{ASCII} code for @key{ESC}. 1116the @acronym{ASCII} code for @key{ESC}.
1044 1117
1045As long as the value of @code{meta-prefix-char} remains 27, key lookup 1118As long as the value of @code{meta-prefix-char} remains 27, key lookup
1046translates @kbd{M-b} into @kbd{@key{ESC} b}, which is normally defined 1119translates @kbd{M-b} into @kbd{@key{ESC} b}, which is normally defined
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index 6f98785f69f..c0990bae3ee 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -583,6 +583,10 @@ themselves to do with minibuffers. We describe them in this chapter
583so as to keep them near the higher-level completion features that do 583so as to keep them near the higher-level completion features that do
584use the minibuffer. 584use the minibuffer.
585 585
586 If you store a completion alist in a variable, you should mark the
587variable as ``risky'' with a non-@code{nil}
588@code{risky-local-variable} property.
589
586@defun try-completion string collection &optional predicate 590@defun try-completion string collection &optional predicate
587This function returns the longest common substring of all possible 591This function returns the longest common substring of all possible
588completions of @var{string} in @var{collection}. The value of 592completions of @var{string} in @var{collection}. The value of