changeset 37202:9e69de8a5048

("japanese-hankaku-kana"): Don't use the same translations as for `japanese'.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 05 Apr 2001 10:09:36 +0000
parents a50c338bd5e7
children edd7ede4c4bc
files leim/quail/japanese.el
diffstat 1 files changed, 23 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/leim/quail/japanese.el	Thu Apr 05 09:46:15 2001 +0000
+++ b/leim/quail/japanese.el	Thu Apr 05 10:09:36 2001 +0000
@@ -485,9 +485,24 @@
  nil t t nil nil nil nil nil
  'quail-japanese-hankaku-update-translation)
 
-;; Use the same map as that of `japanese'.
-(setcar (cdr (cdr quail-current-package))
-	(nth 2 (assoc "japanese" quail-package-alist)))
+(dolist (elt quail-japanese-transliteration-rules)
+  (quail-defrule (car elt)
+		 (let ((trans (nth 1 elt)))
+		   (when (or (stringp trans) (vectorp trans))
+		     (let ((s (japanese-hankaku (if (stringp trans)
+						    trans
+						  (aref trans 0)))))
+		       ;; If the result of the conversion is a string
+		       ;; containing more than one character, make the
+		       ;; result a vector, so that quail-defrule
+		       ;; recognizes the whole string is the
+		       ;; translation, instead of interpreting
+		       ;; individual characters as alternative
+		       ;; translations.
+		       (if (and (stringp s) (> (length s) 1))
+			   (setq trans (vector s))
+			 (setq trans s))))
+		   trans)))
 
 (quail-define-package
  "japanese-hiragana" "Japanese" "$B$"(B"
@@ -520,9 +535,9 @@
 (dolist (elt quail-japanese-transliteration-rules)
   (quail-defrule (car elt)
 		 (let ((trans (nth 1 elt)))
-		   (cond((stringp trans)
-			 (japanese-katakana trans))
-			((vectorp trans)
-			 (vector (japanese-katakana (aref trans 0))))
-			(t trans)))))
+		   (cond ((stringp trans)
+			  (japanese-katakana trans))
+			 ((vectorp trans)
+			  (vector (japanese-katakana (aref trans 0))))
+			 (t trans)))))