comparison man/custom.texi @ 26392:b3d3ff9a7a2c

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Tue, 09 Nov 1999 19:08:51 +0000
parents ac7e9e5e2ccb
children ff77115434db
comparison
equal deleted inserted replaced
26391:216416ad34fe 26392:b3d3ff9a7a2c
1367 modes that are enabled, then it checks the major mode's keymap, and then 1367 modes that are enabled, then it checks the major mode's keymap, and then
1368 it checks the global keymap. This is not precisely how key lookup 1368 it checks the global keymap. This is not precisely how key lookup
1369 works, but it's good enough for understanding ordinary circumstances. 1369 works, but it's good enough for understanding ordinary circumstances.
1370 1370
1371 @cindex rebinding major mode keys 1371 @cindex rebinding major mode keys
1372 @findex define-key
1372 To change the local bindings of a major mode, you must change the 1373 To change the local bindings of a major mode, you must change the
1373 mode's local keymap. Normally you must wait until the first time the 1374 mode's local keymap. Normally you must wait until the first time the
1374 mode is used, because most major modes don't create their keymaps until 1375 mode is used, because most major modes don't create their keymaps until
1375 then. If you want to specify something in your @file{~/.emacs} file to 1376 then. If you want to specify something in your @file{~/.emacs} file to
1376 change a major mode's bindings, you must use the mode's mode hook to 1377 change a major mode's bindings, you must use the mode's mode hook to
1510 @xref{Disabling}. 1511 @xref{Disabling}.
1511 1512
1512 @node Init Rebinding 1513 @node Init Rebinding
1513 @subsection Rebinding Keys in Your Init File 1514 @subsection Rebinding Keys in Your Init File
1514 1515
1515 @findex define-key
1516 @findex substitute-key-definition
1517 If you have a set of key bindings that you like to use all the time, 1516 If you have a set of key bindings that you like to use all the time,
1518 you can specify them in your @file{.emacs} file by using their Lisp 1517 you can specify them in your @file{.emacs} file by using their Lisp
1519 syntax. 1518 syntax. (@xref{Init File}.)
1520 1519
1521 The simplest method for doing this works for ASCII characters and 1520 The simplest method for doing this works for ASCII characters and
1522 Meta-modified ASCII characters only. This method uses a string to 1521 Meta-modified ASCII characters only. This method uses a string to
1523 represent the key sequence you want to rebind. For example, here's how 1522 represent the key sequence you want to rebind. For example, here's how
1524 to bind @kbd{C-z} to @code{shell}: 1523 to bind @kbd{C-z} to @code{shell}:
2197 2196
2198 @item 2197 @item
2199 Redefine all keys which now run @code{next-line} in Fundamental mode 2198 Redefine all keys which now run @code{next-line} in Fundamental mode
2200 so that they run @code{forward-line} instead. 2199 so that they run @code{forward-line} instead.
2201 2200
2201 @findex substitute-key-definition
2202 @example 2202 @example
2203 (substitute-key-definition 'next-line 'forward-line 2203 (substitute-key-definition 'next-line 'forward-line
2204 global-map) 2204 global-map)
2205 @end example 2205 @end example
2206 2206