diff lisp/international/kkc.el @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 0d8b17d428b5
children
line wrap: on
line diff
--- a/lisp/international/kkc.el	Sun Jan 15 23:02:10 2006 +0000
+++ b/lisp/international/kkc.el	Mon Jan 16 00:03:54 2006 +0000
@@ -1,7 +1,9 @@
 ;;; kkc.el --- Kana Kanji converter    -*- coding: iso-2022-7bit; -*-
 
-;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
-;; Licensed to the Free Software Foundation.
+;; Copyright (C) 1997, 1998  Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997, 1998, 2000, 2001, 2003
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: mule, multilingual, Japanese
 
@@ -19,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -549,13 +551,7 @@
 	  ;; The currently selected conversion is after the list shown
 	  ;; previously.  We start calculation of message width from
 	  ;; the conversion next of TO.
-	  (setq this-idx next-idx msg nil)
-	;; The current conversion is in MSG.  Just clear brackets
-	;; around index number.
-	(if (string-match "<.>" msg)
-	    (progn
-	      (aset msg (match-beginning 0) ?\ )
-	      (aset msg (1- (match-end 0)) ?\ )))))
+	  (setq this-idx next-idx msg nil)))
     (if (not msg)
 	(let ((len (length kkc-current-conversions))
 	      (max-width (window-width (minibuffer-window)))
@@ -587,7 +583,8 @@
 	  (setq l (nthcdr this-idx kkc-current-conversions))
 	  (setq msg (format " %c %s"
 			    (aref kkc-show-conversion-list-index-chars 0)
-			    (car l))
+			    (propertize (car l)
+					'kkc-conversion-index this-idx))
 		idx (1+ this-idx)
 		l (cdr l))
 	  (while (< idx next-idx)
@@ -595,20 +592,26 @@
 			      msg
 			      (aref kkc-show-conversion-list-index-chars
 				    (- idx this-idx))
-			      (car l)))
-	    (setq idx (1+ idx)
+			      (propertize (car l)
+					  'kkc-conversion-index idx))
+		  idx (1+ idx)
 		  l (cdr l)))
 	  (aset first-slot 2 msg)))
+
+    ;; Highlight the current conversion.
     (if (> current-idx 0)
-	(progn
-	  ;; Highlight the current conversion by brackets.
-	  (string-match (format " \\(%c\\) "
-				(aref kkc-show-conversion-list-index-chars
-				      (- current-idx this-idx)))
-			msg)
-	  (aset msg (match-beginning 0) ?<)
-	  (aset msg (1- (match-end 0)) ?>)))
-    (message "%s" msg)))
+	(let ((pos 3)
+	      (limit (length msg)))
+	  (remove-text-properties 0 (length msg) '(face nil) msg)
+	  (while (not (eq (get-text-property pos 'kkc-conversion-index msg)
+			  current-idx))
+	    (setq pos (next-single-property-change pos 'kkc-conversion-index
+						   msg limit)))
+	  (put-text-property pos (next-single-property-change
+				  pos 'kkc-conversion-index msg limit)
+			     'face 'highlight msg)))
+    (let ((message-log-max nil))
+      (message "%s" msg))))
 
 ;; Update the conversion area with the latest conversion selected.
 ;; ALL if non nil means to update the whole area, else update only
@@ -655,4 +658,5 @@
 ;;
 (provide 'kkc)
 
+;;; arch-tag: 3cbfd56e-74e6-4f60-bb46-ba7c2d366fbf
 ;;; kkc.el ends here