1 ;;; bindings.el --- define standard key bindings and some variables
3 ;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994, 1995, 1996, 1999,
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5 ;; Free Software Foundation, Inc.
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation, either version 3 of the License, or
16 ;; (at your option) any later version.
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
30 (defun make-mode-line-mouse-map (mouse function
) "\
31 Return a keymap with single entry for mouse key MOUSE on the mode line.
32 MOUSE is defined to run function FUNCTION with no args in the buffer
33 corresponding to the mode line clicked."
34 (let ((map (make-sparse-keymap)))
35 (define-key map
(vector 'mode-line mouse
) function
)
39 (defun mode-line-toggle-read-only (event)
40 "Like `toggle-read-only', for the mode-line."
43 (select-window (posn-window (event-start event
)))
45 (force-mode-line-update)))
48 (defun mode-line-toggle-modified (event)
49 "Toggle the buffer-modified flag from the mode-line."
52 (select-window (posn-window (event-start event
)))
53 (set-buffer-modified-p (not (buffer-modified-p)))
54 (force-mode-line-update)))
57 (defun mode-line-widen (event)
58 "Widen a buffer from the mode-line."
61 (select-window (posn-window (event-start event
)))
63 (force-mode-line-update)))
66 (defvar mode-line-input-method-map
67 (let ((map (make-sparse-keymap)))
68 (define-key map
[mode-line mouse-2
]
73 (posn-window (event-start e
)))
75 (force-mode-line-update))))
76 (define-key map
[mode-line mouse-3
]
81 (posn-window (event-start e
)))
82 (describe-current-input-method))))
86 (defvar mode-line-coding-system-map
87 (let ((map (make-sparse-keymap)))
88 (define-key map
[mode-line mouse-1
]
92 (select-window (posn-window (event-start e
)))
93 (when (and enable-multibyte-characters
94 buffer-file-coding-system
)
95 (describe-coding-system buffer-file-coding-system
)))))
97 "Local keymap for the coding-system part of the mode line.")
100 (defun mode-line-change-eol (event)
101 "Cycle through the various possible kinds of end-of-line styles."
103 (with-selected-window (posn-window (event-start event
))
104 (let ((eol (coding-system-eol-type buffer-file-coding-system
)))
105 (set-buffer-file-coding-system
106 (cond ((eq eol
0) 'dos
) ((eq eol
1) 'mac
) (t 'unix
))))))
108 (defvar mode-line-eol-desc-cache nil
)
110 (defun mode-line-eol-desc ()
111 (let* ((eol (coding-system-eol-type buffer-file-coding-system
))
112 (mnemonic (coding-system-eol-type-mnemonic buffer-file-coding-system
))
113 (desc (assoc eol mode-line-eol-desc-cache
)))
114 (if (and desc
(eq (cadr desc
) mnemonic
))
116 (if desc
(setq mode-line-eol-desc-cache nil
)) ;Flush the cache if stale.
120 'help-echo
(format "End-of-line style: %s\nmouse-1 to cycle"
121 (if (eq eol
0) "Unix-style LF"
122 (if (eq eol
1) "DOS-style CRLF"
123 (if (eq eol
2) "Mac-style CR"
127 (let ((map (make-sparse-keymap)))
128 (define-key map
[mode-line mouse-1
] 'mode-line-change-eol
)
130 'mouse-face
'mode-line-highlight
))
131 (push (cons eol
(cons mnemonic desc
)) mode-line-eol-desc-cache
)
134 (defvar mode-line-client
136 (:propertize
("" (:eval
(if (frame-parameter nil
'client
) "@" "")))
137 help-echo
,(purecopy "emacsclient frame")))
138 "Mode-line control for identifying emacsclient frames.")
140 (put 'mode-line-client
'risky-local-variable t
)
142 (defvar mode-line-mule-info
144 (current-input-method
145 (:propertize
("" current-input-method-title
)
147 ,(purecopy "Current input method: ")
150 mouse-2: Disable input method\n\
151 mouse-3: Describe current input method"))
152 local-map
,mode-line-input-method-map
153 mouse-face mode-line-highlight
))
157 #'(lambda (window object point
)
158 (with-current-buffer (window-buffer window
)
159 ;; Don't show this tip if the coding system is nil,
160 ;; it reads like a bug, and is not useful anyway.
161 (when buffer-file-coding-system
162 (format "Buffer coding system %s\nmouse-1: describe coding system"
163 (if enable-multibyte-characters
164 (concat "(multi-byte): "
165 (symbol-name buffer-file-coding-system
))
166 (concat "(unibyte): "
167 (symbol-name buffer-file-coding-system
)))))))
168 'mouse-face
'mode-line-highlight
169 'local-map mode-line-coding-system-map
)
170 (:eval
(mode-line-eol-desc)))
171 "Mode-line control for displaying information of multilingual environment.
172 Normally it displays current input method (if any activated) and
173 mnemonics of the following coding systems:
174 coding system for saving or writing the current buffer
175 coding system for keyboard input (if Emacs is running on terminal)
176 coding system for terminal output (if Emacs is running on terminal)"
178 ;; coding system for decoding output of buffer process (if any)
179 ;; coding system for encoding text to send to buffer process (if any)."
183 (put 'mode-line-mule-info
'risky-local-variable t
)
184 (make-variable-buffer-local 'mode-line-mule-info
)
186 ;; MSDOS frames have window-system, but want the Fn identification.
187 (defun mode-line-frame-control ()
188 "Compute mode-line control for frame identification.
189 Value is used for `mode-line-frame-identification', which see."
190 (if (or (null window-system
)
191 (eq window-system
'pc
))
195 ;; We need to defer the call to mode-line-frame-control to the time
196 ;; the mode line is actually displayed.
197 (defvar mode-line-frame-identification
'(:eval
(mode-line-frame-control))
198 "Mode-line control to describe the current frame.")
200 (put 'mode-line-frame-identification
'risky-local-variable t
)
202 (defvar mode-line-process nil
"\
203 Mode-line control for displaying info on process status.
204 Normally nil in most modes, since there is no process to display.")
207 (put 'mode-line-process
'risky-local-variable t
)
208 (make-variable-buffer-local 'mode-line-process
)
210 (defvar mode-line-modified
213 'help-echo
(purecopy (lambda (window object point
)
214 (format "Buffer is %s\nmouse-1 toggles"
215 (save-selected-window
216 (select-window window
)
220 'local-map
(purecopy (make-mode-line-mouse-map
222 #'mode-line-toggle-read-only
))
223 'mouse-face
'mode-line-highlight
)
226 'help-echo
(purecopy (lambda (window object point
)
227 (format "Buffer is %sodified\nmouse-1 toggles modified state"
228 (save-selected-window
229 (select-window window
)
230 (if (buffer-modified-p)
233 'local-map
(purecopy (make-mode-line-mouse-map
234 'mouse-1
#'mode-line-toggle-modified
))
235 'mouse-face
'mode-line-highlight
))
236 "Mode-line control for displaying whether current buffer is modified.")
239 (put 'mode-line-modified
'risky-local-variable t
)
240 (make-variable-buffer-local 'mode-line-modified
)
242 (defvar mode-line-remote
245 'mouse-face
'mode-line-highlight
246 'help-echo
(purecopy (lambda (window object point
)
248 (save-selected-window
249 (select-window window
)
251 (if (file-remote-p default-directory
)
252 "Current directory is remote: "
253 "Current directory is local: ")
254 default-directory
)))))))
255 "Mode-line flag to show if default-directory for current buffer is remote.")
257 (put 'mode-line-remote
'risky-local-variable t
)
259 (make-variable-buffer-local 'mode-line-remote
)
261 ;; Actual initialization is below.
262 (defvar mode-line-position nil
263 "Mode-line control for displaying the position in the buffer.
264 Normally displays the buffer percentage and, optionally, the
265 buffer size, the line number and the column number.")
267 (put 'mode-line-position
'risky-local-variable t
)
269 (defvar mode-line-modes nil
270 "Mode-line control for displaying major and minor modes.")
272 (put 'mode-line-modes
'risky-local-variable t
)
274 (defvar mode-line-mode-menu
(make-sparse-keymap "Minor Modes") "\
275 Menu of mode operations in the mode line.")
277 (defvar mode-line-major-mode-keymap
278 (let ((map (make-sparse-keymap)))
279 (define-key map
[mode-line down-mouse-1
]
280 `(menu-item ,(purecopy "Menu Bar") ignore
281 :filter
(lambda (_) (mouse-menu-major-mode-map))))
282 (define-key map
[mode-line mouse-2
] 'describe-mode
)
283 (define-key map
[mode-line down-mouse-3
] mode-line-mode-menu
)
285 Keymap to display on major mode.")
287 (defvar mode-line-minor-mode-keymap
288 (let ((map (make-sparse-keymap)))
289 (define-key map
[mode-line down-mouse-1
] 'mouse-minor-mode-menu
)
290 (define-key map
[mode-line mouse-2
] 'mode-line-minor-mode-help
)
291 (define-key map
[mode-line down-mouse-3
] mode-line-mode-menu
)
292 (define-key map
[header-line down-mouse-3
] mode-line-mode-menu
)
294 Keymap to display on minor modes.")
296 (defvar mode-line-column-line-number-mode-map
297 (let ((map (make-sparse-keymap))
298 (menu-map (make-sparse-keymap "Toggle Line and Column Number Display")))
299 (define-key menu-map
[line-number-mode
]
300 `(menu-item ,(purecopy "Display Line Numbers") line-number-mode
301 :help
,(purecopy "Toggle displaying line numbers in the mode-line")
302 :button
(:toggle . line-number-mode
)))
303 (define-key menu-map
[column-number-mode
]
304 `(menu-item ,(purecopy "Display Column Numbers") column-number-mode
305 :help
,(purecopy "Toggle displaying column numbers in the mode-line")
306 :button
(:toggle . column-number-mode
)))
307 (define-key map
[mode-line down-mouse-1
] menu-map
)
309 Keymap to display on column and line numbers.")
312 ;; The multi-line message doesn't work terribly well on the
313 ;; bottom mode line... Better ideas?
315 ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete,
316 ;; drag-mouse-1: resize, C-mouse-2: split horizontally"
317 "mouse-1: Select (drag to resize)\n\
318 mouse-2: Make current window occupy the whole frame\n\
319 mouse-3: Remove current window from display")
320 (recursive-edit-help-echo "Recursive edit, type C-M-c to get out")
321 (spaces (propertize " " 'help-echo help-echo
))
322 (standard-mode-line-format
325 (propertize "-" 'help-echo help-echo
)
330 'mode-line-frame-identification
331 'mode-line-buffer-identification
332 (propertize " " 'help-echo help-echo
)
335 (propertize " " 'help-echo help-echo
)
337 `(which-func-mode ("" which-func-format
,spaces
))
338 `(global-mode-string ("" global-mode-string
,spaces
))
339 `(:eval
(unless (display-graphic-p)
340 ,(propertize "-%-" 'help-echo help-echo
)))))
341 (standard-mode-line-modes
343 (propertize "%[" 'help-echo recursive-edit-help-echo
)
344 (propertize "(" 'help-echo help-echo
)
345 `(:propertize
("" mode-name
)
346 help-echo
"Major mode\n\
347 mouse-1: Display major mode menu\n\
348 mouse-2: Show help for major mode\n\
349 mouse-3: Toggle minor modes"
350 mouse-face mode-line-highlight
351 local-map
,mode-line-major-mode-keymap
)
352 '("" mode-line-process
)
353 `(:propertize
("" minor-mode-alist
)
354 mouse-face mode-line-highlight
355 help-echo
"Minor mode\n\
356 mouse-1: Display minor mode menu\n\
357 mouse-2: Show help for minor mode\n\
358 mouse-3: Toggle minor modes"
359 local-map
,mode-line-minor-mode-keymap
)
360 (propertize "%n" 'help-echo
"mouse-2: Remove narrowing from the current buffer"
361 'mouse-face
'mode-line-highlight
362 'local-map
(make-mode-line-mouse-map
363 'mouse-2
#'mode-line-widen
))
364 (propertize ")" 'help-echo help-echo
)
365 (propertize "%]" 'help-echo recursive-edit-help-echo
)
368 (standard-mode-line-position
371 'local-map mode-line-column-line-number-mode-map
372 'mouse-face
'mode-line-highlight
373 ;; XXX needs better description
374 'help-echo
"Size indication mode\n\
375 mouse-1: Display Line and Column Mode Menu"))
376 (size-indication-mode
379 'local-map mode-line-column-line-number-mode-map
380 'mouse-face
'mode-line-highlight
381 ;; XXX needs better description
382 'help-echo
"Size indication mode\n\
383 mouse-1: Display Line and Column Mode Menu")))
388 'local-map mode-line-column-line-number-mode-map
389 'mouse-face
'mode-line-highlight
390 'help-echo
"Line number and Column number\n\
391 mouse-1: Display Line and Column Mode Menu"))
394 'local-map mode-line-column-line-number-mode-map
395 'mouse-face
'mode-line-highlight
396 'help-echo
"Line Number\n\
397 mouse-1: Display Line and Column Mode Menu"))))
401 'local-map mode-line-column-line-number-mode-map
402 'mouse-face
'mode-line-highlight
403 'help-echo
"Column number\n\
404 mouse-1: Display Line and Column Mode Menu"))))))))
406 (setq-default mode-line-format standard-mode-line-format
)
407 (put 'mode-line-format
'standard-value
408 (list `(quote ,standard-mode-line-format
)))
410 (setq-default mode-line-modes standard-mode-line-modes
)
411 (put 'mode-line-modes
'standard-value
412 (list `(quote ,standard-mode-line-modes
)))
414 (setq-default mode-line-position standard-mode-line-position
)
415 (put 'mode-line-position
'standard-value
416 (list `(quote ,standard-mode-line-position
))))
418 (defvar mode-line-buffer-identification-keymap
419 ;; Add menu of buffer operations to the buffer identification part
420 ;; of the mode line.or header line.
421 (let ((map (make-sparse-keymap)))
422 ;; Bind down- events so that the global keymap won't ``shine
424 (define-key map
[mode-line mouse-1
] 'mode-line-previous-buffer
)
425 (define-key map
[header-line down-mouse-1
] 'ignore
)
426 (define-key map
[header-line mouse-1
] 'mode-line-previous-buffer
)
427 (define-key map
[mode-line mouse-3
] 'mode-line-next-buffer
)
428 (define-key map
[header-line down-mouse-3
] 'ignore
)
429 (define-key map
[header-line mouse-3
] 'mode-line-next-buffer
)
431 Keymap for what is displayed by `mode-line-buffer-identification'.")
433 (defun propertized-buffer-identification (fmt)
434 "Return a list suitable for `mode-line-buffer-identification'.
435 FMT is a format specifier such as \"%12b\". This function adds
436 text properties for face, help-echo, and local-map to it."
437 (list (propertize fmt
438 'face
'mode-line-buffer-id
440 (purecopy "Buffer name\n\
441 mouse-1: previous buffer\n\
442 mouse-3: next buffer")
443 'mouse-face
'mode-line-highlight
444 'local-map mode-line-buffer-identification-keymap
)))
446 (defvar mode-line-buffer-identification
(propertized-buffer-identification "%12b") "\
447 Mode-line control for identifying the buffer being displayed.
448 Its default value is (\"%12b\") with some text properties added.
449 Major modes that edit things other than ordinary files may change this
450 \(e.g. Info, Dired,...)")
453 (put 'mode-line-buffer-identification
'risky-local-variable t
)
454 (make-variable-buffer-local 'mode-line-buffer-identification
)
456 (defun unbury-buffer () "\
457 Switch to the last buffer in the buffer list."
459 (switch-to-buffer (last-buffer)))
461 (defun mode-line-unbury-buffer (event) "\
462 Call `unbury-buffer' in this window."
464 (save-selected-window
465 (select-window (posn-window (event-start event
)))
468 (defun mode-line-bury-buffer (event) "\
469 Like `bury-buffer', but temporarily select EVENT's window."
471 (save-selected-window
472 (select-window (posn-window (event-start event
)))
475 (defun mode-line-other-buffer () "\
476 Switch to the most recently selected buffer other than the current one."
478 (switch-to-buffer (other-buffer)))
480 (defun mode-line-next-buffer (event)
481 "Like `next-buffer', but temporarily select EVENT's window."
483 (save-selected-window
484 (select-window (posn-window (event-start event
)))
487 (defun mode-line-previous-buffer (event)
488 "Like `previous-buffer', but temporarily select EVENT's window."
490 (save-selected-window
491 (select-window (posn-window (event-start event
)))
494 (defmacro bound-and-true-p
(var)
495 "Return the value of symbol VAR if it is bound, else nil."
496 `(and (boundp (quote ,var
)) ,var
))
498 ;; Use mode-line-mode-menu for local minor-modes only.
499 ;; Global ones can go on the menubar (Options --> Show/Hide).
500 (define-key mode-line-mode-menu
[overwrite-mode
]
501 `(menu-item ,(purecopy "Overwrite (Ovwrt)") overwrite-mode
502 :help
,(purecopy "Overwrite mode: typed characters replace existing text")
503 :button
(:toggle . overwrite-mode
)))
504 (define-key mode-line-mode-menu
[outline-minor-mode
]
505 `(menu-item ,(purecopy "Outline (Outl)") outline-minor-mode
506 ;; XXX: This needs a good, brief description.
508 :button
(:toggle .
(bound-and-true-p outline-minor-mode
))))
509 (define-key mode-line-mode-menu
[highlight-changes-mode
]
510 `(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode
511 :help
,(purecopy "Show changes in the buffer in a distinctive color")
512 :button
(:toggle .
(bound-and-true-p highlight-changes-mode
))))
513 (define-key mode-line-mode-menu
[hide-ifdef-mode
]
514 `(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode
515 :help
,(purecopy "Show/Hide code within #ifdef constructs")
516 :button
(:toggle .
(bound-and-true-p hide-ifdef-mode
))))
517 (define-key mode-line-mode-menu
[glasses-mode
]
518 `(menu-item ,(purecopy "Glasses (o^o)") glasses-mode
519 :help
,(purecopy "Insert virtual separators to make long identifiers easy to read")
520 :button
(:toggle .
(bound-and-true-p glasses-mode
))))
521 (define-key mode-line-mode-menu
[font-lock-mode
]
522 `(menu-item ,(purecopy "Font Lock") font-lock-mode
523 :help
,(purecopy "Syntax coloring")
524 :button
(:toggle . font-lock-mode
)))
525 (define-key mode-line-mode-menu
[flyspell-mode
]
526 `(menu-item ,(purecopy "Flyspell (Fly)") flyspell-mode
527 :help
,(purecopy "Spell checking on the fly")
528 :button
(:toggle .
(bound-and-true-p flyspell-mode
))))
529 (define-key mode-line-mode-menu
[auto-revert-tail-mode
]
530 `(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode
531 :help
,(purecopy "Revert the tail of the buffer when buffer grows")
532 :enable
(buffer-file-name)
533 :button
(:toggle .
(bound-and-true-p auto-revert-tail-mode
))))
534 (define-key mode-line-mode-menu
[auto-revert-mode
]
535 `(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode
536 :help
,(purecopy "Revert the buffer when the file on disk changes")
537 :button
(:toggle .
(bound-and-true-p auto-revert-mode
))))
538 (define-key mode-line-mode-menu
[auto-fill-mode
]
539 `(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode
540 :help
,(purecopy "Automatically insert new lines")
541 :button
(:toggle . auto-fill-function
)))
542 (define-key mode-line-mode-menu
[abbrev-mode
]
543 `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode
544 :help
,(purecopy "Automatically expand abbreviations")
545 :button
(:toggle . abbrev-mode
)))
547 (defun mode-line-minor-mode-help (event)
548 "Describe minor mode for EVENT on minor modes area of the mode line."
550 (let ((indicator (car (nth 4 (car (cdr event
))))))
551 (describe-minor-mode-from-indicator indicator
)))
553 (defvar minor-mode-alist nil
"\
554 Alist saying how to show minor modes in the mode line.
555 Each element looks like (VARIABLE STRING);
556 STRING is included in the mode line if VARIABLE's value is non-nil.
558 Actually, STRING need not be a string; any possible mode-line element
559 is okay. See `mode-line-format'.")
561 (put 'minor-mode-alist
'risky-local-variable t
)
562 ;; Don't use purecopy here--some people want to change these strings.
563 (setq minor-mode-alist
564 '((abbrev-mode " Abbrev")
565 (overwrite-mode overwrite-mode
)
566 (auto-fill-function " Fill")
567 ;; not really a minor mode...
568 (defining-kbd-macro " Def")))
570 ;; These variables are used by autoloadable packages.
571 ;; They are defined here so that they do not get overridden
572 ;; by the loading of those packages.
574 ;; Names in directory that end in one of these
575 ;; are ignored in completion,
576 ;; making it more likely you will get a unique match.
577 (setq completion-ignored-extensions
579 (cond ((memq system-type
'(ms-dos windows-nt
))
581 '(".o" "~" ".bin" ".bak" ".obj" ".map" ".ico" ".pif" ".lnk"
582 ".a" ".ln" ".blg" ".bbl" ".dll" ".drv" ".vxd" ".386")))
585 '(".o" "~" ".bin" ".lbin" ".so"
586 ".a" ".ln" ".blg" ".bbl"))))
590 ;; VCS metadata directories
591 ".svn/" ".hg/" ".git/" ".bzr/" "CVS/" "_darcs/" "_MTN/"
600 ;; Other CL implementations (Allegro, LispWorks, OpenMCL)
601 ".fasl" ".ufsl" ".fsl" ".dxl" ".pfsl" ".dfsl"
602 ".p64fsl" ".d64fsl" ".dx64fsl"
608 ;; This used to contain .log, but that's commonly used for log
609 ;; files you do want to see, not just TeX stuff. -- fx
611 ".cp" ".fn" ".ky" ".pg" ".tp" ".vr"
612 ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs"
613 ;; Python byte-compiled
616 ;; Suffixes used for executables.
619 ((memq system-type
'(ms-dos windows-nt
))
620 '(".exe" ".com" ".bat" ".cmd" ".btm" ""))
624 ;; Packages should add to this list appropriately when they are
625 ;; loaded, rather than listing everything here.
626 (setq debug-ignored-errors
627 `(beginning-of-line beginning-of-buffer end-of-line
628 end-of-buffer end-of-file buffer-read-only
630 ,(purecopy "^Previous command was not a yank$")
631 ,(purecopy "^Minibuffer window is not active$")
632 ,(purecopy "^No previous history search regexp$")
633 ,(purecopy "^No later matching history item$")
634 ,(purecopy "^No earlier matching history item$")
635 ,(purecopy "^End of history; no default available$")
636 ,(purecopy "^End of defaults; no next item$")
637 ,(purecopy "^Beginning of history; no preceding item$")
638 ,(purecopy "^No recursive edit is in progress$")
639 ,(purecopy "^Changes to be undone are outside visible portion of buffer$")
640 ,(purecopy "^No undo information in this buffer$")
641 ,(purecopy "^No further undo information")
642 ,(purecopy "^Save not confirmed$")
643 ,(purecopy "^Recover-file cancelled\\.$")
644 ,(purecopy "^Cannot switch buffers in a dedicated window$")
648 (make-variable-buffer-local 'indent-tabs-mode
)
650 ;; We have base64 and md5 functions built in now.
653 (provide 'overlay
'(display syntax-table field
))
654 (provide 'text-properties
'(display syntax-table field point-entered
))
656 (define-key esc-map
"\t" 'complete-symbol
)
658 ;; Reduce total amount of space we must allocate during this function
659 ;; that we will not need to keep permanently.
663 (setq help-event-list
'(help f1
))
665 (make-variable-buffer-local 'minor-mode-overriding-map-alist
)
668 (global-set-key [switch-frame
] 'handle-switch-frame
)
669 (global-set-key [select-window
] 'handle-select-window
)
671 ;; FIXME: Do those 3 events really ever reach the global-map ?
672 ;; It seems that they can't because they're handled via
673 ;; special-event-map which is used at very low-level. -stef
674 (global-set-key [delete-frame
] 'handle-delete-frame
)
675 (global-set-key [iconify-frame
] 'ignore-event
)
676 (global-set-key [make-frame-visible
] 'ignore-event
)
679 ;These commands are defined in editfns.c
680 ;but they are not assigned to keys there.
681 (put 'narrow-to-region
'disabled t
)
683 ;; Moving with arrows in bidi-sensitive direction.
684 (defun right-char (&optional n
)
685 "Move point N characters to the right (to the left if N is negative).
686 On reaching beginning or end of buffer, stop and signal error.
688 Depending on the bidirectional context, this may move either forward
689 or backward in the buffer. This is in contrast with \\[forward-char]
690 and \\[backward-char], which see."
692 (if (eq (current-bidi-paragraph-direction) 'left-to-right
)
696 (defun left-char ( &optional n
)
697 "Move point N characters to the left (to the right if N is negative).
698 On reaching beginning or end of buffer, stop and signal error.
700 Depending on the bidirectional context, this may move either backward
701 or forward in the buffer. This is in contrast with \\[backward-char]
702 and \\[forward-char], which see."
704 (if (eq (current-bidi-paragraph-direction) 'left-to-right
)
708 (defun right-word (&optional n
)
709 "Move point N words to the right (to the left if N is negative).
711 Depending on the bidirectional context, this may move either forward
712 or backward in the buffer. This is in contrast with \\[forward-word]
713 and \\[backward-word], which see.
716 If an edge of the buffer or a field boundary is reached, point is left there
717 there and the function returns nil. Field boundaries are not noticed
718 if `inhibit-field-text-motion' is non-nil."
720 (if (eq (current-bidi-paragraph-direction) 'left-to-right
)
724 (defun left-word (&optional n
)
725 "Move point N words to the left (to the right if N is negative).
727 Depending on the bidirectional context, this may move either backward
728 or forward in the buffer. This is in contrast with \\[backward-word]
729 and \\[forward-word], which see.
732 If an edge of the buffer or a field boundary is reached, point is left there
733 there and the function returns nil. Field boundaries are not noticed
734 if `inhibit-field-text-motion' is non-nil."
736 (if (eq (current-bidi-paragraph-direction) 'left-to-right
)
740 (defvar narrow-map
(make-sparse-keymap)
741 "Keymap for narrowing commands.")
742 (define-key ctl-x-map
"n" narrow-map
)
744 (define-key narrow-map
"n" 'narrow-to-region
)
745 (define-key narrow-map
"w" 'widen
)
748 (define-key global-map
"\e\e\e" 'keyboard-escape-quit
)
749 (define-key global-map
"\C-g" 'keyboard-quit
)
751 ;; Used to be in termdev.el: when using several terminals, make C-z
752 ;; suspend only the relevant terminal.
753 (substitute-key-definition 'suspend-emacs
'suspend-frame global-map
)
755 (define-key global-map
"\C-j" 'newline-and-indent
)
756 (define-key global-map
"\C-m" 'newline
)
757 (define-key global-map
"\C-o" 'open-line
)
758 (define-key esc-map
"\C-o" 'split-line
)
759 (define-key global-map
"\C-q" 'quoted-insert
)
760 (define-key esc-map
"^" 'delete-indentation
)
761 (define-key esc-map
"\\" 'delete-horizontal-space
)
762 (define-key esc-map
"m" 'back-to-indentation
)
763 (define-key ctl-x-map
"\C-o" 'delete-blank-lines
)
764 (define-key esc-map
" " 'just-one-space
)
765 (define-key esc-map
"z" 'zap-to-char
)
766 (define-key esc-map
"=" 'count-lines-region
)
767 (define-key ctl-x-map
"=" 'what-cursor-position
)
768 (define-key esc-map
":" 'eval-expression
)
769 ;; Define ESC ESC : like ESC : for people who type ESC ESC out of habit.
770 (define-key esc-map
"\M-:" 'eval-expression
)
771 ;; Changed from C-x ESC so that function keys work following C-x.
772 (define-key ctl-x-map
"\e\e" 'repeat-complex-command
)
773 ;; New binding analogous to M-:.
774 (define-key ctl-x-map
"\M-:" 'repeat-complex-command
)
775 (define-key ctl-x-map
"u" 'undo
)
776 (put 'undo
:advertised-binding
[?\C-x ?u
])
777 ;; Many people are used to typing C-/ on X terminals and getting C-_.
778 (define-key global-map
[?\C-
/] 'undo
)
779 (define-key global-map
"\C-_" 'undo
)
780 ;; Richard said that we should not use C-x <uppercase letter> and I have
781 ;; no idea whereas to bind it. Any suggestion welcome. -stef
782 ;; (define-key ctl-x-map "U" 'undo-only)
784 (define-key esc-map
"!" 'shell-command
)
785 (define-key esc-map
"|" 'shell-command-on-region
)
786 (define-key esc-map
"&" 'async-shell-command
)
788 (define-key ctl-x-map
[right] 'next-buffer)
789 (define-key ctl-x-map [C-right] 'next-buffer)
790 (define-key ctl-x-map [left] 'previous-buffer)
791 (define-key ctl-x-map [C-left] 'previous-buffer)
793 (let ((map minibuffer-local-map))
794 (define-key map "\en" 'next-history-element)
795 (define-key map [next] 'next-history-element)
796 (define-key map [down] 'next-history-element)
797 (define-key map "\ep" 'previous-history-element)
798 (define-key map [prior] 'previous-history-element)
799 (define-key map [up] 'previous-history-element)
800 (define-key map "\es" 'next-matching-history-element)
801 (define-key map "\er" 'previous-matching-history-element)
802 ;; Override the global binding (which calls indent-relative via
803 ;; indent-for-tab-command). The alignment that indent-relative tries to
804 ;; do doesn't make much sense here since the prompt messes it up.
805 (define-key map "\t" 'self-insert-command)
806 (define-key map [C-tab] 'file-cache-minibuffer-complete))
808 (define-key global-map "\C-u" 'universal-argument)
811 (define-key esc-map (char-to-string i) 'digit-argument)
813 (define-key esc-map "-" 'negative-argument)
814 ;; Define control-digits.
817 (define-key global-map (read (format "[?\\C-%c]" i)) 'digit-argument)
819 (define-key global-map [?\C--] 'negative-argument)
820 ;; Define control-meta-digits.
823 (define-key esc-map (read (format "[?\\C-%c]" i)) 'digit-argument)
825 (define-key global-map [?\C-\M--] 'negative-argument)
827 (define-key global-map "\177" 'delete-backward-char)
828 (define-key global-map "\C-d" 'delete-char)
830 (define-key global-map "\C-k" 'kill-line)
831 (define-key global-map "\C-w" 'kill-region)
832 (define-key esc-map "w" 'kill-ring-save)
833 (define-key esc-map "\C-w" 'append-next-kill)
834 (define-key global-map "\C-y" 'yank)
835 (define-key esc-map "y" 'yank-pop)
837 ;; (define-key ctl-x-map "a" 'append-to-buffer)
839 (define-key global-map "\C-@" 'set-mark-command)
840 ;; Many people are used to typing C-SPC and getting C-@.
841 (define-key global-map [?\C- ] 'set-mark-command)
842 (define-key ctl-x-map "\C-x" 'exchange-point-and-mark)
843 (define-key ctl-x-map "\C-@" 'pop-global-mark)
844 (define-key ctl-x-map [?\C- ] 'pop-global-mark)
846 (define-key global-map "\C-n" 'next-line)
847 (define-key global-map "\C-p" 'previous-line)
848 (define-key ctl-x-map "\C-n" 'set-goal-column)
849 (define-key global-map "\C-a" 'move-beginning-of-line)
850 (define-key global-map "\C-e" 'move-end-of-line)
852 (define-key ctl-x-map "`" 'next-error)
854 (defvar goto-map (make-sparse-keymap)
855 "Keymap for navigation commands.")
856 (define-key esc-map "g" goto-map)
858 (define-key goto-map "g" 'goto-line)
859 (define-key goto-map "\M-g" 'goto-line)
860 (define-key goto-map "n" 'next-error)
861 (define-key goto-map "\M-n" 'next-error)
862 (define-key goto-map "p" 'previous-error)
863 (define-key goto-map "\M-p" 'previous-error)
865 (defvar search-map (make-sparse-keymap)
866 "Keymap for search related commands.")
867 (define-key esc-map "s" search-map)
869 (define-key search-map "o" 'occur)
870 (define-key search-map "hr" 'highlight-regexp)
871 (define-key search-map "hp" 'highlight-phrase)
872 (define-key search-map "hl" 'highlight-lines-matching-regexp)
873 (define-key search-map "hu" 'unhighlight-regexp)
874 (define-key search-map "hf" 'hi-lock-find-patterns)
875 (define-key search-map "hw" 'hi-lock-write-interactive-patterns)
877 ;;(defun function-key-error ()
879 ;; (error "That function key is not bound to anything"))
881 (define-key global-map [menu] 'execute-extended-command)
882 (define-key global-map [find] 'search-forward)
884 ;; Don't do this. We define <delete> in function-key-map instead.
885 ;(define-key global-map [delete] 'backward-delete-char)
887 ;; natural bindings for terminal keycaps --- defined in X keysym order
888 (define-key global-map [C-S-backspace] 'kill-whole-line)
889 (define-key global-map [home] 'move-beginning-of-line)
890 (define-key global-map [C-home] 'beginning-of-buffer)
891 (define-key global-map [M-home] 'beginning-of-buffer-other-window)
892 (define-key esc-map [home] 'beginning-of-buffer-other-window)
893 (define-key global-map [left] 'left-char)
894 (define-key global-map [up] 'previous-line)
895 (define-key global-map [right] 'right-char
)
896 (define-key global-map
[down] 'next-line)
897 (define-key global-map [prior] 'scroll-down-command)
898 (define-key global-map [next] 'scroll-up-command)
899 (define-key global-map [C-up] 'backward-paragraph)
900 (define-key global-map [C-down] 'forward-paragraph)
901 (define-key global-map [C-prior] 'scroll-right)
902 (put 'scroll-left 'disabled t)
903 (define-key global-map [C-next] 'scroll-left)
904 (define-key global-map [M-next] 'scroll-other-window)
905 (define-key esc-map [next] 'scroll-other-window)
906 (define-key global-map [M-prior] 'scroll-other-window-down)
907 (define-key esc-map [prior] 'scroll-other-window-down)
908 (define-key esc-map [?\C-\S-v] 'scroll-other-window-down)
909 (define-key global-map [end] 'move-end-of-line)
910 (define-key global-map [C-end] 'end-of-buffer)
911 (define-key global-map [M-end] 'end-of-buffer-other-window)
912 (define-key esc-map [end] 'end-of-buffer-other-window)
913 (define-key global-map [begin] 'beginning-of-buffer)
914 (define-key global-map [M-begin] 'beginning-of-buffer-other-window)
915 (define-key esc-map [begin] 'beginning-of-buffer-other-window)
916 ;; (define-key global-map [select] 'function-key-error)
917 ;; (define-key global-map [print] 'function-key-error)
918 (define-key global-map [execute] 'execute-extended-command)
919 (define-key global-map [insert] 'overwrite-mode)
920 (define-key global-map [C-insert] 'kill-ring-save)
921 (define-key global-map [S-insert] 'yank)
922 ;; `insertchar' is what term.c produces. Should we change term.c
923 ;; to produce `insert' instead?
924 (define-key global-map [insertchar] 'overwrite-mode)
925 (define-key global-map [C-insertchar] 'kill-ring-save)
926 (define-key global-map [S-insertchar] 'yank)
927 (define-key global-map [undo] 'undo)
928 (define-key global-map [redo] 'repeat-complex-command)
929 (define-key global-map [again] 'repeat-complex-command) ; Sun keyboard
930 (define-key global-map [open] 'find-file) ; Sun
931 ;; The following wouldn't work to interrupt running code since C-g is
932 ;; treated specially in the event loop.
933 ;; (define-key global-map [stop] 'keyboard-quit) ; Sun
934 ;; (define-key global-map [clearline] 'function-key-error)
935 (define-key global-map [insertline] 'open-line)
936 (define-key global-map [deleteline] 'kill-line)
937 (define-key global-map [deletechar] 'delete-forward-char)
938 ;; (define-key global-map [backtab] 'function-key-error)
939 ;; (define-key global-map [f1] 'function-key-error)
940 ;; (define-key global-map [f2] 'function-key-error)
941 ;; (define-key global-map [f3] 'function-key-error)
942 ;; (define-key global-map [f4] 'function-key-error)
943 ;; (define-key global-map [f5] 'function-key-error)
944 ;; (define-key global-map [f6] 'function-key-error)
945 ;; (define-key global-map [f7] 'function-key-error)
946 ;; (define-key global-map [f8] 'function-key-error)
947 ;; (define-key global-map [f9] 'function-key-error)
948 ;; (define-key global-map [f10] 'function-key-error)
949 ;; (define-key global-map [f11] 'function-key-error)
950 ;; (define-key global-map [f12] 'function-key-error)
951 ;; (define-key global-map [f13] 'function-key-error)
952 ;; (define-key global-map [f14] 'function-key-error)
953 ;; (define-key global-map [f15] 'function-key-error)
954 ;; (define-key global-map [f16] 'function-key-error)
955 ;; (define-key global-map [f17] 'function-key-error)
956 ;; (define-key global-map [f18] 'function-key-error)
957 ;; (define-key global-map [f19] 'function-key-error)
958 ;; (define-key global-map [f20] 'function-key-error)
959 ;; (define-key global-map [f21] 'function-key-error)
960 ;; (define-key global-map [f22] 'function-key-error)
961 ;; (define-key global-map [f23] 'function-key-error)
962 ;; (define-key global-map [f24] 'function-key-error)
963 ;; (define-key global-map [f25] 'function-key-error)
964 ;; (define-key global-map [f26] 'function-key-error)
965 ;; (define-key global-map [f27] 'function-key-error)
966 ;; (define-key global-map [f28] 'function-key-error)
967 ;; (define-key global-map [f29] 'function-key-error)
968 ;; (define-key global-map [f30] 'function-key-error)
969 ;; (define-key global-map [f31] 'function-key-error)
970 ;; (define-key global-map [f32] 'function-key-error)
971 ;; (define-key global-map [f33] 'function-key-error)
972 ;; (define-key global-map [f34] 'function-key-error)
973 ;; (define-key global-map [f35] 'function-key-error)
974 ;; (define-key global-map [kp-backtab] 'function-key-error)
975 ;; (define-key global-map [kp-space] 'function-key-error)
976 ;; (define-key global-map [kp-tab] 'function-key-error)
977 ;; (define-key global-map [kp-enter] 'function-key-error)
978 ;; (define-key global-map [kp-f1] 'function-key-error)
979 ;; (define-key global-map [kp-f2] 'function-key-error)
980 ;; (define-key global-map [kp-f3] 'function-key-error)
981 ;; (define-key global-map [kp-f4] 'function-key-error)
982 ;; (define-key global-map [kp-multiply] 'function-key-error)
983 ;; (define-key global-map [kp-add] 'function-key-error)
984 ;; (define-key global-map [kp-separator] 'function-key-error)
985 ;; (define-key global-map [kp-subtract] 'function-key-error)
986 ;; (define-key global-map [kp-decimal] 'function-key-error)
987 ;; (define-key global-map [kp-divide] 'function-key-error)
988 ;; (define-key global-map [kp-0] 'function-key-error)
989 ;; (define-key global-map [kp-1] 'function-key-error)
990 ;; (define-key global-map [kp-2] 'function-key-error)
991 ;; (define-key global-map [kp-3] 'function-key-error)
992 ;; (define-key global-map [kp-4] 'function-key-error)
993 ;; (define-key global-map [kp-5] 'recenter)
994 ;; (define-key global-map [kp-6] 'function-key-error)
995 ;; (define-key global-map [kp-7] 'function-key-error)
996 ;; (define-key global-map [kp-8] 'function-key-error)
997 ;; (define-key global-map [kp-9] 'function-key-error)
998 ;; (define-key global-map [kp-equal] 'function-key-error)
1000 ;; X11R6 distinguishes these keys from the non-kp keys.
1001 ;; Make them behave like the non-kp keys unless otherwise bound.
1002 ;; FIXME: rather than list such mappings for every modifier-combination,
1003 ;; we should come up with a way to do it generically, something like
1004 ;; (define-key function-key-map [*-kp-home] [*-home])
1005 (define-key function-key-map [kp-home] [home])
1006 (define-key function-key-map [kp-left] [left])
1007 (define-key function-key-map [kp-up] [up])
1008 (define-key function-key-map [kp-right] [right])
1009 (define-key function-key-map [kp-down] [down])
1010 (define-key function-key-map
[kp-prior
] [prior])
1011 (define-key function-key-map [kp-next] [next])
1012 (define-key function-key-map [M-kp-next] [M-next])
1013 (define-key function-key-map [kp-end] [end])
1014 (define-key function-key-map [kp-begin] [begin])
1015 (define-key function-key-map [kp-insert] [insert])
1016 (define-key function-key-map [backspace] [?\C-?])
1017 (define-key function-key-map [delete] [?\C-?])
1018 (define-key function-key-map [kp-delete] [?\C-?])
1019 (define-key function-key-map [S-kp-end] [S-end])
1020 (define-key function-key-map [S-kp-down] [S-down])
1021 (define-key function-key-map [S-kp-next] [S-next])
1022 (define-key function-key-map [S-kp-left] [S-left])
1023 (define-key function-key-map [S-kp-right] [S-right])
1024 (define-key function-key-map [S-kp-home] [S-home])
1025 (define-key function-key-map [S-kp-up] [S-up])
1026 (define-key function-key-map [S-kp-prior] [S-prior])
1027 (define-key function-key-map [C-S-kp-end] [C-S-end])
1028 (define-key function-key-map [C-S-kp-down] [C-S-down])
1029 (define-key function-key-map [C-S-kp-next] [C-S-next])
1030 (define-key function-key-map [C-S-kp-left] [C-S-left])
1031 (define-key function-key-map [C-S-kp-right] [C-S-right])
1032 (define-key function-key-map [C-S-kp-home] [C-S-home])
1033 (define-key function-key-map [C-S-kp-up] [C-S-up])
1034 (define-key function-key-map [C-S-kp-prior] [C-S-prior])
1035 ;; Don't bind shifted keypad numeric keys, they reportedly
1036 ;; interfere with the feature of some keyboards to produce
1037 ;; numbers when NumLock is off.
1038 ;(define-key function-key-map [S-kp-1] [S-end])
1039 ;(define-key function-key-map [S-kp-2] [S-down])
1040 ;(define-key function-key-map [S-kp-3] [S-next])
1041 ;(define-key function-key-map [S-kp-4] [S-left])
1042 ;(define-key function-key-map [S-kp-6] [S-right])
1043 ;(define-key function-key-map [S-kp-7] [S-home])
1044 ;(define-key function-key-map [S-kp-8] [S-up])
1045 ;(define-key function-key-map [S-kp-9] [S-prior])
1046 (define-key function-key-map [C-S-kp-1] [C-S-end])
1047 (define-key function-key-map [C-S-kp-2] [C-S-down])
1048 (define-key function-key-map [C-S-kp-3] [C-S-next])
1049 (define-key function-key-map [C-S-kp-4] [C-S-left])
1050 (define-key function-key-map [C-S-kp-6] [C-S-right])
1051 (define-key function-key-map [C-S-kp-7] [C-S-home])
1052 (define-key function-key-map [C-S-kp-8] [C-S-up])
1053 (define-key function-key-map [C-S-kp-9] [C-S-prior])
1055 ;; Hitting C-SPC on text terminals, usually sends the ascii code 0 (aka C-@),
1056 ;; so we can't distinguish those two keys, but usually we consider C-SPC
1057 ;; (rather than C-@) as the "canonical" binding.
1058 (define-key function-key-map [?\C-@] [?\C-\s])
1059 ;; Many keyboards don't have a `backtab' key, so by convention the user
1060 ;; can use S-tab instead to access that binding.
1061 (define-key function-key-map [S-tab] [backtab])
1063 (define-key global-map [mouse-movement] 'ignore)
1065 (define-key global-map "\C-t" 'transpose-chars)
1066 (define-key esc-map "t" 'transpose-words)
1067 (define-key esc-map "\C-t" 'transpose-sexps)
1068 (define-key ctl-x-map "\C-t" 'transpose-lines)
1070 (define-key esc-map ";" 'comment-dwim)
1071 (define-key esc-map "j" 'indent-new-comment-line)
1072 (define-key esc-map "\C-j" 'indent-new-comment-line)
1073 (define-key ctl-x-map ";" 'comment-set-column)
1074 (define-key ctl-x-map "f" 'set-fill-column)
1075 (define-key ctl-x-map "$" 'set-selective-display)
1077 (define-key esc-map "@" 'mark-word)
1078 (define-key esc-map "f" 'forward-word)
1079 (define-key esc-map "b" 'backward-word)
1080 (define-key esc-map "d" 'kill-word)
1081 (define-key esc-map "\177" 'backward-kill-word)
1083 (define-key esc-map "<" 'beginning-of-buffer)
1084 (define-key esc-map ">" 'end-of-buffer)
1085 (define-key ctl-x-map "h" 'mark-whole-buffer)
1086 (define-key esc-map "\\" 'delete-horizontal-space)
1088 (defalias 'mode-specific-command-prefix (make-sparse-keymap))
1089 (defvar mode-specific-map (symbol-function 'mode-specific-command-prefix)
1090 "Keymap for characters following C-c.")
1091 (define-key global-map "\C-c" 'mode-specific-command-prefix)
1093 (global-set-key [M-right] 'forward-word)
1094 (define-key esc-map [right] 'forward-word)
1095 (global-set-key [M-left] 'backward-word)
1096 (define-key esc-map [left] 'backward-word)
1097 ;; ilya@math.ohio-state.edu says these bindings are standard on PC editors.
1098 (global-set-key [C-right] 'right-word)
1099 (global-set-key [C-left] 'left-word)
1100 ;; This is not quite compatible, but at least is analogous
1101 (global-set-key [C-delete] 'kill-word)
1102 (global-set-key [C-backspace] 'backward-kill-word)
1103 ;; This is "move to the clipboard", or as close as we come.
1104 (global-set-key [S-delete] 'kill-region)
1106 (global-set-key [C-M-left] 'backward-sexp)
1107 (define-key esc-map [C-left] 'backward-sexp)
1108 (global-set-key [C-M-right] 'forward-sexp)
1109 (define-key esc-map [C-right] 'forward-sexp)
1110 (global-set-key [C-M-up] 'backward-up-list)
1111 (define-key esc-map [C-up] 'backward-up-list)
1112 (global-set-key [C-M-down] 'down-list)
1113 (define-key esc-map [C-down] 'down-list)
1114 (global-set-key [C-M-home] 'beginning-of-defun)
1115 (define-key esc-map [C-home] 'beginning-of-defun)
1116 (global-set-key [C-M-end] 'end-of-defun)
1117 (define-key esc-map [C-end] 'end-of-defun)
1119 (define-key esc-map "\C-f" 'forward-sexp)
1120 (define-key esc-map "\C-b" 'backward-sexp)
1121 (define-key esc-map "\C-u" 'backward-up-list)
1122 (define-key esc-map "\C-@" 'mark-sexp)
1123 (define-key esc-map [?\C-\ ] 'mark-sexp)
1124 (define-key esc-map "\C-d" 'down-list)
1125 (define-key esc-map "\C-k" 'kill-sexp)
1126 ;;; These are dangerous in various situations,
1127 ;;; so let's not encourage anyone to use them.
1128 ;;;(define-key global-map [C-M-delete] 'backward-kill-sexp)
1129 ;;;(define-key global-map [C-M-backspace] 'backward-kill-sexp)
1130 (define-key esc-map [C-delete] 'backward-kill-sexp)
1131 (define-key esc-map [C-backspace] 'backward-kill-sexp)
1132 (define-key esc-map "\C-n" 'forward-list)
1133 (define-key esc-map "\C-p" 'backward-list)
1134 (define-key esc-map "\C-a" 'beginning-of-defun)
1135 (define-key esc-map "\C-e" 'end-of-defun)
1136 (define-key esc-map "\C-h" 'mark-defun)
1137 (define-key ctl-x-map "nd" 'narrow-to-defun)
1138 (define-key esc-map "(" 'insert-parentheses)
1139 (define-key esc-map ")" 'move-past-close-and-reindent)
1141 (define-key ctl-x-map "\C-e" 'eval-last-sexp)
1143 (define-key ctl-x-map "m" 'compose-mail)
1144 (define-key ctl-x-4-map "m" 'compose-mail-other-window)
1145 (define-key ctl-x-5-map "m" 'compose-mail-other-frame)
1148 (defvar ctl-x-r-map (make-sparse-keymap)
1149 "Keymap for subcommands of C-x r.")
1150 (define-key ctl-x-map "r" ctl-x-r-map)
1152 (define-key esc-map "q" 'fill-paragraph)
1153 (define-key ctl-x-map "." 'set-fill-prefix)
1155 (define-key esc-map "{" 'backward-paragraph)
1156 (define-key esc-map "}" 'forward-paragraph)
1157 (define-key esc-map "h" 'mark-paragraph)
1158 (define-key esc-map "a" 'backward-sentence)
1159 (define-key esc-map "e" 'forward-sentence)
1160 (define-key esc-map "k" 'kill-sentence)
1161 (define-key ctl-x-map "\177" 'backward-kill-sentence)
1163 (define-key ctl-x-map "[" 'backward-page)
1164 (define-key ctl-x-map "]" 'forward-page)
1165 (define-key ctl-x-map "\C-p" 'mark-page)
1166 (define-key ctl-x-map "l" 'count-lines-page)
1167 (define-key ctl-x-map "np" 'narrow-to-page)
1168 ;; (define-key ctl-x-map "p" 'narrow-to-page)
1170 (defvar abbrev-map (make-sparse-keymap)
1171 "Keymap for abbrev commands.")
1172 (define-key ctl-x-map "a" abbrev-map)
1174 (define-key abbrev-map "l" 'add-mode-abbrev)
1175 (define-key abbrev-map "\C-a" 'add-mode-abbrev)
1176 (define-key abbrev-map "g" 'add-global-abbrev)
1177 (define-key abbrev-map "+" 'add-mode-abbrev)
1178 (define-key abbrev-map "ig" 'inverse-add-global-abbrev)
1179 (define-key abbrev-map "il" 'inverse-add-mode-abbrev)
1180 ;; (define-key abbrev-map "\C-h" 'inverse-add-global-abbrev)
1181 (define-key abbrev-map "-" 'inverse-add-global-abbrev)
1182 (define-key abbrev-map "e" 'expand-abbrev)
1183 (define-key abbrev-map "'" 'expand-abbrev)
1184 ;; (define-key ctl-x-map "\C-a" 'add-mode-abbrev)
1185 ;; (define-key ctl-x-map "\+" 'add-global-abbrev)
1186 ;; (define-key ctl-x-map "\C-h" 'inverse-add-mode-abbrev)
1187 ;; (define-key ctl-x-map "\-" 'inverse-add-global-abbrev)
1188 (define-key esc-map "'" 'abbrev-prefix-mark)
1189 (define-key ctl-x-map "'" 'expand-abbrev)
1191 (define-key ctl-x-map "z" 'repeat)
1193 (define-key esc-map "\C-l" 'reposition-window)
1195 (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
1196 (define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
1199 (define-key special-event-map [sigusr1] 'ignore)
1200 (define-key special-event-map [sigusr2] 'ignore)
1202 ;; Don't look for autoload cookies in this file.
1204 ;; no-update-autoloads: t
1207 ;; arch-tag: 23b5c7e6-e47b-49ed-8c6c-ed213c5fffe0
1208 ;;; bindings.el ends here