/[emacs]/emacs/lispref/keymaps.texi
ViewVC logotype

Diff of /emacs/lispref/keymaps.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.39.4.5 by miles, Tue Apr 27 14:08:34 2004 UTC revision 1.39.4.6 by miles, Tue Jul 6 10:23:38 2004 UTC
# Line 95  precedence over) the corresponding globa Line 95  precedence over) the corresponding globa
95  keymaps shadow both local and global keymaps.  @xref{Active Keymaps},  keymaps shadow both local and global keymaps.  @xref{Active Keymaps},
96  for details.  for details.
97    
98      The Emacs Lisp representation for a key sequence is a string or vector.
99    You can enter key sequence constants using the ordinary string or vector
100    representation; it is also convenient to use @code{kbd}:
101    
102    @defmac kbd keyseq-text
103    This macro converts the text @var{keyseq-text} (a string constant)
104    into a key sequence (a string or vector constant).  The contents
105    of @var{keyseq-text} should describe the key sequence using the syntax
106    used in this manual:
107    
108    @example
109    (kbd "C-x") @result{} "\C-x"
110    (kbd "C-x C-f") @result{} "\C-x\C-f"
111    (kbd "C-c C-c") @result{} "\C-c\C-c"
112    (kbd "C-x 4 C-f") @result{} "\C-x4\C-f"
113    (kbd "X") @result{} "X"
114    (kbd "RET") @result{} "\^M"
115    (kbd "C-c 3") @result{} "\C-c3"
116    @end example
117    @end defmac
118    
119  @node Format of Keymaps  @node Format of Keymaps
120  @section Format of Keymaps  @section Format of Keymaps
121  @cindex format of keymaps  @cindex format of keymaps
# Line 880  the other functions described in this ch Line 901  the other functions described in this ch
901      @result{} find-file      @result{} find-file
902  @end group  @end group
903  @group  @group
904    (lookup-key (current-global-map) (kbd "C-x C-f"))
905        @result{} find-file
906    @end group
907    @group
908  (lookup-key (current-global-map) "\C-x\C-f12345")  (lookup-key (current-global-map) "\C-x\C-f12345")
909      @result{} 2      @result{} 2
910  @end group  @end group
# Line 1126  map Line 1151  map
1151    
1152  @group  @group
1153  ;; @r{Build sparse submap for @kbd{C-x} and bind @kbd{f} in that.}  ;; @r{Build sparse submap for @kbd{C-x} and bind @kbd{f} in that.}
1154  (define-key map "\C-xf" 'forward-word)  (define-key map (kbd "C-x f") 'forward-word)
1155      @result{} forward-word      @result{} forward-word
1156  @end group  @end group
1157  @group  @group
# Line 1139  map Line 1164  map
1164    
1165  @group  @group
1166  ;; @r{Bind @kbd{C-p} to the @code{ctl-x-map}.}  ;; @r{Bind @kbd{C-p} to the @code{ctl-x-map}.}
1167  (define-key map "\C-p" ctl-x-map)  (define-key map (kbd "C-p") ctl-x-map)
1168  ;; @code{ctl-x-map}  ;; @code{ctl-x-map}
1169  @result{} [nil @dots{} find-file @dots{} backward-kill-sentence]  @result{} [nil @dots{} find-file @dots{} backward-kill-sentence]
1170  @end group  @end group
1171    
1172  @group  @group
1173  ;; @r{Bind @kbd{C-f} to @code{foo} in the @code{ctl-x-map}.}  ;; @r{Bind @kbd{C-f} to @code{foo} in the @code{ctl-x-map}.}
1174  (define-key map "\C-p\C-f" 'foo)  (define-key map (kbd "C-p C-f") 'foo)
1175  @result{} 'foo  @result{} 'foo
1176  @end group  @end group
1177  @group  @group
# Line 1333  changing key bindings.  They work by cal Line 1358  changing key bindings.  They work by cal
1358  (@pxref{Init File}) for simple customization.  For example,  (@pxref{Init File}) for simple customization.  For example,
1359    
1360  @smallexample  @smallexample
1361  (global-set-key "\C-x\C-\\" 'next-line)  (global-set-key (kbd "C-x C-\\") 'next-line)
1362  @end smallexample  @end smallexample
1363    
1364  @noindent  @noindent

Legend:
Removed from v.1.39.4.5  
changed lines
  Added in v.1.39.4.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26