]> git.eshelyaron.com Git - emacs.git/commitdiff
(mode-line-coding-system-map): New variable.
authorGerd Moellmann <gerd@gnu.org>
Thu, 30 Aug 2001 14:19:34 +0000 (14:19 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 30 Aug 2001 14:19:34 +0000 (14:19 +0000)
(mode-line-mule-info): Give the "%Z" a local-map keymap.

lisp/ChangeLog
lisp/bindings.el

index 863f7269a470a985cd77930cc325fd3db2fa2d07..87b73dcaf74048f1e641a38439fcea43219eb7d5 100644 (file)
@@ -1,5 +1,8 @@
 2001-08-30  Gerd Moellmann  <gerd@gnu.org>
 
+       * bindings.el (mode-line-coding-system-map): New variable.
+       (mode-line-mule-info): Give the "%Z" a local-map keymap.
+
        * simple.el (eval-expression-print-level): Change the type
        of the defcustom to allow nil.
 
index aff7fcea74d2a55847f18ce9b8df46c3d096539d..30e936598149e39802e91fc8ffccbe0a91143e9e 100644 (file)
@@ -120,6 +120,21 @@ corresponding to the mode line clicked."
          (describe-current-input-method))))
     (purecopy map)))
 
+
+(defvar mode-line-coding-system-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [mode-line mouse-3]
+      (lambda (e)
+       (interactive "e")
+       (save-selected-window
+         (select-window (posn-window (event-start e)))
+         (when (and enable-multibyte-characters
+                    buffer-file-coding-system)
+           (describe-coding-system buffer-file-coding-system)))))
+    (purecopy map))
+  "Local keymap for the coding-system part of the mode line.")
+
+
 (defvar mode-line-mule-info
   `(""
     (current-input-method
@@ -129,7 +144,7 @@ corresponding to the mode line clicked."
                     'help-echo (concat
                                 "Input method: "
                                 current-input-method
-                                ".  mouse-2 disables, mouse-3 describes")
+                                ".  mouse-2: disable, mouse-3: describe")
                     'local-map mode-line-input-method-map))))
     ,(propertize
       "%Z"
@@ -142,10 +157,11 @@ corresponding to the mode line clicked."
                    (when buffer-file-coding-system
                      (if enable-multibyte-characters
                          (concat (symbol-name buffer-file-coding-system)
-                                 " buffer; see M-x describe-coding-system")
+                                 " buffer; mouse-3: describe coding system")
                        (concat "Unibyte "
                                (symbol-name buffer-file-coding-system)
-                               " buffer"))))))))
+                               " buffer"))))))
+      'local-map mode-line-coding-system-map))
   "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: