(mode-line-format): Include which-func-mode item.
[bpt/emacs.git] / lisp / bindings.el
index 66a8c51..46f051c 100644 (file)
 ;;; Code:
 
 (defconst mode-line-mule-info
-  (purecopy '(enable-multibyte-characters
-             ((current-input-method ("[" current-input-method-title "]"))
-              "%z:")))
-  "Mode-line control for displaying information of multilingual environment.")
+  (purecopy '(""
+             (current-input-method ("" current-input-method-title))
+             "%Z"))
+  "Mode-line control for displaying information of multilingual environment.
+Normally it displays current input method (if any activated) and
+mnemonics of the following coding systems:
+  coding system for saving or writing the current buffer
+  coding system for keyboard input (if Emacs is running on terminal)
+  coding system for terminal output (if Emacs is running on terminal)
+  coding system for decoding output of buffer process (if any)
+  coding system for encoding text to send to buffer process (if any).")
 
 (make-variable-buffer-local 'mode-line-mule-info)
 
-(defvar mode-line-buffer-identification (purecopy '("%F: %12b"))
+(defvar mode-line-buffer-identification (purecopy '("%12b"))
   "Mode-line control for identifying the buffer being displayed.
-Its default value is (\"%F: %12b\").  Under X, `%F' is replaced with `Emacs'.
+Its default value is (\"%12b\").
 Major modes that edit things other than ordinary files may change this
 \(e.g. Info, Dired,...)")
 
 (make-variable-buffer-local 'mode-line-buffer-identification)
 
+(defvar mode-line-frame-identification '("-%F  "))
+
 (defvar mode-line-process nil
   "Mode-line control for displaying info on process status.
 Normally nil in most modes, since there is no process to display.")
 
 (make-variable-buffer-local 'mode-line-process)
 
-(defvar mode-line-modified (purecopy '("--%1*%1+-"))
+(defvar mode-line-modified (purecopy '("%1*%1+"))
   "Mode-line control for displaying whether current buffer is modified.")
 
 (make-variable-buffer-local 'mode-line-modified)
 
 (setq-default mode-line-format
-  (list (purecopy "")
+  (list (purecopy "-")
    'mode-line-mule-info
    'mode-line-modified
+   'mode-line-frame-identification
    'mode-line-buffer-identification
    (purecopy "   ")
    'global-mode-string
@@ -85,6 +95,7 @@ Normally nil in most modes, since there is no process to display.")
    'mode-name 'mode-line-process 'minor-mode-alist
    (purecopy "%n")
    (purecopy ")%]--")
+   '(which-func-mode ("" which-func-format "--"))
    (purecopy '(line-number-mode "L%l--"))
    (purecopy '(column-number-mode "C%c--"))
    (purecopy '(-3 . "%p"))
@@ -154,9 +165,9 @@ is okay.  See `mode-line-format'.")
        "^Current buffer has no process$"
 
        ;; dabbrev
-       "^No dynamic expansion for \".*\" found\\.$"
-       "^No further dynamic expansions for \".*\" found\\.$"
-       "^No further dynamic expansions for `.*' found$"
+       "^No dynamic expansion for .* found$"
+       "^No further dynamic expansion for .* found$"
+       "^No possible abbreviation preceding point$"
 
        ;; Completion
        "^To complete, the point must be after a symbol at least [0-9]* character long\\.$"
@@ -174,7 +185,8 @@ is okay.  See `mode-line-format'.")
 
        ;; imenu
        "^No items suitable for an index found in this buffer\\.$"
-       "^The mode \".*\" does not take full advantage of imenu\\.el yet\\.$"
+       "^This buffer cannot use `imenu-default-create-index-function'$"
+       "^The mode `.*' does not support Imenu$"
 
        ;; ispell
        "^No word found to check!$"
@@ -187,17 +199,66 @@ is okay.  See `mode-line-format'.")
        "^No manpage [0-9]* found$"
 
        ;; etags
-       "^No tags table in use!  Use .* to select one\\.$"
+       "^No tags table in use; use .* to select one$"
        "^There is no default tag$"
        "^No previous tag locations$"
        "^File .* is not a valid tags table$"
        "^No \\(more \\|\\)tags \\(matching\\|containing\\) "
        "^Rerun etags: `.*' not found in "
-       "^All files processed\\.$"
-       "^No .* or .* in progress.$"
+       "^All files processed$"
+       "^No .* or .* in progress$"
        "^File .* not in current tags tables$"
-       "No tags table loaded."
+       "^No tags table loaded"
        "^Nothing to complete$"
+       
+       ;; ediff
+       "^Errors in diff output. Diff output is in "
+       "^Hmm... I don't see an Ediff command around here...$"
+       "^Undocumented command! Type `G' in Ediff Control Panel to drop a note to the Ediff maintainer$"
+       ": This command runs in Ediff Control Buffer only!$"
+       ": Invalid op in ediff-check-version$"
+       "^ediff-shrink-window-C can be used only for merging jobs$"
+       "^Lost difference info on these directories$"
+       "^This command is inapplicable in the present context$"
+       "^This session group has no parent$"
+       "^Can't hide active session, $"
+       "^Sorry, I don't do this for everyone...$"
+       "^Ediff: something wrong--no multiple diffs buffer$"
+       "^Can't make context diff for Session $"
+       "^The patch buffer wasn't found$"
+       "^Aborted$"
+       "^This Ediff session is not part of a session group$"
+       "^No active Ediff sessions or corrupted session registry$"
+       "^No session info in this line$"
+       "^`.*' is not an ordinary file$"
+       "^Patch appears to have failed$"
+       "^Recomputation of differences cancelled$"
+       "^No fine differences in this mode$"
+       "^Lost connection to ancestor buffer...sorry$"
+       "^Not merging with ancestor$"
+       "^Don't know how to toggle read-only in buffer "
+       "Emacs is not running as a window application$"
+       "^This command makes sense only when merging with an ancestor$"
+       "^At end of the difference list$"
+       "^At beginning of the difference list$"
+       "^Nothing saved for diff .* in buffer "
+       "^Buffer is out of sync for file "
+       "^Buffer out of sync for file "
+       "^Output from `diff' not found$"
+       "^You forgot to specify a region in buffer "
+       "^All right. Make up your mind and come back...$"
+       "^Current buffer is not visiting any file$"
+       "^Failed to retrieve revision: $"
+       "^Can't determine display width.$"
+       "^File `.*' does not exist or is not readable$"
+       "^File `.*' is a directory$"
+       "^Buffer .* doesn't exist$"
+       "^Directories . and . are the same: "
+       "^Directory merge aborted$"
+       "^Merge of directory revisions aborted$"
+       "^Buffer .* doesn't exist$"
+       "^There is no file to merge$"
+       "^Version control package .*.el not found. Use vc.el instead$"
 
        ;; BBDB
        "^no previous record$"
@@ -206,23 +267,31 @@ is okay.  See `mode-line-format'.")
 
 (make-variable-buffer-local 'indent-tabs-mode)
 
-;; This is here to avoid autoloading etags on M-TAB.
-;; M-x visit-tags-table will autoload etags, which will redefine complete-tag.
-(defun complete-tag ()
+(define-key esc-map "\t" 'complete-symbol)
+
+(defun complete-symbol (arg)
   "Perform tags completion on the text around point.
 Completes to the set of names listed in the current tags table.
 The string to complete is chosen in the same way as the default
 for \\[find-tag] (which see)."
-  (interactive)
-  (error (substitute-command-keys
-         "No tags table loaded.  Try \\[visit-tags-table].")))
+  (interactive "P")
+  (if arg
+      (if (fboundp 'complete-tag)
+         (complete-tag)
+       ;; Don't autoload etags if we have no tags table.
+       (error (substitute-command-keys
+               "No tags table loaded; use \\[visit-tags-table] to load one")))
+    (info-complete-symbol)))
 
 ;; Reduce total amount of space we must allocate during this function
 ;; that we will not need to keep permanently.
 (garbage-collect)
 \f
-(define-key ctl-x-map "n" (make-sparse-keymap))
-(define-key ctl-x-map "r" (make-sparse-keymap))
+;; Make Latin-1, Latin-2, Latin-3 and Latin-4 characters self-insert.
+(aset (nth 1 global-map) (make-char 'latin-iso8859-1) 'self-insert-command)
+(aset (nth 1 global-map) (make-char 'latin-iso8859-2) 'self-insert-command)
+(aset (nth 1 global-map) (make-char 'latin-iso8859-3) 'self-insert-command)
+(aset (nth 1 global-map) (make-char 'latin-iso8859-4) 'self-insert-command)
 
 (setq help-event-list '(help f1))
 
@@ -483,9 +552,12 @@ for \\[find-tag] (which see)."
 (define-key ctl-x-map "nd" 'narrow-to-defun)
 (define-key esc-map "(" 'insert-parentheses)
 (define-key esc-map ")" 'move-past-close-and-reindent)
-(define-key esc-map "\t" 'lisp-complete-symbol)
 
 (define-key ctl-x-map "\C-e" 'eval-last-sexp)
+
+(define-key ctl-x-map "m" 'compose-mail)
+(define-key ctl-x-4-map "m" 'compose-mail-other-window)
+(define-key ctl-x-5-map "m" 'compose-mail-other-frame)
 \f
 (define-key ctl-x-map "r\C-@" 'point-to-register)
 (define-key ctl-x-map [?r ?\C-\ ] 'point-to-register)