all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 34215@debbugs.gnu.org
Subject: bug#34215: 27.0.50; Provide elisp access to Chinese pinyin-to-character mapping
Date: Sun, 27 Jan 2019 10:02:48 -0800	[thread overview]
Message-ID: <87a7jmf06v.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87imyafyts.fsf@ericabrahamsen.net>

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Date: Sat, 26 Jan 2019 21:34:39 -0800
>> 
>> So this proposed patch simply parses the same file in the same way, but
>> in a different location. I've put it in china-util.el, but chinese.el
>> would also be a reasonable spot. Both those files are concerned with
>> encoding, but at least "china-util" gives the impression that it could
>> be a grab-bag.
>
> How much does this add to Emacs memory footprint when loaded?  

I actually don't know how to measure the memory taken up by the contents
of a variable, but I imagine it's fairly significant. Or maybe I could
do a "before and after" measurement of all of Emacs.

> Since this will be required only rarely, I doubt that it would be a
> good idea to force every user of Chinese language to pay the price, if
> it is significant. It would be better to have this as a separate file
> with autoloaded variable or function, IMO.

That sounds fine to me. I agree the data shouldn't be loaded unless it's
been explicitly requested.

>> I'm not sure this use of `source-directory' is particularly robust, but
>> I don't know how else to handle it.
>
> source-directory might not exist in a given installation.
>
> Maybe we should have the data copied into that separate file I
> mentioned above.

I can imagine a few ways of doing that:

1. Just manually copy the data into a new file and add it to the repo
   (pinyin.map hasn't been updated in years).
2. Do the copy at build time. I'm not quite sure where that function
   would live, or how it would get called.
3. Use an `eval-and-compile' form as in the patch I provided. Is working
   back from `load-file-name' more reliable than using
   `source-directory'?

Autoloading a variable seems to copy the value of the variable into the
loaddefs file, so there's no point to that. I figure we can just ask
people who want this value to require the library.

Thanks,
Eric

PS: pinyin.map is ancient and is missing a lot of good correspondences.
Google's pinyin input method uses a much larger map, licensed with
Apache v2.0. This[1] seems to indicate that Apache 2.0 is okay for Gnu
projects, maybe we could consider switching to that map?

Footnotes:
[1]  https://www.gnu.org/licenses/license-list.en.html#apache2







  reply	other threads:[~2019-01-27 18:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-27  5:34 bug#34215: 27.0.50; Provide elisp access to Chinese pinyin-to-character mapping Eric Abrahamsen
2019-01-27 15:41 ` Eli Zaretskii
2019-01-27 18:02   ` Eric Abrahamsen [this message]
2019-01-27 18:14     ` Eli Zaretskii
2019-01-27 19:18       ` Eric Abrahamsen
2019-01-27 19:48         ` Eli Zaretskii
2019-01-29 17:48           ` Eric Abrahamsen
2019-01-30 17:09             ` Eli Zaretskii
2019-01-30 20:33               ` Eric Abrahamsen
2019-01-30 20:48                 ` Eric Abrahamsen
2019-01-31  8:50                   ` Robert Pluim
2019-01-31 19:35                     ` Eric Abrahamsen
2019-02-01  9:48                       ` Eli Zaretskii
2019-02-01 16:27                         ` Eric Abrahamsen
2019-02-01 18:53                           ` Eli Zaretskii
2019-02-01 19:15                             ` Eric Abrahamsen
2019-02-24  5:36                         ` Eric Abrahamsen
2019-02-24 16:06                           ` Eli Zaretskii
2019-02-24 18:53                             ` Eric Abrahamsen
2019-02-24 19:12 ` bug#34215: Eric Abrahamsen

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

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

  git send-email \
    --in-reply-to=87a7jmf06v.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=34215@debbugs.gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.