]> code.delx.au - gnu-emacs/blobdiff - lisp/bindings.el
(backquote-unquote-symbol, backquote-splice-symbol):
[gnu-emacs] / lisp / bindings.el
index 65ff8b0f9163ef96f2a68e225c2f28f252e80e72..3c7237a52fa0e0658674c74d6022956b9b233530 100644 (file)
@@ -1,7 +1,7 @@
 ;;; bindings.el --- define standard key bindings and some variables
 
 ;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994, 1995, 1996, 1999,
-;;   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -279,7 +279,7 @@ Keymap to display on minor modes.")
        ;;        "\
        ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete,
        ;; drag-mouse-1: resize, C-mouse-2: split horizontally"
-       "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this")
+       "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0")
        (dashes (propertize "--" 'help-echo help-echo))
        (standard-mode-line-format
        (list
@@ -337,24 +337,21 @@ Keymap to display on minor modes.")
   (put 'mode-line-position 'standard-value
        (list `(quote ,standard-mode-line-position))))
 
-(defvar mode-line-buffer-identification-keymap nil "\
+(defvar mode-line-buffer-identification-keymap
+  ;; Add menu of buffer operations to the buffer identification part
+  ;; of the mode line.or header line.
+  (let ((map (make-sparse-keymap)))
+    ;; Bind down- events so that the global keymap won't ``shine
+    ;; through''.
+    (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
+    (define-key map [header-line down-mouse-1] 'ignore)
+    (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
+    (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
+    (define-key map [header-line down-mouse-3] 'ignore)
+    (define-key map [header-line mouse-3] 'mode-line-next-buffer)
+    map) "\
 Keymap for what is displayed by `mode-line-buffer-identification'.")
 
-;; Add menu of buffer operations to the buffer identification part
-;; of the mode line.or header line.
-;
-(let ((map (make-sparse-keymap)))
-  ;; Bind down- events so that the global keymap won't ``shine
-  ;; through''.
-  (define-key map [mode-line mouse-1] 'mode-line-previous-buffer)
-  (define-key map [header-line down-mouse-1] 'ignore)
-  (define-key map [header-line mouse-1] 'mode-line-previous-buffer)
-  (define-key map [header-line down-mouse-3] 'ignore)
-  (define-key map [mode-line mouse-3] 'mode-line-next-buffer)
-  (define-key map [header-line down-mouse-3] 'ignore)
-  (define-key map [header-line mouse-3] 'mode-line-next-buffer)
-  (setq mode-line-buffer-identification-keymap map))
-
 (defun propertized-buffer-identification (fmt)
   "Return a list suitable for `mode-line-buffer-identification'.
 FMT is a format specifier such as \"%12b\".  This function adds
@@ -429,15 +426,14 @@ Menu of mode operations in the mode line.")
   "Return the value of symbol VAR if it is bound, else nil."
   `(and (boundp (quote ,var)) ,var))
 
+;; Use mode-line-mode-menu for local minor-modes only.
+;; Global ones can go on the menubar (Options --> Show/Hide).
 (define-key mode-line-mode-menu [overwrite-mode]
   `(menu-item ,(purecopy "Overwrite (Ovwrt)") overwrite-mode
              :button (:toggle . overwrite-mode)))
 (define-key mode-line-mode-menu [outline-minor-mode]
   `(menu-item ,(purecopy "Outline (Outl)") outline-minor-mode
              :button (:toggle . (bound-and-true-p outline-minor-mode))))
-(define-key mode-line-mode-menu [line-number-mode]
-  `(menu-item ,(purecopy "Line number") line-number-mode
-             :button (:toggle . line-number-mode)))
 (define-key mode-line-mode-menu [highlight-changes-mode]
   `(menu-item ,(purecopy "Highlight changes (Chg)") highlight-changes-mode
              :button (:toggle . (bound-and-true-p highlight-changes-mode))))
@@ -453,11 +449,9 @@ Menu of mode operations in the mode line.")
 (define-key mode-line-mode-menu [flyspell-mode]
   `(menu-item ,(purecopy "Flyspell (Fly)") flyspell-mode
              :button (:toggle . (bound-and-true-p flyspell-mode))))
-(define-key mode-line-mode-menu [column-number-mode]
-  `(menu-item ,(purecopy "Column number") column-number-mode
-             :button (:toggle . column-number-mode)))
 (define-key mode-line-mode-menu [auto-revert-tail-mode]
   `(menu-item ,(purecopy "Auto revert tail (Tail)") auto-revert-tail-mode
+             :enable (buffer-file-name)
              :button (:toggle . (bound-and-true-p auto-revert-tail-mode))))
 (define-key mode-line-mode-menu [auto-revert-mode]
   `(menu-item ,(purecopy "Auto revert (ARev)") auto-revert-mode
@@ -474,7 +468,7 @@ Menu of mode operations in the mode line.")
   (x-popup-menu event mode-line-mode-menu))
 
 (defun mode-line-minor-mode-help (event)
-  "Describe minor mode for EVENT occured on minor modes area of the mode line."
+  "Describe minor mode for EVENT occurred on minor modes area of the mode line."
   (interactive "@e")
   (let ((indicator (car (nth 4 (car (cdr event))))))
     (describe-minor-mode-from-indicator indicator)))
@@ -482,7 +476,7 @@ Menu of mode operations in the mode line.")
 (defvar minor-mode-alist nil "\
 Alist saying how to show minor modes in the mode line.
 Each element looks like (VARIABLE STRING);
-STRING is included in the mode line iff VARIABLE's value is non-nil.
+STRING is included in the mode line if VARIABLE's value is non-nil.
 
 Actually, STRING need not be a string; any possible mode-line element
 is okay.  See `mode-line-format'.")
@@ -607,7 +601,7 @@ language you are using."
 (let ((l (generic-character-list))
       (table (nth 1 global-map)))
   (while l
-    (set-char-table-default table (car l) 'self-insert-command)
+    (aset table (car l) 'self-insert-command)
     (setq l (cdr l))))
 
 (setq help-event-list '(help f1))
@@ -1018,18 +1012,6 @@ language you are using."
 (define-key ctl-x-map "rw" 'window-configuration-to-register)
 (define-key ctl-x-map "rf" 'frame-configuration-to-register)
 
-;; These key bindings are deprecated; use the above C-x r map instead.
-;; We use these aliases so \[...] will show the C-x r bindings instead.
-(defalias 'point-to-register-compatibility-binding 'point-to-register)
-(defalias 'jump-to-register-compatibility-binding 'jump-to-register)
-(defalias 'copy-to-register-compatibility-binding 'copy-to-register)
-(defalias 'insert-register-compatibility-binding 'insert-register)
-(define-key ctl-x-map "/" 'point-to-register-compatibility-binding)
-(define-key ctl-x-map "j" 'jump-to-register-compatibility-binding)
-(define-key ctl-x-map "x" 'copy-to-register-compatibility-binding)
-(define-key ctl-x-map "g" 'insert-register-compatibility-binding)
-;; (define-key ctl-x-map "r" 'copy-rectangle-to-register)
-
 (define-key esc-map "q" 'fill-paragraph)
 ;; (define-key esc-map "g" 'fill-region)
 (define-key ctl-x-map "." 'set-fill-prefix)
@@ -1070,6 +1052,10 @@ language you are using."
 
 (define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
 
+;; Signal handlers
+(define-key special-event-map [sigusr1] 'ignore)
+(define-key special-event-map [sigusr2] 'ignore)
+
 ;; Don't look for autoload cookies in this file.
 ;; Local Variables:
 ;; no-update-autoloads: t