unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mattiase@acm.org, eggert@cs.ucla.edu, emacs-devel@gnu.org,
	handa@m17n.org
Subject: Re: Broken `if big5-p` code in titdic-cnv.el
Date: Wed, 27 Jan 2021 12:35:45 -0500	[thread overview]
Message-ID: <jwv35ymz5cp.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83tur2z76r.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Jan 2021 18:16:28 +0200")

> 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.

Thanks.

> 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
methods:

    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.


        Stefan


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 "倉頡" "簡易"))
 	dic)
     (goto-char (point-max))
-    (if big5-p
-	(insert (format "\"中文輸入【%s】BIG5
+    (insert (format "\"中文輸入【%s】%s
 
 	漢語%s輸入鍵盤
 
@@ -753,19 +751,7 @@ tsang-quick-converter
       [Z  ] [X 難] [C 金] [V 女] [B 月] [N 弓] [M 一]
 
 \\\\<quail-translation-docstring>\"\n"
-			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 一]
-
-\\\\<quail-translation-docstring>\"\n"
-		      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)))
 		 table)))
     (setq dic (sort dic (lambda (x y) (string< (car x) (car y)))))




  reply	other threads:[~2021-01-27 17:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-04 12:37 Scan of broken conditional forms Mattias Engdegård
2020-01-04 13:03 ` Michael Albinus
2020-01-04 19:23 ` Paul Eggert
2020-01-04 19:39   ` Eli Zaretskii
2020-01-04 21:40     ` Paul Eggert
2020-01-05 15:45       ` Eli Zaretskii
2020-01-05 20:48         ` Paul Eggert
2020-01-05 20:57           ` Stefan Monnier
2021-01-27  3:02           ` Broken `if big5-p` code in titdic-cnv.el (was: Scan of broken conditional forms) Stefan Monnier
2021-01-27  8:18             ` Broken `if big5-p` code in titdic-cnv.el Andreas Schwab
2021-01-27 16:16             ` Broken `if big5-p` code in titdic-cnv.el (was: Scan of broken conditional forms) Eli Zaretskii
2021-01-27 17:35               ` Stefan Monnier [this message]
2020-01-04 22:04   ` Scan of broken conditional forms Mattias Engdegård
2020-01-04 22:11     ` Paul Eggert
2020-01-31 16:22 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv35ymz5cp.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).