[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Broken `if big5-p` code in titdic-cnv.el

From: Stefan Monnier
Subject: Re: Broken `if big5-p` code in titdic-cnv.el
Date: Wed, 27 Jan 2021 12:35:45 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I've discussed this with Handa-san a year ago, and we arrived at the
> conclusion that the charset information is indeed no longer important.


> However, if you look carefully at the part of tsang-quick-converter
> that begins with
>     (let ((punctuation '((";" ";﹔,、﹐﹑" ";﹔,、﹐﹑")
> and ends with
>     (dolist (elt punctuation)
>       (insert (format "(%S %S)\n" (concat "z" (car elt))
>                     (if big5-p (nth 1 elt) (nth 2 elt))))))
> you will see that some of the characters in the punctuation structure
> are actually different between the big5-p and non-big5-p branches,
> although most of them are identical.

That's indeed what I noticed a few minutes ago.  I don't think it
affects the decision of what to do in the short term: I pushed the patch
below (additionally to converting the file back to utf-8, which doesn't
render nicely in a patch).

> So either these are artifacts of converting this file from its
> original encoding, or there are actual differences between these two
> branches, and we cannot simply delete one of them.

AFAIK this `punctuation` just adds some additional entries to the input
method beside the entries extracted from the source files in
leim/MISC-DIC.  I think it's OK to add "almost exactly the same but not
quite" to the CNS and BIG5 input methods since they are themselves
pretty close to each other already (yet different), AFAIU.

According to `ediff-buffers`, the sources `cangjie-table.b5` and
`cangjie-table.cns` have only 6 characters different, so maybe it's not
worth keeping them separate and we should actually merge those input

    chinese-b5-quick    and chinese-cns-quick      =>  chinese-quick
    chinese-b5-tsangchi and chinese-cns-tsangchi   =>  chinese-tsangchi

In any case, I'm not in a position to make such a decision since I don't
know anything about those scripts and even less about how they're used.
So I only installed changes which shouldn't affect the actual
behavior of those input methods.


diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index 84e218f179..ce5c04293a 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -375,7 +375,7 @@ tit-process-header
     ;; Arg DOCSTRING
     (let ((doc (concat tit-prompt "\n"))
          (comments (if tit-comments
-                       (mapconcat 'identity (nreverse tit-comments) "\n")))
+                       (mapconcat #'identity (nreverse tit-comments) "\n")))
          (doc-ext (nth 2 (assoc package quail-cxterm-package-ext-info))))
       (if comments
          (setq doc (concat doc "\n" comments "\n")))
@@ -737,12 +737,10 @@ quail-misc-package-ext-info
 ;; method is for inputting CNS characters.
 (defun tsang-quick-converter (dicbuf tsang-p big5-p)
-  (let ((fulltitle (if tsang-p (if big5-p "倉頡" "倉頡")
-                    (if big5-p "簡易" "簡易")))
+  (let ((fulltitle (if tsang-p "倉頡" "簡易"))
     (goto-char (point-max))
-    (if big5-p
-       (insert (format "\"中文輸入【%s】BIG5
+    (insert (format "\"中文輸入【%s】%s
@@ -753,19 +751,7 @@ tsang-quick-converter
       [Z  ] [X 難] [C 金] [V 女] [B 月] [N 弓] [M 一]
-                       fulltitle fulltitle))
-      (insert (format "\"中文輸入【%s】CNS
-       漢語%s輸入鍵盤
-   [Q 手] [W 田] [E 水] [R 口] [T 廿] [Y 卜] [U 山] [I 戈] [O 人] [P 心]
-    [A 日] [S 尸] [D 木] [F 火] [G 土] [H 竹] [J 十] [L 中]
-      [Z  ] [X 難] [C 金] [V 女] [B 月] [N 弓] [M 一]
-                     fulltitle fulltitle)))
+                   fulltitle (if big5-p "BIG5" "CNS") fulltitle))
     (insert "  '((\".\" . quail-next-translation-block)
    (\",\" . quail-prev-translation-block))
   nil nil)\n\n")
@@ -953,7 +939,7 @@ ziranma-converter
                                     (= (length (aref trans i)) 1))
                           (setq i (1+ i)))
                         (if (= i len)
-                            (setq trans (mapconcat 'identity trans "")))))
+                            (setq trans (mapconcat #'identity trans "")))))
                     (setq dic (cons (cons key trans) dic)))
     (setq dic (sort dic (lambda (x y) (string< (car x) (car y)))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]