Subject: Re: bug#9336: 24.0.50; No way to input character #xbb4 using ta-itrans

From: Jambunathan K <[email-masked]>
Date: Fri, 23 Sep 2011 16:51:59 +0530

Kenichi

>> Above character has two bindings - "za" or "Ja".
>> We can go with "za".  
>
> Ah, I forgot about my patch.

Yes, there is a pending patch.

> Anyway, please try the attached patch for
> leim/quail/indian.el.  How is the result of C-h C-\
> tamil-itrans RET?  Is it ok now?

The new 2-D table looks pretty good and I am VERY HAPPY with the
changes.

I have made some changes - presentation-wise - on top of your changes. I
have attached 3 screenshots that demonstrates the changes that I have
made [1]. FYI, my FSF copyright assignment number for Emacs is #618390.

I also propose that some additional changes be made to quail.el [2]. I
am unsure how to introduce these changes cleanly.

--- a/indian.el	2011-09-19 09:06:02.000000000 +0530
+++ c/indian.el	2011-09-23 15:45:35.562500000 +0530
@@ -118,12 +118,188 @@
  indian-mlm-itrans-v5-hash "malayalam-itrans" "Malayalam" "MlmIT"
  "Malayalam transliteration by ITRANS method.")
 
+(defvar quail-tamil-itrans-syllable-table
+  (let ((vowels
+	 '(("அ" nil "a")
+	   ("ஆ" "ா" "A")
+	   ("இ" "ி" "i")
+	   ("ஈ" "ீ" "I")
+	   ("உ" "ு" "u")
+	   ("ஊ" "ூ" "U")
+	   ("எ" "ெ" "e")
+	   ("ஏ" "ே" "E")
+	   ("ஐ" "ை" "ai")
+	   ("ஒ" "ொ" "o")
+	   ("ஓ" "ோ" "O")
+	   ("ஔ" "ௌ" "au")))
+	(consonants
+	 '(("க" "k")			; U+0B95
+	   ("ங" "N^")			; U+0B99
+	   ("ச" "ch")			; U+0B9A
+	   ("ஞ" "JN")			; U+0B9E
+	   ("ட" "T")			; U+0B9F
+	   ("ண" "N")			; U+0BA3
+	   ("த" "t")			; U+0BA4
+	   ("ந" "n")			; U+0BA8
+	   ("ப" "p")			; U+0BAA
+	   ("ம" "m")			; U+0BAE
+	   ("ய" "y")			; U+0BAF
+	   ("ர" "r")			; U+0BB0
+	   ("ல" "l")			; U+0BB2
+	   ("வ" "v")			; U+0BB5
+	   ("ழ" "z")			; U+0BB4
+	   ("ள" "L")			; U+0BB3
+	   ("ற" "rh")			; U+0BB1
+	   ("ன" "nh")			; U+0BA9
+	   ("ஜ" "j")			; U+0B9C
+	   ("ஶ" nil)			; U+0BB6
+	   ("ஷ" "Sh")			; U+0BB7
+	   ("ஸ" "s")			; U+0BB8
+	   ("ஹ" "h")			; U+0BB9
+	   ("க்ஷ" "x" )			; U+0B95
+	   ))
+	(virama #x0BCD)
+	clm)
+    (with-temp-buffer
+      (insert "\n")
+      (insert "    +")
+      (insert-char ?- 74)
+      (insert "\n    |")
+      (setq clm 6)
+      (dolist (v vowels)
+	(insert (propertize "\t" 'display (list 'space :align-to clm))
+		(car v))
+	(setq clm (+ clm 6)))
+      (insert "\n    |")
+      (setq clm 6)
+      (dolist (v vowels)
+	(insert (propertize "\t" 'display (list 'space :align-to clm))
+		(nth 2 v))
+	(setq clm (+ clm 6)))
+      (dolist (c consonants)
+	(insert "\n----+")
+	(insert-char ?- 74)
+	(insert "\n")
+	(insert (car c) virama
+		(propertize "\t" 'display '(space :align-to 4))
+		"|")
+	(setq clm 6)
+	(dolist (v vowels)
+	  (insert (propertize "\t" 'display (list 'space :align-to clm))
+		  (car c) (or (nth 1 v) ""))
+	  (setq clm (+ clm 6)))
+	(insert "\n" (or (nth 1 c) "")
+		(propertize "\t" 'display '(space :align-to 4))
+		"|")
+	(setq clm 6)
+
+	(dolist (v vowels)
+	  (apply 'insert (propertize "\t" 'display (list 'space :align-to clm))
+		 (if (nth 1 c) (list (nth 1 c) (nth 2 v)) (list "")))
+	  (setq clm (+ clm 6))))
+      (insert "\n")
+      (insert "----+")
+      (insert-char ?- 74)
+      (insert "\n")
+      (buffer-string))))
+
+(defvar quail-tamil-itrans-numerics-and-symbols-table
+  (let ((symbols '((?௳ . "நாள்") (?௴ . "மாதம்") (?௵ . "வருடம்")
+		 (?௶ . "பற்று") (?௷ . "வரவு") (?௸ . "மேற்படி")
+		 (?௹ . "ரூபாய்") (?௺ . "எண்")))
+	(numerics '((?௰ . "பத்து") (?௱ . "நூறு") (?௲ . "ஆயிரம்")))
+	(width 6) clm)
+    (with-temp-buffer
+      (insert "\n" (make-string 18 ?-) "+" (make-string 50 ?-) "\n")
+      (insert
+       (propertize "\t" 'display (list 'space :align-to 5)) "numerics"
+       (propertize "\t" 'display (list 'space :align-to 18)) "|"
+       (propertize "\t" 'display (list 'space :align-to 38)) "symbols")
+      (insert "\n" (make-string 18 ?-) "+" (make-string 50 ?-) "\n")
+      (setq clm 0)
+      (dolist (symbols (list numerics symbols))
+	(unless (eq symbols numerics)
+	  (insert (propertize "\t" 'display (list 'space :align-to clm)) "|")
+	  (setq clm (+ clm width)))
+	(dolist (elm symbols)
+	  (insert (propertize "\t" 'display (list 'space :align-to clm))
+		  (car elm))
+	  (setq clm (+ clm width))))
+      (insert "\n")
+      (setq clm 0)
+      (dolist (symbols (list numerics symbols))
+	(unless (eq symbols numerics)
+	  (insert (propertize "\t" 'display (list 'space :align-to clm)) "|")
+	  (setq clm (+ clm width)))
+	(dolist (elm symbols)
+	  (insert (propertize "\t" 'display (list 'space :align-to clm))
+		  (or (cdr elm) ""))
+	  (setq clm (+ clm width))))
+      (insert "\n" (make-string 18 ?-) "+" (make-string 50 ?-) "\n")
+      (insert "\n")
+      (buffer-string))))
+
+(defvar quail-tamil-itrans-various-signs-and-digits-table
+  (let ((various '((?ஃ . "H") ("ஸ்ரீ" . "srii") (?ௐ)))
+	(digits "௦௧௨௩௪௫௬௭௮௯")
+	(width 6) clm)
+    (with-temp-buffer
+      (insert "\n" (make-string 18 ?-) "+" (make-string 60 ?-) "\n")
+      (insert
+       (propertize "\t" 'display (list 'space :align-to 5)) "various"
+       (propertize "\t" 'display (list 'space :align-to 18)) "|"
+       (propertize "\t" 'display (list 'space :align-to 45)) "digits")
+
+      (insert "\n" (make-string 18 ?-) "+" (make-string 60 ?-) "\n")
+      (setq clm 0 )
+
+      (dotimes (i (length various))
+	(insert (propertize "\t" 'display (list 'space :align-to clm))
+		(car (nth i various)))
+	(setq clm (+ clm width)))
+      (insert (propertize "\t" 'display (list 'space :align-to clm)) "|")
+      (setq clm (+ clm width))
+      (dotimes (i 10)
+	(insert (propertize "\t" 'display (list 'space :align-to clm))
+		(aref digits i))
+	(setq clm (+ clm width)))
+      (insert "\n")
+      (setq clm 0)
+      (dotimes (i (length various))
+	(insert (propertize "\t" 'display (list 'space :align-to clm))
+		(or (cdr (nth i various)) ""))
+	(setq clm (+ clm width)))
+      (insert (propertize "\t" 'display (list 'space :align-to clm)) "|")
+      (setq clm (+ clm width))
+      (dotimes (i 10)
+	(insert (propertize "\t" 'display (list 'space :align-to clm))
+		(format "%d" i))
+	(setq clm (+ clm width)))
+      (insert "\n" (make-string 18 ?-) "+" (make-string 60 ?-) "\n")
+      (buffer-string))))
+
 (if nil
     (quail-define-package "tamil-itrans" "Tamil" "TmlIT" t "Tamil ITRANS"))
 (quail-define-indian-trans-package
  indian-tml-itrans-v5-hash "tamil-itrans" "Tamil" "TmlIT"
- "Tamil transliteration by ITRANS method.")
+ "Tamil transliteration by ITRANS method.
+
+You can input characters using the following mapping tables.
+    Example: To enter வணக்கம், type vaNakkam.
+
+### Basic syllables (consonants + vowels) ###
+\\<quail-tamil-itrans-syllable-table>
+
+### Miscellaneous (various signs + digits) ###
+\\<quail-tamil-itrans-various-signs-and-digits-table>
+
+### Others (numerics + symbols) ###
+
+Characters below have no ITRANS method associated with them.
+Their descriptions are included for easy reference.
+\\<quail-tamil-itrans-numerics-and-symbols-table>
 
+Full key sequences are listed below:")
 
 ;;;
 ;;; Input by Inscript

Footnotes: 
[1]  Summary of ta-itrans changes

+ ta-itrans-1.png
  - I have introduced horizontal grid lines

  - I have added #0BB6 to the table. The character has no input method
    available. So the input row is left empty.

    Note: Furthermore, the associated glyphs are not available. (I have
    Tamil Lohit 2.4.5 - Thanks for suggesting this font!). So the tamil
    characters in that row looks malformed.

+ ta-itrans-2.png
  - I have split the single misc table used in your patch and split it
    in to two tables - "signs and digits table" and "numerics and
    symbols table".

    In the first table, 
    - I have removed Virama (0BCD) and Anusvara (0B82).
    - I have added TAMIL OM (0BD0) and the compound character `srii'.

    In the second table,
    - The characters have no input method. So I have included a
      description in native language to denote the purpose they serve. I
      believe there are advantages to including this table. For example,
      - It completes the catalogue and one can easily find out whether
        once font needs to be upgraded to display these (rarely used)
        characters.
      - Should there be a future request for assigning input methods to
        them, one need not work on it afresh.

[2] Additional hacks to quail.el

+ ta-itrans-3.png
  - Removed the old table (about which I had complaints). I don't know
    how to do this cleanly. Here is a quick hack I cooked up (marked
    with @@@)

,---- In quail.el (around line 2550 or so)
| 	(let* ((decode-map (list 'decode-map))
|                (num (quail-build-decode-map (list (quail-map)) "" decode-map
|                                             ;; We used to use 512 here, but
|                                             ;; TeX has more than 1000 and
|                                             ;; it's good to see the list.
|                                             0 5120 done-list)))
|@@@@@ 	  (when (and nil (> num 0)) 
| 	    (insert "
| KEY SEQUENCE
| ------------
| ")
| 	    (if (quail-show-layout)
| 		(insert "You can also input more characters")
| 	      (insert "You can input characters"))
| 	    (insert " by the following key sequences:\n")
| 	    (quail-insert-decode-map decode-map)))
`----

  - Place the cursor at the BEGINNING of help buffer rather than the end
    of it. There are more interesting things at the beginning of the
    buffer than the end of the buffer.

,---- In quail.el (around line 2575)
|       ;; Resize the help window again, now that it has all its contents.
|       (save-selected-window
|@@@ 	(goto-char (point-min))
|  	(select-window (get-buffer-window (current-buffer) t))
| 	(run-hooks 'temp-buffer-show-hook))
`----