]> code.delx.au - gnu-emacs/blobdiff - lisp/bindings.el
Merge from emacs--devo--0
[gnu-emacs] / lisp / bindings.el
index a223596c351784a441e6a2163f9f6ee508c77dde..38184ae88a4bc9c6ca2c19edc02e621c325256b2 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,
@@ -170,6 +170,12 @@ corresponding to the mode line clicked."
       (push (cons eol (cons mnemonic desc)) mode-line-eol-desc-cache)
       desc)))
 
+(defvar mode-line-client
+  `(""
+    (:propertize ("" (:eval (if (frame-parameter nil 'client) "@" "")))
+                help-echo "Emacsclient frame"))
+  "Mode-line control for identifying Emacsclient frames.")
+
 (defvar mode-line-mule-info
   `(""
     (current-input-method
@@ -209,7 +215,7 @@ mnemonics of the following coding systems:
 
 (make-variable-buffer-local 'mode-line-mule-info)
 
-(defvar mode-line-frame-identification '("-%F  ")
+(defvar mode-line-frame-identification '(window-system "  " "-%F  ")
   "Mode-line control to describe the current frame.")
 
 (defvar mode-line-process nil "\
@@ -248,6 +254,22 @@ Normally nil in most modes, since there is no process to display.")
 
 (make-variable-buffer-local 'mode-line-modified)
 
+(defvar mode-line-remote
+  (list (propertize
+        "%1@"
+        'help-echo (purecopy (lambda (window object point)
+                               (format "%s"
+                                       (save-selected-window
+                                         (select-window window)
+                                         (concat 
+                                         (if (file-remote-p default-directory)
+                                             "Remote: "
+                                           "Local: ")
+                                         default-directory)))))))
+  "Mode-line flag to show if default-directory for current buffer is remote.")
+
+(make-variable-buffer-local 'mode-line-remote)
+
 ;; Actual initialization is below.
 (defvar mode-line-position nil
   "Mode-line control for displaying the position in the buffer.
@@ -279,14 +301,16 @@ 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
         "%e"
         (propertize "-" 'help-echo help-echo)
         'mode-line-mule-info
+        'mode-line-client
         'mode-line-modified
+        'mode-line-remote
         'mode-line-frame-identification
         'mode-line-buffer-identification
         (propertize "   " 'help-echo help-echo)
@@ -314,6 +338,7 @@ Keymap to display on minor modes.")
                     'local-map (make-mode-line-mouse-map
                                 'mouse-2 #'mode-line-widen))
         (propertize ")%]--" 'help-echo help-echo)))
+
        (standard-mode-line-position
        `((-3 ,(propertize "%p" 'help-echo help-echo))
          (size-indication-mode
@@ -426,15 +451,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))))
@@ -450,9 +474,6 @@ 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)
@@ -472,7 +493,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)))
@@ -1016,18 +1037,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)
@@ -1068,6 +1077,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