(describe-function-1): Don't burp is the function is not a symbol.
[emacs.git] / lisp / bindings.el
blob139a4853918e2d8929dde657a23d4e16c409c781
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
5 ;; Free Software Foundation, Inc.
7 ;; Maintainer: FSF
8 ;; Keywords: internal
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Commentary:
27 ;;; Code:
29 (defun make-mode-line-mouse-map (mouse function) "\
30 Return a keymap with single entry for mouse key MOUSE on the mode line.
31 MOUSE is defined to run function FUNCTION with no args in the buffer
32 corresponding to the mode line clicked."
33 (let ((map (make-sparse-keymap)))
34 (define-key map (vector 'mode-line mouse) function)
35 map))
38 (defun mode-line-toggle-read-only (event)
39 "Like `toggle-read-only', for the mode-line."
40 (interactive "e")
41 (save-selected-window
42 (select-window (posn-window (event-start event)))
43 (toggle-read-only)
44 (force-mode-line-update)))
47 (defun mode-line-toggle-modified (event)
48 "Toggle the buffer-modified flag from the mode-line."
49 (interactive "e")
50 (save-selected-window
51 (select-window (posn-window (event-start event)))
52 (set-buffer-modified-p (not (buffer-modified-p)))
53 (force-mode-line-update)))
56 (defun mode-line-widen (event)
57 "Widen a buffer from the mode-line."
58 (interactive "e")
59 (save-selected-window
60 (select-window (posn-window (event-start event)))
61 (widen)
62 (force-mode-line-update)))
65 (defun mode-line-abbrev-mode (event)
66 "Turn off `abbrev-mode' from the mode-line."
67 (interactive "e")
68 (save-selected-window
69 (select-window (posn-window (event-start event)))
70 (abbrev-mode)
71 (force-mode-line-update)))
74 (defun mode-line-auto-fill-mode (event)
75 "Turn off `auto-fill-mode' from the mode-line."
76 (interactive "e")
77 (save-selected-window
78 (select-window (posn-window (event-start event)))
79 (auto-fill-mode)
80 (force-mode-line-update)))
83 (defvar mode-line-input-method-map
84 (let ((map (make-sparse-keymap)))
85 (define-key map [mode-line mouse-2]
86 (lambda (e)
87 (interactive "e")
88 (save-selected-window
89 (select-window
90 (posn-window (event-start e)))
91 (toggle-input-method)
92 (force-mode-line-update))))
93 (define-key map [mode-line mouse-3]
94 (lambda (e)
95 (interactive "e")
96 (save-selected-window
97 (select-window
98 (posn-window (event-start e)))
99 (describe-current-input-method))))
100 (purecopy map)))
103 (defvar mode-line-coding-system-map
104 (let ((map (make-sparse-keymap)))
105 (define-key map [mode-line mouse-1]
106 (lambda (e)
107 (interactive "e")
108 (save-selected-window
109 (select-window (posn-window (event-start e)))
110 (when (and enable-multibyte-characters
111 buffer-file-coding-system)
112 (describe-coding-system buffer-file-coding-system)))))
113 (purecopy map))
114 "Local keymap for the coding-system part of the mode line.")
117 (defun mode-line-change-eol (event)
118 "Cycle through the various possible kinds of end-of-line styles."
119 (interactive "e")
120 (with-selected-window (posn-window (event-start event))
121 (let ((eol (coding-system-eol-type buffer-file-coding-system)))
122 (set-buffer-file-coding-system
123 (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix))))))
125 (defvar mode-line-eol-desc-cache nil)
127 (defun mode-line-eol-desc ()
128 (let* ((eol (coding-system-eol-type buffer-file-coding-system))
129 (mnemonic (coding-system-eol-type-mnemonic buffer-file-coding-system))
130 (desc (assoc eol mode-line-eol-desc-cache)))
131 (if (and desc (eq (cadr desc) mnemonic))
132 (cddr desc)
133 (if desc (setq mode-line-eol-desc-cache nil)) ;Flush the cache if stale.
134 (setq desc
135 (propertize
136 mnemonic
137 'help-echo (format "End-of-line style: %s\nmouse-1 to cycle"
138 (if (eq eol 0) "Unix-style LF"
139 (if (eq eol 1) "DOS-style CRLF"
140 (if (eq eol 2) "Mac-style CR"
141 "Undecided"))))
142 'keymap
143 (eval-when-compile
144 (let ((map (make-sparse-keymap)))
145 (define-key map [mode-line mouse-1] 'mode-line-change-eol)
146 map))
147 'mouse-face 'mode-line-highlight))
148 (push (cons eol (cons mnemonic desc)) mode-line-eol-desc-cache)
149 desc)))
151 (defvar mode-line-client
152 `(""
153 (:propertize ("" (:eval (if (frame-parameter nil 'client) "@" "")))
154 help-echo "emacsclient frame"))
155 "Mode-line control for identifying emacsclient frames.")
156 ;; Autoload all risky properties if this file no longer dumped.
157 (put 'mode-line-client 'risky-local-variable t)
159 (defvar mode-line-mule-info
160 `(""
161 (current-input-method
162 (:propertize ("" current-input-method-title)
163 help-echo (concat
164 "Current input method: "
165 current-input-method
166 "\n\
167 mouse-2: Disable input method\n\
168 mouse-3: Describe current input method")
169 local-map ,mode-line-input-method-map
170 mouse-face mode-line-highlight))
171 ,(propertize
172 "%z"
173 'help-echo
174 #'(lambda (window object point)
175 (with-current-buffer (window-buffer window)
176 ;; Don't show this tip if the coding system is nil,
177 ;; it reads like a bug, and is not useful anyway.
178 (when buffer-file-coding-system
179 (format "Buffer coding system %s\nmouse-1: describe coding system"
180 (if enable-multibyte-characters
181 (concat "(multi-byte): "
182 (symbol-name buffer-file-coding-system))
183 (concat "(unibyte): "
184 (symbol-name buffer-file-coding-system)))))))
185 'mouse-face 'mode-line-highlight
186 'local-map mode-line-coding-system-map)
187 (:eval (mode-line-eol-desc)))
188 "Mode-line control for displaying information of multilingual environment.
189 Normally it displays current input method (if any activated) and
190 mnemonics of the following coding systems:
191 coding system for saving or writing the current buffer
192 coding system for keyboard input (if Emacs is running on terminal)
193 coding system for terminal output (if Emacs is running on terminal)"
194 ;; Currently not:
195 ;; coding system for decoding output of buffer process (if any)
196 ;; coding system for encoding text to send to buffer process (if any)."
199 (put 'mode-line-mule-info 'risky-local-variable t)
200 (make-variable-buffer-local 'mode-line-mule-info)
202 ;; MSDOS frames have window-system, but want the Fn identification.
203 (defun mode-line-frame-control ()
204 "Compute mode-line control for frame identification.
205 Value is used for `mode-line-frame-identification', which see."
206 (if (or (null window-system)
207 (eq window-system 'pc))
208 "-%F "
209 " "))
211 ;; We need to defer the call to mode-line-frame-control to the time
212 ;; the mode line is actually displayed.
213 (defvar mode-line-frame-identification '(:eval (mode-line-frame-control))
214 "Mode-line control to describe the current frame.")
215 (put 'mode-line-frame-identification 'risky-local-variable t)
217 (defvar mode-line-process nil "\
218 Mode-line control for displaying info on process status.
219 Normally nil in most modes, since there is no process to display.")
221 (put 'mode-line-process 'risky-local-variable t)
222 (make-variable-buffer-local 'mode-line-process)
224 (defvar mode-line-modified
225 (list (propertize
226 "%1*"
227 'help-echo (purecopy (lambda (window object point)
228 (format "Buffer is %s\nmouse-1 toggles"
229 (save-selected-window
230 (select-window window)
231 (if buffer-read-only
232 "read-only"
233 "writable")))))
234 'local-map (purecopy (make-mode-line-mouse-map
235 'mouse-1
236 #'mode-line-toggle-read-only))
237 'mouse-face 'mode-line-highlight)
238 (propertize
239 "%1+"
240 'help-echo (purecopy (lambda (window object point)
241 (format "Buffer is %sodified\nmouse-1 toggles modified state"
242 (save-selected-window
243 (select-window window)
244 (if (buffer-modified-p)
246 "not m")))))
247 'local-map (purecopy (make-mode-line-mouse-map
248 'mouse-1 #'mode-line-toggle-modified))
249 'mouse-face 'mode-line-highlight))
250 "Mode-line control for displaying whether current buffer is modified.")
252 (put 'mode-line-modified 'risky-local-variable t)
253 (make-variable-buffer-local 'mode-line-modified)
255 (defvar mode-line-remote
256 (list (propertize
257 "%1@"
258 'mouse-face 'mode-line-highlight
259 'help-echo (purecopy (lambda (window object point)
260 (format "%s"
261 (save-selected-window
262 (select-window window)
263 (concat
264 (if (file-remote-p default-directory)
265 "Current directory is remote: "
266 "Current directory is local: ")
267 default-directory)))))))
268 "Mode-line flag to show if default-directory for current buffer is remote.")
269 (put 'mode-line-remote 'risky-local-variable t)
271 (make-variable-buffer-local 'mode-line-remote)
273 ;; Actual initialization is below.
274 (defvar mode-line-position nil
275 "Mode-line control for displaying the position in the buffer.
276 Normally displays the buffer percentage and, optionally, the
277 buffer size, the line number and the column number.")
278 (put 'mode-line-position 'risky-local-variable t)
280 (defvar mode-line-modes nil
281 "Mode-line control for displaying major and minor modes.")
282 (put 'mode-line-modes 'risky-local-variable t)
284 (defvar mode-line-mode-menu (make-sparse-keymap "Minor Modes") "\
285 Menu of mode operations in the mode line.")
287 (defvar mode-line-major-mode-keymap
288 (let ((map (make-sparse-keymap)))
289 (define-key map [mode-line down-mouse-1]
290 '(menu-item "Menu Bar" ignore
291 :filter (lambda (_) (mouse-menu-major-mode-map))))
292 (define-key map [mode-line mouse-2] 'describe-mode)
293 (define-key map [mode-line down-mouse-3] mode-line-mode-menu)
294 map) "\
295 Keymap to display on major mode.")
297 (defvar mode-line-minor-mode-keymap
298 (let ((map (make-sparse-keymap)))
299 (define-key map [mode-line down-mouse-1] 'mouse-minor-mode-menu)
300 (define-key map [mode-line mouse-2] 'mode-line-minor-mode-help)
301 (define-key map [mode-line down-mouse-3] mode-line-mode-menu)
302 (define-key map [header-line down-mouse-3] mode-line-mode-menu)
303 map) "\
304 Keymap to display on minor modes.")
306 (defvar mode-line-column-line-number-mode-map
307 (let ((map (make-sparse-keymap))
308 (menu-map (make-sparse-keymap "Toggle Line and Column Number Display")))
309 (define-key menu-map [line-number-mode]
310 `(menu-item ,(purecopy "Display Line Numbers") line-number-mode
311 :help "Toggle displaying line numbers in the mode-line"
312 :button (:toggle . line-number-mode)))
313 (define-key menu-map [column-number-mode]
314 `(menu-item ,(purecopy "Display Column Numbers") column-number-mode
315 :help "Toggle displaying column numbers in the mode-line"
316 :button (:toggle . column-number-mode)))
317 (define-key map [mode-line down-mouse-1] menu-map)
318 map) "\
319 Keymap to display on column and line numbers.")
321 (let* ((help-echo
322 ;; The multi-line message doesn't work terribly well on the
323 ;; bottom mode line... Better ideas?
324 ;; "\
325 ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete,
326 ;; drag-mouse-1: resize, C-mouse-2: split horizontally"
327 "mouse-1: Select (drag to resize)\n\
328 mouse-2: Make current window occupy the whole frame\n\
329 mouse-3: Remove current window from display")
330 (recursive-edit-help-echo "Recursive edit, type C-M-c to get out")
331 (dashes (propertize "--" 'help-echo help-echo))
332 (standard-mode-line-format
333 (list
334 "%e"
335 (propertize "-" 'help-echo help-echo)
336 'mode-line-mule-info
337 'mode-line-client
338 'mode-line-modified
339 'mode-line-remote
340 'mode-line-frame-identification
341 'mode-line-buffer-identification
342 (propertize " " 'help-echo help-echo)
343 'mode-line-position
344 '(vc-mode vc-mode)
345 (propertize " " 'help-echo help-echo)
346 'mode-line-modes
347 `(which-func-mode ("" which-func-format ,dashes))
348 `(global-mode-string ("" global-mode-string ,dashes))
349 (propertize "-%-" 'help-echo help-echo)))
350 (standard-mode-line-modes
351 (list
352 (propertize "%[" 'help-echo recursive-edit-help-echo)
353 (propertize "(" 'help-echo help-echo)
354 `(:propertize ("" mode-name)
355 help-echo "Major mode\n\
356 mouse-1: Display major mode menu\n\
357 mouse-2: Show help for major mode\n\
358 mouse-3: Toggle minor modes"
359 mouse-face mode-line-highlight
360 local-map ,mode-line-major-mode-keymap)
361 '("" mode-line-process)
362 `(:propertize ("" minor-mode-alist)
363 mouse-face mode-line-highlight
364 help-echo "Minor mode\n\
365 mouse-1: Display minor mode menu\n\
366 mouse-2: Show help for minor mode\n\
367 mouse-3: Toggle minor modes"
368 local-map ,mode-line-minor-mode-keymap)
369 (propertize "%n" 'help-echo "mouse-2: Remove narrowing from the current buffer"
370 'mouse-face 'mode-line-highlight
371 'local-map (make-mode-line-mouse-map
372 'mouse-2 #'mode-line-widen))
373 (propertize ")" 'help-echo help-echo)
374 (propertize "%]" 'help-echo recursive-edit-help-echo)
375 (propertize "--" 'help-echo help-echo)))
377 (standard-mode-line-position
378 `((-3 ,(propertize
379 "%p"
380 'local-map mode-line-column-line-number-mode-map
381 'mouse-face 'mode-line-highlight
382 ;; XXX needs better description
383 'help-echo "Size indication mode\n\
384 mouse-1: Display Line and Column Mode Menu"))
385 (size-indication-mode
386 (8 ,(propertize
387 " of %I"
388 'local-map mode-line-column-line-number-mode-map
389 'mouse-face 'mode-line-highlight
390 ;; XXX needs better description
391 'help-echo "Size indication mode\n\
392 mouse-1: Display Line and Column Mode Menu")))
393 (line-number-mode
394 ((column-number-mode
395 (10 ,(propertize
396 " (%l,%c)"
397 'local-map mode-line-column-line-number-mode-map
398 'mouse-face 'mode-line-highlight
399 'help-echo "Line number and Column number\n\
400 mouse-1: Display Line and Column Mode Menu"))
401 (6 ,(propertize
402 " L%l"
403 'local-map mode-line-column-line-number-mode-map
404 'mouse-face 'mode-line-highlight
405 'help-echo "Line Number\n\
406 mouse-1: Display Line and Column Mode Menu"))))
407 ((column-number-mode
408 (5 ,(propertize
409 " C%c"
410 'local-map mode-line-column-line-number-mode-map
411 'mouse-face 'mode-line-highlight
412 'help-echo "Column number\n\
413 mouse-1: Display Line and Column Mode Menu"))))))))
415 (setq-default mode-line-format standard-mode-line-format)
416 (put 'mode-line-format 'standard-value
417 (list `(quote ,standard-mode-line-format)))
419 (setq-default mode-line-modes standard-mode-line-modes)
420 (put 'mode-line-modes 'standard-value
421 (list `(quote ,standard-mode-line-modes)))
423 (setq-default mode-line-position standard-mode-line-position)
424 (put 'mode-line-position 'standard-value
425 (list `(quote ,standard-mode-line-position))))
427 (defvar mode-line-buffer-identification-keymap
428 ;; Add menu of buffer operations to the buffer identification part
429 ;; of the mode line.or header line.
430 (let ((map (make-sparse-keymap)))
431 ;; Bind down- events so that the global keymap won't ``shine
432 ;; through''.
433 (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
434 (define-key map [header-line down-mouse-1] 'ignore)
435 (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
436 (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
437 (define-key map [header-line down-mouse-3] 'ignore)
438 (define-key map [header-line mouse-3] 'mode-line-next-buffer)
439 map) "\
440 Keymap for what is displayed by `mode-line-buffer-identification'.")
442 (defun propertized-buffer-identification (fmt)
443 "Return a list suitable for `mode-line-buffer-identification'.
444 FMT is a format specifier such as \"%12b\". This function adds
445 text properties for face, help-echo, and local-map to it."
446 (list (propertize fmt
447 'face 'mode-line-buffer-id
448 'help-echo
449 (purecopy "Buffer name\n\
450 mouse-1: previous buffer\n\
451 mouse-3: next buffer")
452 'mouse-face 'mode-line-highlight
453 'local-map mode-line-buffer-identification-keymap)))
455 (defvar mode-line-buffer-identification (propertized-buffer-identification "%12b") "\
456 Mode-line control for identifying the buffer being displayed.
457 Its default value is (\"%12b\") with some text properties added.
458 Major modes that edit things other than ordinary files may change this
459 \(e.g. Info, Dired,...)")
461 (put 'mode-line-buffer-identification 'risky-local-variable t)
462 (make-variable-buffer-local 'mode-line-buffer-identification)
464 (defun unbury-buffer () "\
465 Switch to the last buffer in the buffer list."
466 (interactive)
467 (switch-to-buffer (last-buffer)))
469 (defun mode-line-unbury-buffer (event) "\
470 Call `unbury-buffer' in this window."
471 (interactive "e")
472 (save-selected-window
473 (select-window (posn-window (event-start event)))
474 (unbury-buffer)))
476 (defun mode-line-bury-buffer (event) "\
477 Like `bury-buffer', but temporarily select EVENT's window."
478 (interactive "e")
479 (save-selected-window
480 (select-window (posn-window (event-start event)))
481 (bury-buffer)))
483 (defun mode-line-other-buffer () "\
484 Switch to the most recently selected buffer other than the current one."
485 (interactive)
486 (switch-to-buffer (other-buffer)))
488 (defun mode-line-next-buffer (event)
489 "Like `next-buffer', but temporarily select EVENT's window."
490 (interactive "e")
491 (save-selected-window
492 (select-window (posn-window (event-start event)))
493 (next-buffer)))
495 (defun mode-line-previous-buffer (event)
496 "Like `previous-buffer', but temporarily select EVENT's window."
497 (interactive "e")
498 (save-selected-window
499 (select-window (posn-window (event-start event)))
500 (previous-buffer)))
502 (defmacro bound-and-true-p (var)
503 "Return the value of symbol VAR if it is bound, else nil."
504 `(and (boundp (quote ,var)) ,var))
506 ;; Use mode-line-mode-menu for local minor-modes only.
507 ;; Global ones can go on the menubar (Options --> Show/Hide).
508 (define-key mode-line-mode-menu [overwrite-mode]
509 `(menu-item ,(purecopy "Overwrite (Ovwrt)") overwrite-mode
510 :help ,(purecopy "Overwrite mode: typed characters replace existing text")
511 :button (:toggle . overwrite-mode)))
512 (define-key mode-line-mode-menu [outline-minor-mode]
513 `(menu-item ,(purecopy "Outline (Outl)") outline-minor-mode
514 ;; XXX: This needs a good, brief description.
515 :help ,(purecopy "")
516 :button (:toggle . (bound-and-true-p outline-minor-mode))))
517 (define-key mode-line-mode-menu [highlight-changes-mode]
518 `(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode
519 :help ,(purecopy "Show changes in the buffer in a distinctive color")
520 :button (:toggle . (bound-and-true-p highlight-changes-mode))))
521 (define-key mode-line-mode-menu [hide-ifdef-mode]
522 `(menu-item ,(purecopy "Hide ifdef (Ifdef)") hide-ifdef-mode
523 :help ,(purecopy "Show/Hide code within #ifdef constructs")
524 :button (:toggle . (bound-and-true-p hide-ifdef-mode))))
525 (define-key mode-line-mode-menu [glasses-mode]
526 `(menu-item ,(purecopy "Glasses (o^o)") glasses-mode
527 :help ,(purecopy "Insert virtual separators to make long identifiers easy to read")
528 :button (:toggle . (bound-and-true-p glasses-mode))))
529 (define-key mode-line-mode-menu [font-lock-mode]
530 `(menu-item ,(purecopy "Font Lock") font-lock-mode
531 :help ,(purecopy "Syntax coloring")
532 :button (:toggle . font-lock-mode)))
533 (define-key mode-line-mode-menu [flyspell-mode]
534 `(menu-item ,(purecopy "Flyspell (Fly)") flyspell-mode
535 :help ,(purecopy "Spell checking on the fly")
536 :button (:toggle . (bound-and-true-p flyspell-mode))))
537 (define-key mode-line-mode-menu [auto-revert-tail-mode]
538 `(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode
539 :help ,(purecopy "Revert the tail of the buffer when buffer grows")
540 :enable (buffer-file-name)
541 :button (:toggle . (bound-and-true-p auto-revert-tail-mode))))
542 (define-key mode-line-mode-menu [auto-revert-mode]
543 `(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode
544 :help ,(purecopy "Revert the buffer when the file on disk changes")
545 :button (:toggle . (bound-and-true-p auto-revert-mode))))
546 (define-key mode-line-mode-menu [auto-fill-mode]
547 `(menu-item ,(purecopy "Auto fill (Fill)") auto-fill-mode
548 :help ,(purecopy "Automatically insert new lines")
549 :button (:toggle . auto-fill-function)))
550 (define-key mode-line-mode-menu [abbrev-mode]
551 `(menu-item ,(purecopy "Abbrev (Abbrev)") abbrev-mode
552 :help ,(purecopy "Automatically expand abbreviations")
553 :button (:toggle . abbrev-mode)))
555 (defun mode-line-minor-mode-help (event)
556 "Describe minor mode for EVENT on minor modes area of the mode line."
557 (interactive "@e")
558 (let ((indicator (car (nth 4 (car (cdr event))))))
559 (describe-minor-mode-from-indicator indicator)))
561 (defvar minor-mode-alist nil "\
562 Alist saying how to show minor modes in the mode line.
563 Each element looks like (VARIABLE STRING);
564 STRING is included in the mode line if VARIABLE's value is non-nil.
566 Actually, STRING need not be a string; any possible mode-line element
567 is okay. See `mode-line-format'.")
568 (put 'minor-mode-alist 'risky-local-variable t)
569 ;; Don't use purecopy here--some people want to change these strings.
570 (setq minor-mode-alist
571 '((abbrev-mode " Abbrev")
572 (overwrite-mode overwrite-mode)
573 (auto-fill-function " Fill")
574 ;; not really a minor mode...
575 (defining-kbd-macro " Def")))
577 ;; These variables are used by autoloadable packages.
578 ;; They are defined here so that they do not get overridden
579 ;; by the loading of those packages.
581 ;; Names in directory that end in one of these
582 ;; are ignored in completion,
583 ;; making it more likely you will get a unique match.
584 (setq completion-ignored-extensions
585 (append
586 (cond ((memq system-type '(ms-dos windows-nt))
587 '(".o" "~" ".bin" ".bak" ".obj" ".map" ".ico" ".pif" ".lnk"
588 ".a" ".ln" ".blg" ".bbl" ".dll" ".drv" ".vxd" ".386"))
590 '(".o" "~" ".bin" ".lbin" ".so"
591 ".a" ".ln" ".blg" ".bbl")))
592 '(".elc" ".lof"
593 ".glo" ".idx" ".lot"
594 ;; VCS metadata directories
595 ".svn/" ".hg/" ".git/" ".bzr/" "CVS/" "_darcs/" "_MTN/"
596 ;; TeX-related
597 ".fmt" ".tfm"
598 ;; Java compiled
599 ".class"
600 ;; CLISP
601 ".fas" ".lib" ".mem"
602 ;; CMUCL
603 ".x86f" ".sparcf"
604 ;; Other CL implementations (Allegro, LispWorks, OpenMCL)
605 ".fasl" ".ufsl" ".fsl" ".dxl" ".pfsl" ".dfsl"
606 ".p64fsl" ".d64fsl" ".dx64fsl"
607 ;; Libtool
608 ".lo" ".la"
609 ;; Gettext
610 ".gmo" ".mo"
611 ;; Texinfo-related
612 ;; This used to contain .log, but that's commonly used for log
613 ;; files you do want to see, not just TeX stuff. -- fx
614 ".toc" ".aux"
615 ".cp" ".fn" ".ky" ".pg" ".tp" ".vr"
616 ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs"
617 ;; Python byte-compiled
618 ".pyc" ".pyo")))
620 ;; Suffixes used for executables.
621 (setq exec-suffixes
622 (cond
623 ((memq system-type '(ms-dos windows-nt))
624 '(".exe" ".com" ".bat" ".cmd" ".btm" ""))
626 '(""))))
628 ;; Packages should add to this list appropriately when they are
629 ;; loaded, rather than listing everything here.
630 (setq debug-ignored-errors
631 '(beginning-of-line beginning-of-buffer end-of-line
632 end-of-buffer end-of-file buffer-read-only
633 file-supersession
634 "^Previous command was not a yank$"
635 "^Minibuffer window is not active$"
636 "^No previous history search regexp$"
637 "^No later matching history item$"
638 "^No earlier matching history item$"
639 "^End of history; no default available$"
640 "^End of defaults; no next item$"
641 "^Beginning of history; no preceding item$"
642 "^No recursive edit is in progress$"
643 "^Changes to be undone are outside visible portion of buffer$"
644 "^No undo information in this buffer$"
645 "^No further undo information"
646 "^Save not confirmed$"
647 "^Recover-file cancelled\\.$"
648 "^Cannot switch buffers in a dedicated window$"
652 (make-variable-buffer-local 'indent-tabs-mode)
654 ;; We have base64 and md5 functions built in now.
655 (provide 'base64)
656 (provide 'md5)
657 (provide 'overlay '(display syntax-table field))
658 (provide 'text-properties '(display syntax-table field point-entered))
660 (define-key esc-map "\t" 'complete-symbol)
662 (defun complete-symbol (arg) "\
663 Perform tags completion on the text around point.
664 Completes to the set of names listed in the current tags table.
665 The string to complete is chosen in the same way as the default
666 for \\[find-tag] (which see).
668 With a prefix argument, this command does completion within
669 the collection of symbols listed in the index of the manual for the
670 language you are using."
671 (interactive "P")
672 (if arg
673 (info-complete-symbol)
674 (if (fboundp 'complete-tag)
675 (complete-tag)
676 ;; Don't autoload etags if we have no tags table.
677 (error "%s" (substitute-command-keys
678 "No tags table loaded; use \\[visit-tags-table] to load one")))))
680 ;; Reduce total amount of space we must allocate during this function
681 ;; that we will not need to keep permanently.
682 (garbage-collect)
685 (setq help-event-list '(help f1))
687 (make-variable-buffer-local 'minor-mode-overriding-map-alist)
689 ;; From frame.c
690 (global-set-key [switch-frame] 'handle-switch-frame)
691 (global-set-key [select-window] 'handle-select-window)
693 ;; FIXME: Do those 3 events really ever reach the global-map ?
694 ;; It seems that they can't because they're handled via
695 ;; special-event-map which is used at very low-level. -stef
696 (global-set-key [delete-frame] 'handle-delete-frame)
697 (global-set-key [iconify-frame] 'ignore-event)
698 (global-set-key [make-frame-visible] 'ignore-event)
701 ;These commands are defined in editfns.c
702 ;but they are not assigned to keys there.
703 (put 'narrow-to-region 'disabled t)
705 (defvar narrow-map (make-sparse-keymap)
706 "Keymap for narrowing commands.")
707 (define-key ctl-x-map "n" narrow-map)
709 (define-key narrow-map "n" 'narrow-to-region)
710 (define-key narrow-map "w" 'widen)
712 ;; Quitting
713 (define-key global-map "\e\e\e" 'keyboard-escape-quit)
714 (define-key global-map "\C-g" 'keyboard-quit)
716 ;; Used to be in termdev.el: when using several terminals, make C-z
717 ;; suspend only the relevant terminal.
718 (substitute-key-definition 'suspend-emacs 'suspend-frame global-map)
720 (define-key global-map "\C-j" 'newline-and-indent)
721 (define-key global-map "\C-m" 'newline)
722 (define-key global-map "\C-o" 'open-line)
723 (define-key esc-map "\C-o" 'split-line)
724 (define-key global-map "\C-q" 'quoted-insert)
725 (define-key esc-map "^" 'delete-indentation)
726 (define-key esc-map "\\" 'delete-horizontal-space)
727 (define-key esc-map "m" 'back-to-indentation)
728 (define-key ctl-x-map "\C-o" 'delete-blank-lines)
729 (define-key esc-map " " 'just-one-space)
730 (define-key esc-map "z" 'zap-to-char)
731 (define-key esc-map "=" 'count-lines-region)
732 (define-key ctl-x-map "=" 'what-cursor-position)
733 (define-key esc-map ":" 'eval-expression)
734 ;; Define ESC ESC : like ESC : for people who type ESC ESC out of habit.
735 (define-key esc-map "\M-:" 'eval-expression)
736 ;; Changed from C-x ESC so that function keys work following C-x.
737 (define-key ctl-x-map "\e\e" 'repeat-complex-command)
738 ;; New binding analogous to M-:.
739 (define-key ctl-x-map "\M-:" 'repeat-complex-command)
740 (define-key ctl-x-map "u" 'undo)
741 (put 'undo :advertised-binding [?\C-x ?u])
742 ;; Many people are used to typing C-/ on X terminals and getting C-_.
743 (define-key global-map [?\C-/] 'undo)
744 (define-key global-map "\C-_" 'undo)
745 ;; Richard said that we should not use C-x <uppercase letter> and I have
746 ;; no idea whereas to bind it. Any suggestion welcome. -stef
747 ;; (define-key ctl-x-map "U" 'undo-only)
749 (define-key esc-map "!" 'shell-command)
750 (define-key esc-map "|" 'shell-command-on-region)
751 (define-key esc-map "&" 'async-shell-command)
753 (define-key ctl-x-map [right] 'next-buffer)
754 (define-key ctl-x-map [C-right] 'next-buffer)
755 (define-key ctl-x-map [left] 'previous-buffer)
756 (define-key ctl-x-map [C-left] 'previous-buffer)
758 (let ((map minibuffer-local-map))
759 (define-key map "\en" 'next-history-element)
760 (define-key map [next] 'next-history-element)
761 (define-key map [down] 'next-history-element)
762 (define-key map "\ep" 'previous-history-element)
763 (define-key map [prior] 'previous-history-element)
764 (define-key map [up] 'previous-history-element)
765 (define-key map "\es" 'next-matching-history-element)
766 (define-key map "\er" 'previous-matching-history-element)
767 ;; Override the global binding (which calls indent-relative via
768 ;; indent-for-tab-command). The alignment that indent-relative tries to
769 ;; do doesn't make much sense here since the prompt messes it up.
770 (define-key map "\t" 'self-insert-command)
771 (define-key map [C-tab] 'file-cache-minibuffer-complete))
773 (define-key global-map "\C-u" 'universal-argument)
774 (let ((i ?0))
775 (while (<= i ?9)
776 (define-key esc-map (char-to-string i) 'digit-argument)
777 (setq i (1+ i))))
778 (define-key esc-map "-" 'negative-argument)
779 ;; Define control-digits.
780 (let ((i ?0))
781 (while (<= i ?9)
782 (define-key global-map (read (format "[?\\C-%c]" i)) 'digit-argument)
783 (setq i (1+ i))))
784 (define-key global-map [?\C--] 'negative-argument)
785 ;; Define control-meta-digits.
786 (let ((i ?0))
787 (while (<= i ?9)
788 (define-key esc-map (read (format "[?\\C-%c]" i)) 'digit-argument)
789 (setq i (1+ i))))
790 (define-key global-map [?\C-\M--] 'negative-argument)
792 (define-key global-map "\C-k" 'kill-line)
793 (define-key global-map "\C-w" 'kill-region)
794 (define-key esc-map "w" 'kill-ring-save)
795 (define-key esc-map "\C-w" 'append-next-kill)
796 (define-key global-map "\C-y" 'yank)
797 (define-key esc-map "y" 'yank-pop)
799 ;; (define-key ctl-x-map "a" 'append-to-buffer)
801 (define-key global-map "\C-@" 'set-mark-command)
802 ;; Many people are used to typing C-SPC and getting C-@.
803 (define-key global-map [?\C- ] 'set-mark-command)
804 (define-key ctl-x-map "\C-x" 'exchange-point-and-mark)
805 (define-key ctl-x-map "\C-@" 'pop-global-mark)
806 (define-key ctl-x-map [?\C- ] 'pop-global-mark)
808 (define-key global-map "\C-n" 'next-line)
809 (define-key global-map "\C-p" 'previous-line)
810 (define-key ctl-x-map "\C-n" 'set-goal-column)
811 (define-key global-map "\C-a" 'move-beginning-of-line)
812 (define-key global-map "\C-e" 'move-end-of-line)
814 (define-key ctl-x-map "`" 'next-error)
816 (defvar goto-map (make-sparse-keymap)
817 "Keymap for navigation commands.")
818 (define-key esc-map "g" goto-map)
820 (define-key goto-map "g" 'goto-line)
821 (define-key goto-map "\M-g" 'goto-line)
822 (define-key goto-map "n" 'next-error)
823 (define-key goto-map "\M-n" 'next-error)
824 (define-key goto-map "p" 'previous-error)
825 (define-key goto-map "\M-p" 'previous-error)
827 (defvar search-map (make-sparse-keymap)
828 "Keymap for search related commands.")
829 (define-key esc-map "s" search-map)
831 (define-key search-map "o" 'occur)
832 (define-key search-map "hr" 'highlight-regexp)
833 (define-key search-map "hp" 'highlight-phrase)
834 (define-key search-map "hl" 'highlight-lines-matching-regexp)
835 (define-key search-map "hu" 'unhighlight-regexp)
836 (define-key search-map "hf" 'hi-lock-find-patterns)
837 (define-key search-map "hw" 'hi-lock-write-interactive-patterns)
839 ;;(defun function-key-error ()
840 ;; (interactive)
841 ;; (error "That function key is not bound to anything"))
843 (define-key global-map [menu] 'execute-extended-command)
844 (define-key global-map [find] 'search-forward)
846 ;; Don't do this. We define <delete> in function-key-map instead.
847 ;(define-key global-map [delete] 'backward-delete-char)
849 ;; natural bindings for terminal keycaps --- defined in X keysym order
850 (define-key global-map [C-S-backspace] 'kill-whole-line)
851 (define-key global-map [home] 'move-beginning-of-line)
852 (define-key global-map [C-home] 'beginning-of-buffer)
853 (define-key global-map [M-home] 'beginning-of-buffer-other-window)
854 (define-key esc-map [home] 'beginning-of-buffer-other-window)
855 (define-key global-map [left] 'backward-char)
856 (define-key global-map [up] 'previous-line)
857 (define-key global-map [right] 'forward-char)
858 (define-key global-map [down] 'next-line)
859 (define-key global-map [prior] 'scroll-down)
860 (define-key global-map [next] 'scroll-up)
861 (define-key global-map [C-up] 'backward-paragraph)
862 (define-key global-map [C-down] 'forward-paragraph)
863 (define-key global-map [C-prior] 'scroll-right)
864 (put 'scroll-left 'disabled t)
865 (define-key global-map [C-next] 'scroll-left)
866 (define-key global-map [M-next] 'scroll-other-window)
867 (define-key esc-map [next] 'scroll-other-window)
868 (define-key global-map [M-prior] 'scroll-other-window-down)
869 (define-key esc-map [prior] 'scroll-other-window-down)
870 (define-key esc-map [?\C-\S-v] 'scroll-other-window-down)
871 (define-key global-map [end] 'move-end-of-line)
872 (define-key global-map [C-end] 'end-of-buffer)
873 (define-key global-map [M-end] 'end-of-buffer-other-window)
874 (define-key esc-map [end] 'end-of-buffer-other-window)
875 (define-key global-map [begin] 'beginning-of-buffer)
876 (define-key global-map [M-begin] 'beginning-of-buffer-other-window)
877 (define-key esc-map [begin] 'beginning-of-buffer-other-window)
878 ;; (define-key global-map [select] 'function-key-error)
879 ;; (define-key global-map [print] 'function-key-error)
880 (define-key global-map [execute] 'execute-extended-command)
881 (define-key global-map [insert] 'overwrite-mode)
882 (define-key global-map [C-insert] 'kill-ring-save)
883 (define-key global-map [S-insert] 'yank)
884 ;; `insertchar' is what term.c produces. Should we change term.c
885 ;; to produce `insert' instead?
886 (define-key global-map [insertchar] 'overwrite-mode)
887 (define-key global-map [C-insertchar] 'kill-ring-save)
888 (define-key global-map [S-insertchar] 'yank)
889 (define-key global-map [undo] 'undo)
890 (define-key global-map [redo] 'repeat-complex-command)
891 (define-key global-map [again] 'repeat-complex-command) ; Sun keyboard
892 (define-key global-map [open] 'find-file) ; Sun
893 ;; The following wouldn't work to interrupt running code since C-g is
894 ;; treated specially in the event loop.
895 ;; (define-key global-map [stop] 'keyboard-quit) ; Sun
896 ;; (define-key global-map [clearline] 'function-key-error)
897 (define-key global-map [insertline] 'open-line)
898 (define-key global-map [deleteline] 'kill-line)
899 (define-key global-map [deletechar] 'delete-char)
900 ;; (define-key global-map [backtab] 'function-key-error)
901 ;; (define-key global-map [f1] 'function-key-error)
902 ;; (define-key global-map [f2] 'function-key-error)
903 ;; (define-key global-map [f3] 'function-key-error)
904 ;; (define-key global-map [f4] 'function-key-error)
905 ;; (define-key global-map [f5] 'function-key-error)
906 ;; (define-key global-map [f6] 'function-key-error)
907 ;; (define-key global-map [f7] 'function-key-error)
908 ;; (define-key global-map [f8] 'function-key-error)
909 ;; (define-key global-map [f9] 'function-key-error)
910 ;; (define-key global-map [f10] 'function-key-error)
911 ;; (define-key global-map [f11] 'function-key-error)
912 ;; (define-key global-map [f12] 'function-key-error)
913 ;; (define-key global-map [f13] 'function-key-error)
914 ;; (define-key global-map [f14] 'function-key-error)
915 ;; (define-key global-map [f15] 'function-key-error)
916 ;; (define-key global-map [f16] 'function-key-error)
917 ;; (define-key global-map [f17] 'function-key-error)
918 ;; (define-key global-map [f18] 'function-key-error)
919 ;; (define-key global-map [f19] 'function-key-error)
920 ;; (define-key global-map [f20] 'function-key-error)
921 ;; (define-key global-map [f21] 'function-key-error)
922 ;; (define-key global-map [f22] 'function-key-error)
923 ;; (define-key global-map [f23] 'function-key-error)
924 ;; (define-key global-map [f24] 'function-key-error)
925 ;; (define-key global-map [f25] 'function-key-error)
926 ;; (define-key global-map [f26] 'function-key-error)
927 ;; (define-key global-map [f27] 'function-key-error)
928 ;; (define-key global-map [f28] 'function-key-error)
929 ;; (define-key global-map [f29] 'function-key-error)
930 ;; (define-key global-map [f30] 'function-key-error)
931 ;; (define-key global-map [f31] 'function-key-error)
932 ;; (define-key global-map [f32] 'function-key-error)
933 ;; (define-key global-map [f33] 'function-key-error)
934 ;; (define-key global-map [f34] 'function-key-error)
935 ;; (define-key global-map [f35] 'function-key-error)
936 ;; (define-key global-map [kp-backtab] 'function-key-error)
937 ;; (define-key global-map [kp-space] 'function-key-error)
938 ;; (define-key global-map [kp-tab] 'function-key-error)
939 ;; (define-key global-map [kp-enter] 'function-key-error)
940 ;; (define-key global-map [kp-f1] 'function-key-error)
941 ;; (define-key global-map [kp-f2] 'function-key-error)
942 ;; (define-key global-map [kp-f3] 'function-key-error)
943 ;; (define-key global-map [kp-f4] 'function-key-error)
944 ;; (define-key global-map [kp-multiply] 'function-key-error)
945 ;; (define-key global-map [kp-add] 'function-key-error)
946 ;; (define-key global-map [kp-separator] 'function-key-error)
947 ;; (define-key global-map [kp-subtract] 'function-key-error)
948 ;; (define-key global-map [kp-decimal] 'function-key-error)
949 ;; (define-key global-map [kp-divide] 'function-key-error)
950 ;; (define-key global-map [kp-0] 'function-key-error)
951 ;; (define-key global-map [kp-1] 'function-key-error)
952 ;; (define-key global-map [kp-2] 'function-key-error)
953 ;; (define-key global-map [kp-3] 'function-key-error)
954 ;; (define-key global-map [kp-4] 'function-key-error)
955 ;; (define-key global-map [kp-5] 'recenter)
956 ;; (define-key global-map [kp-6] 'function-key-error)
957 ;; (define-key global-map [kp-7] 'function-key-error)
958 ;; (define-key global-map [kp-8] 'function-key-error)
959 ;; (define-key global-map [kp-9] 'function-key-error)
960 ;; (define-key global-map [kp-equal] 'function-key-error)
962 ;; X11R6 distinguishes these keys from the non-kp keys.
963 ;; Make them behave like the non-kp keys unless otherwise bound.
964 (define-key function-key-map [kp-home] [home])
965 (define-key function-key-map [kp-left] [left])
966 (define-key function-key-map [kp-up] [up])
967 (define-key function-key-map [kp-right] [right])
968 (define-key function-key-map [kp-down] [down])
969 (define-key function-key-map [kp-prior] [prior])
970 (define-key function-key-map [kp-next] [next])
971 (define-key function-key-map [M-kp-next] [M-next])
972 (define-key function-key-map [kp-end] [end])
973 (define-key function-key-map [kp-begin] [begin])
974 (define-key function-key-map [kp-insert] [insert])
975 (define-key function-key-map [backspace] [?\C-?])
976 (define-key function-key-map [delete] [?\C-?])
977 (define-key function-key-map [kp-delete] [?\C-?])
978 (define-key function-key-map [S-kp-end] [S-end])
979 (define-key function-key-map [S-kp-down] [S-down])
980 (define-key function-key-map [S-kp-next] [S-next])
981 (define-key function-key-map [S-kp-left] [S-left])
982 (define-key function-key-map [S-kp-right] [S-right])
983 (define-key function-key-map [S-kp-home] [S-home])
984 (define-key function-key-map [S-kp-up] [S-up])
985 (define-key function-key-map [S-kp-prior] [S-prior])
986 (define-key function-key-map [C-S-kp-end] [C-S-end])
987 (define-key function-key-map [C-S-kp-down] [C-S-down])
988 (define-key function-key-map [C-S-kp-next] [C-S-next])
989 (define-key function-key-map [C-S-kp-left] [C-S-left])
990 (define-key function-key-map [C-S-kp-right] [C-S-right])
991 (define-key function-key-map [C-S-kp-home] [C-S-home])
992 (define-key function-key-map [C-S-kp-up] [C-S-up])
993 (define-key function-key-map [C-S-kp-prior] [C-S-prior])
994 ;; Don't bind shifted keypad numeric keys, they reportedly
995 ;; interfere with the feature of some keyboards to produce
996 ;; numbers when NumLock is off.
997 ;(define-key function-key-map [S-kp-1] [S-end])
998 ;(define-key function-key-map [S-kp-2] [S-down])
999 ;(define-key function-key-map [S-kp-3] [S-next])
1000 ;(define-key function-key-map [S-kp-4] [S-left])
1001 ;(define-key function-key-map [S-kp-6] [S-right])
1002 ;(define-key function-key-map [S-kp-7] [S-home])
1003 ;(define-key function-key-map [S-kp-8] [S-up])
1004 ;(define-key function-key-map [S-kp-9] [S-prior])
1005 (define-key function-key-map [C-S-kp-1] [C-S-end])
1006 (define-key function-key-map [C-S-kp-2] [C-S-down])
1007 (define-key function-key-map [C-S-kp-3] [C-S-next])
1008 (define-key function-key-map [C-S-kp-4] [C-S-left])
1009 (define-key function-key-map [C-S-kp-6] [C-S-right])
1010 (define-key function-key-map [C-S-kp-7] [C-S-home])
1011 (define-key function-key-map [C-S-kp-8] [C-S-up])
1012 (define-key function-key-map [C-S-kp-9] [C-S-prior])
1014 (define-key global-map [mouse-movement] 'ignore)
1016 (define-key global-map "\C-t" 'transpose-chars)
1017 (define-key esc-map "t" 'transpose-words)
1018 (define-key esc-map "\C-t" 'transpose-sexps)
1019 (define-key ctl-x-map "\C-t" 'transpose-lines)
1021 (define-key esc-map ";" 'comment-dwim)
1022 (define-key esc-map "j" 'indent-new-comment-line)
1023 (define-key esc-map "\C-j" 'indent-new-comment-line)
1024 (define-key ctl-x-map ";" 'comment-set-column)
1025 (define-key ctl-x-map "f" 'set-fill-column)
1026 (define-key ctl-x-map "$" 'set-selective-display)
1028 (define-key esc-map "@" 'mark-word)
1029 (define-key esc-map "f" 'forward-word)
1030 (define-key esc-map "b" 'backward-word)
1031 (define-key esc-map "d" 'kill-word)
1032 (define-key esc-map "\177" 'backward-kill-word)
1034 (define-key esc-map "<" 'beginning-of-buffer)
1035 (define-key esc-map ">" 'end-of-buffer)
1036 (define-key ctl-x-map "h" 'mark-whole-buffer)
1037 (define-key esc-map "\\" 'delete-horizontal-space)
1039 (defalias 'mode-specific-command-prefix (make-sparse-keymap))
1040 (defvar mode-specific-map (symbol-function 'mode-specific-command-prefix)
1041 "Keymap for characters following C-c.")
1042 (define-key global-map "\C-c" 'mode-specific-command-prefix)
1044 (global-set-key [M-right] 'forward-word)
1045 (define-key esc-map [right] 'forward-word)
1046 (global-set-key [M-left] 'backward-word)
1047 (define-key esc-map [left] 'backward-word)
1048 ;; ilya@math.ohio-state.edu says these bindings are standard on PC editors.
1049 (global-set-key [C-right] 'forward-word)
1050 (global-set-key [C-left] 'backward-word)
1051 ;; This is not quite compatible, but at least is analogous
1052 (global-set-key [C-delete] 'kill-word)
1053 (global-set-key [C-backspace] 'backward-kill-word)
1054 ;; This is "move to the clipboard", or as close as we come.
1055 (global-set-key [S-delete] 'kill-region)
1057 (global-set-key [C-M-left] 'backward-sexp)
1058 (define-key esc-map [C-left] 'backward-sexp)
1059 (global-set-key [C-M-right] 'forward-sexp)
1060 (define-key esc-map [C-right] 'forward-sexp)
1061 (global-set-key [C-M-up] 'backward-up-list)
1062 (define-key esc-map [C-up] 'backward-up-list)
1063 (global-set-key [C-M-down] 'down-list)
1064 (define-key esc-map [C-down] 'down-list)
1065 (global-set-key [C-M-home] 'beginning-of-defun)
1066 (define-key esc-map [C-home] 'beginning-of-defun)
1067 (global-set-key [C-M-end] 'end-of-defun)
1068 (define-key esc-map [C-end] 'end-of-defun)
1070 (define-key esc-map "\C-f" 'forward-sexp)
1071 (define-key esc-map "\C-b" 'backward-sexp)
1072 (define-key esc-map "\C-u" 'backward-up-list)
1073 (define-key esc-map "\C-@" 'mark-sexp)
1074 (define-key esc-map [?\C-\ ] 'mark-sexp)
1075 (define-key esc-map "\C-d" 'down-list)
1076 (define-key esc-map "\C-k" 'kill-sexp)
1077 ;;; These are dangerous in various situations,
1078 ;;; so let's not encourage anyone to use them.
1079 ;;;(define-key global-map [C-M-delete] 'backward-kill-sexp)
1080 ;;;(define-key global-map [C-M-backspace] 'backward-kill-sexp)
1081 (define-key esc-map [C-delete] 'backward-kill-sexp)
1082 (define-key esc-map [C-backspace] 'backward-kill-sexp)
1083 (define-key esc-map "\C-n" 'forward-list)
1084 (define-key esc-map "\C-p" 'backward-list)
1085 (define-key esc-map "\C-a" 'beginning-of-defun)
1086 (define-key esc-map "\C-e" 'end-of-defun)
1087 (define-key esc-map "\C-h" 'mark-defun)
1088 (define-key ctl-x-map "nd" 'narrow-to-defun)
1089 (define-key esc-map "(" 'insert-parentheses)
1090 (define-key esc-map ")" 'move-past-close-and-reindent)
1092 (define-key ctl-x-map "\C-e" 'eval-last-sexp)
1094 (define-key ctl-x-map "m" 'compose-mail)
1095 (define-key ctl-x-4-map "m" 'compose-mail-other-window)
1096 (define-key ctl-x-5-map "m" 'compose-mail-other-frame)
1099 (defvar ctl-x-r-map (make-sparse-keymap)
1100 "Keymap for subcommands of C-x r.")
1101 (define-key ctl-x-map "r" ctl-x-r-map)
1103 (define-key esc-map "q" 'fill-paragraph)
1104 (define-key ctl-x-map "." 'set-fill-prefix)
1106 (define-key esc-map "{" 'backward-paragraph)
1107 (define-key esc-map "}" 'forward-paragraph)
1108 (define-key esc-map "h" 'mark-paragraph)
1109 (define-key esc-map "a" 'backward-sentence)
1110 (define-key esc-map "e" 'forward-sentence)
1111 (define-key esc-map "k" 'kill-sentence)
1112 (define-key ctl-x-map "\177" 'backward-kill-sentence)
1114 (define-key ctl-x-map "[" 'backward-page)
1115 (define-key ctl-x-map "]" 'forward-page)
1116 (define-key ctl-x-map "\C-p" 'mark-page)
1117 (define-key ctl-x-map "l" 'count-lines-page)
1118 (define-key ctl-x-map "np" 'narrow-to-page)
1119 ;; (define-key ctl-x-map "p" 'narrow-to-page)
1121 (defvar abbrev-map (make-sparse-keymap)
1122 "Keymap for abbrev commands.")
1123 (define-key ctl-x-map "a" abbrev-map)
1125 (define-key abbrev-map "l" 'add-mode-abbrev)
1126 (define-key abbrev-map "\C-a" 'add-mode-abbrev)
1127 (define-key abbrev-map "g" 'add-global-abbrev)
1128 (define-key abbrev-map "+" 'add-mode-abbrev)
1129 (define-key abbrev-map "ig" 'inverse-add-global-abbrev)
1130 (define-key abbrev-map "il" 'inverse-add-mode-abbrev)
1131 ;; (define-key abbrev-map "\C-h" 'inverse-add-global-abbrev)
1132 (define-key abbrev-map "-" 'inverse-add-global-abbrev)
1133 (define-key abbrev-map "e" 'expand-abbrev)
1134 (define-key abbrev-map "'" 'expand-abbrev)
1135 ;; (define-key ctl-x-map "\C-a" 'add-mode-abbrev)
1136 ;; (define-key ctl-x-map "\+" 'add-global-abbrev)
1137 ;; (define-key ctl-x-map "\C-h" 'inverse-add-mode-abbrev)
1138 ;; (define-key ctl-x-map "\-" 'inverse-add-global-abbrev)
1139 (define-key esc-map "'" 'abbrev-prefix-mark)
1140 (define-key ctl-x-map "'" 'expand-abbrev)
1142 (define-key ctl-x-map "z" 'repeat)
1144 (define-key esc-map "\C-l" 'reposition-window)
1146 (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
1147 (define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
1149 ;; Signal handlers
1150 (define-key special-event-map [sigusr1] 'ignore)
1151 (define-key special-event-map [sigusr2] 'ignore)
1153 ;; Don't look for autoload cookies in this file.
1154 ;; Local Variables:
1155 ;; no-update-autoloads: t
1156 ;; End:
1158 ;; arch-tag: 23b5c7e6-e47b-49ed-8c6c-ed213c5fffe0
1159 ;;; bindings.el ends here