changeset 27616:18b19e347f65

(mode-line-mule-info): Fix/extend last change.
author Dave Love <fx@gnu.org>
date Fri, 04 Feb 2000 20:31:33 +0000
parents 998447c70e9a
children 07bd81629ad2
files lisp/bindings.el
diffstat 1 files changed, 31 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/bindings.el	Fri Feb 04 18:18:41 2000 +0000
+++ b/lisp/bindings.el	Fri Feb 04 20:31:33 2000 +0000
@@ -1,6 +1,7 @@
 ;;; bindings.el --- define standard key bindings and some variables.
 
-;; Copyright (C) 1985,86,87,92,93,94,95,96,99 Free Software Foundation, Inc.
+;; Copyright (C) 1985,86,87,92,93,94,95,96,99,2000
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
@@ -61,13 +62,37 @@
 	   (force-mode-line-update))))
     map))
 
-;; This might have a local-map to bring up a MULE menu or describe the
-;; current method.  At least give the user a clue what the field is.
 (defvar mode-line-mule-info
   `(""
-    (current-input-method ("" (propertize current-input-method-title
-					  'help-echo "Input method")))
-    ,(propertize "%Z" 'help-echo (purecopy "Coding system information")))
+    (current-input-method
+     ("" (:eval
+	  (if current-input-method
+	      (propertize
+	       current-input-method-title
+	       'help-echo (concat ,(purecopy "Input method: ")
+				  current-input-method
+				  ".  mouse-2 toggles, mouse-3 describes")
+	       'local-map ,(purecopy
+			    (let ((map (make-sparse-keymap)))
+			      (define-key map [mode-line mouse-2]
+				(lambda (e)
+				  (interactive "e")
+				  (save-selected-window
+				    (select-window
+				     (posn-window (event-start e)))
+				    (toggle-input-method)
+				    (force-mode-line-update))))
+			      (define-key map [mode-line mouse-3]
+				(lambda (e)
+				  (interactive "e")
+				  (save-selected-window
+				    (select-window
+				     (posn-window (event-start e)))
+				    (describe-input-method))))
+			      map)))))))
+    ,(propertize
+      "%Z" 'help-echo
+      (purecopy "Coding system information: see M-x describe-coding-system")))
   "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: