(file-remote-p): Docstring fix.
[bpt/emacs.git] / lisp / bindings.el
index c26cbb7..df86965 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, 2007 Free Software Foundation, Inc.
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
@@ -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 "\
@@ -250,7 +256,7 @@ Normally nil in most modes, since there is no process to display.")
 
 (defvar mode-line-remote
   (list (propertize
-        "%1R"
+        "%1@"
         'help-echo (purecopy (lambda (window object point)
                                (format "%s"
                                        (save-selected-window
@@ -283,6 +289,7 @@ Keymap to display on major mode.")
 
 (defvar mode-line-minor-mode-keymap
   (let ((map (make-sparse-keymap)))
+    (define-key map [mode-line down-mouse-1] 'mouse-minor-mode-menu)
     (define-key map [mode-line mouse-2] 'mode-line-minor-mode-help)
     (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1)
     (define-key map [header-line down-mouse-3] 'mode-line-mode-menu-1)
@@ -302,6 +309,7 @@ Keymap to display on minor modes.")
         "%e"
         (propertize "-" 'help-echo help-echo)
         'mode-line-mule-info
+        'mode-line-client
         'mode-line-modified
         'mode-line-remote
         'mode-line-frame-identification
@@ -324,13 +332,14 @@ Keymap to display on minor modes.")
         '("" mode-line-process)
         `(:propertize ("" minor-mode-alist)
                       mouse-face mode-line-highlight
-                      help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes"
+                      help-echo "mouse-1: minor mode, mouse-2: minor mode help, mouse-3: toggle minor modes"
                       local-map ,mode-line-minor-mode-keymap)
         (propertize "%n" 'help-echo "mouse-2: widen"
                     'mouse-face 'mode-line-highlight
                     '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
@@ -485,7 +494,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 occurred on minor modes area of the mode line."
+  "Describe minor mode for EVENT on minor modes area of the mode line."
   (interactive "@e")
   (let ((indicator (car (nth 4 (car (cdr event))))))
     (describe-minor-mode-from-indicator indicator)))
@@ -493,7 +502,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'.")
@@ -528,7 +537,7 @@ is okay.  See `mode-line-format'.")
        '(".elc" ".lof"
         ".glo" ".idx" ".lot"
         ;; TeX-related
-        ".dvi" ".fmt" ".tfm" ".pdf"
+        ".fmt" ".tfm"
         ;; Java compiled
         ".class"
         ;; CLISP
@@ -607,7 +616,7 @@ language you are using."
     (if (fboundp 'complete-tag)
        (complete-tag)
       ;; Don't autoload etags if we have no tags table.
-      (error (substitute-command-keys
+      (error "%s" (substitute-command-keys
              "No tags table loaded; use \\[visit-tags-table] to load one")))))
 
 ;; Reduce total amount of space we must allocate during this function
@@ -649,6 +658,10 @@ language you are using."
 (define-key global-map "\e\e\e" 'keyboard-escape-quit)
 (define-key global-map "\C-g" 'keyboard-quit)
 
+;; Used to be in termdev.el: when using several terminals, make C-z
+;; suspend only the relevant terminal.
+(substitute-key-definition 'suspend-emacs 'suspend-frame global-map)
+
 (define-key global-map "\C-j" 'newline-and-indent)
 (define-key global-map "\C-m" 'newline)
 (define-key global-map "\C-o" 'open-line)
@@ -697,7 +710,8 @@ language you are using."
   ;; Override the global binding (which calls indent-relative via
   ;; indent-for-tab-command).  The alignment that indent-relative tries to
   ;; do doesn't make much sense here since the prompt messes it up.
-  (define-key map "\t"    'self-insert-command))
+  (define-key map "\t"    'self-insert-command)
+  (define-key minibuffer-local-map [C-tab] 'file-cache-minibuffer-complete))
 
 (define-key global-map "\C-u" 'universal-argument)
 (let ((i ?0))
@@ -1030,7 +1044,6 @@ language you are using."
 (define-key ctl-x-map "rf" 'frame-configuration-to-register)
 
 (define-key esc-map "q" 'fill-paragraph)
-;; (define-key esc-map "g" 'fill-region)
 (define-key ctl-x-map "." 'set-fill-prefix)
 \f
 (define-key esc-map "{" 'backward-paragraph)
@@ -1067,6 +1080,9 @@ language you are using."
 
 (define-key ctl-x-map "z" 'repeat)
 
+(define-key esc-map "\C-l" 'reposition-window)
+
+(define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
 (define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
 
 ;; Signal handlers