From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34215: 27.0.50; Provide elisp access to Chinese pinyin-to-character mapping Date: Wed, 30 Jan 2019 19:09:47 +0200 Message-ID: <83ftta138k.fsf@gnu.org> References: <87imyafyts.fsf@ericabrahamsen.net> <83r2cy3y69.fsf@gnu.org> <87a7jmf06v.fsf@ericabrahamsen.net> <83ef8y3r40.fsf@gnu.org> <875zu9gb96.fsf@ericabrahamsen.net> <83a7jl51c5.fsf@gnu.org> <87va27cq35.fsf@ericabrahamsen.net> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="166037"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34215@debbugs.gnu.org To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 30 18:11:17 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gotOP-000h1n-Iq for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jan 2019 18:11:17 +0100 Original-Received: from localhost ([127.0.0.1]:41470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gotOO-0005iW-If for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jan 2019 12:11:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gotOG-0005hU-Te for bug-gnu-emacs@gnu.org; Wed, 30 Jan 2019 12:11:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gotOC-0003is-6y for bug-gnu-emacs@gnu.org; Wed, 30 Jan 2019 12:11:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gotOA-0003hu-EP for bug-gnu-emacs@gnu.org; Wed, 30 Jan 2019 12:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gotOA-0000X6-5d for bug-gnu-emacs@gnu.org; Wed, 30 Jan 2019 12:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Jan 2019 17:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34215 X-GNU-PR-Package: emacs Original-Received: via spool by 34215-submit@debbugs.gnu.org id=B34215.15488682021969 (code B ref 34215); Wed, 30 Jan 2019 17:11:02 +0000 Original-Received: (at 34215) by debbugs.gnu.org; 30 Jan 2019 17:10:02 +0000 Original-Received: from localhost ([127.0.0.1]:51886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gotNC-0000Vh-BJ for submit@debbugs.gnu.org; Wed, 30 Jan 2019 12:10:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gotNA-0000V9-Ms for 34215@debbugs.gnu.org; Wed, 30 Jan 2019 12:10:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gotN5-0002yb-BQ; Wed, 30 Jan 2019 12:09:55 -0500 Original-Received: from [176.228.60.248] (port=4690 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gotN4-0002TL-Uq; Wed, 30 Jan 2019 12:09:55 -0500 In-reply-to: <87va27cq35.fsf@ericabrahamsen.net> (message from Eric Abrahamsen on Tue, 29 Jan 2019 09:48:30 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:154895 Archived-At: > From: Eric Abrahamsen > Date: Tue, 29 Jan 2019 09:48:30 -0800 > > I've attached a diff adding the conversion function itself, but I'm not > familiar with makefiles and so far haven't been able to figure out how > to call it. It looks like the invocation I want will look like: > > $(AM_V_GEN)${RUN_EMACS} -l titdic-cnv -f pinyin-convert \ > ${srcdir}/MISC-DIC/pinyin.map ${srcdir}/../lisp/language/pinyin.el > > Where ${srcdir} is the leim directory, but I don't actually know how to > get this code called by make... Add a target that is the file produced by this command, then make the above command the recipe of that target. Similar to the ${leimdir}/ja-dic/ja-dic.el target. But if the above doesn't help, someone else could do this part for you. > > I understand, but I wonder if someone could try that for a while and > > see if it makes better input method(s), before we decide to import it. > > FWIW, that mapping is used by the pyim package, which I believe is the > most popular pinyin-based Chinese input method out there. I also use it > via the system-wide input framework fcitx, and it works very well. Then I guess we will be fine importing the new version. > +(defun pinyin-convert () > + "Convert text file pinyin.map into an elisp library. > +The library is named pinyin.el, and contains the constant > +`pinyin-character-map'." This writes out a .el file, but does it encode that file in UTF-8, even if the locale's codeset is something other than UTF-8? If not, you need to bind coding-system-for-write to UTF-8. > + (insert ";; This file is automatically generated from pinyin.map,\ > + by the function pinyin-convert.") This line is too long, suggest to break it in two. > + (insert ")\n\"An alist holding correspondences between pinyin syllables\ > + and Chinese characters.\")\n") Likewise here. Thanks.