From: Aidan Kehoe <kehoea@parhasard.net>
To: Katsumi Yamaoka <yamaoka@jpl.org>
Cc: ding@gnus.org
Subject: Re: nnmail-pathname-coding-system breaks my XEmacs.
Date: Tue, 13 Jan 2009 12:02:36 +0000 [thread overview]
Message-ID: <18796.33500.65305.970938@parhasard.net> (raw)
In-Reply-To: <b4m4p03bt43.fsf@jpl.org>
Ar an triú lá déag de mí Eanair, scríobh Katsumi Yamaoka:
> In a sense, it is the reason Emacs provides the variable
> `default-file-name-coding-system' and lets
> `file-name-coding-system' be normally nil (like
> `coding-system-for-read' and `coding-system-for-write' are).
But file system pathname encodings don’t vary remotely as much on a single
system as can file content encodings. And dynamic let bindings can be used
for the rare instances that they do vary.
> It is helpful that the coding system used for encoding and
> decoding filenames is initialized to the one suitable to the
> language a user uses. In the Japanese language environment
> `default-file-name-coding-system' will be `euc-jp' (or possibly
> `utf-8') in UNIX or similar systems, and `shift_jis' in DOS
> machines. Those are helpful enough for daily work in Japan.
GNU Emacs doesn’t use the Unicode API for file names? Is there a good reason
why not?
> However, some newsgroups use Latin characters, Chinese characters,
> etc., for which neither `euc-jp' nor `shift_jis' is suitable.
>
> (Especially for testing Gnus, I subscribe to many non-ASCII
> groups even if I'm not capable to read all of those languages.)
>
> OTOH, `utf-8' seems to be the best choice for such a purpose,
> but setting `default-file-name-coding-system' (or
> `file-name-coding-system') to `utf-8' is not always a good idea
> since clients other than Emacs cannot necessarily deal with
> filenames encoded by `utf-8',
UTF-8 is *enforced* on OS X, in contrast to most Unix environments.
> and Emacs 21, XEmacs 21.4 and SXEmacs don't support `utf-8' fully (even
> if the Mule-UCS package is loaded).
>
> Therefore I concluded Gnus needs the coding system, that is not
> necessarily the same as the one used for arbitrary file names,
> for files for non-ASCII newsgroup names. My fault is that I did
> not take care of the *default* coding system used for file names
> in XEmacs.
>
> > This is initialised correctly these days (except if you're dealing,
> > say, with an external or network drive where your host OS doesn't
> > understand its file name encoding; but nothing can really initialise
> > correctly in that case) though I admit there were years where we
> > dealt with it very badly.
>
> So, how about changing the `let' bindings here and there in this
> way?
>
> (let ((file-name-coding-system
> (if (featurep 'xemacs)
> (or nnmail-pathname-coding-system
> ;; XEmacs w/o `file-coding' doesn't provide it.
> (and (featurep 'file-coding)
> file-name-coding-system))
> nnmail-pathname-coding-system)))
That will work, yes. Because of the stupid hackery I mentioned in my earlier
mail it will break file-name-coding-system if a user actually uses use
nnmail-pathname-coding-system binding, but that’s a slightly better
situation than the current one, where file-name-coding-system is broken
afterwards whether the user uses nnmail-pathname-coding-system or not.
> [...] In my Fedora 10 Linux box, both XEmacs 21.5 that was downloaded
> from hg today and XEmacs 21.4 from CVS set `file-name-coding-system' to
> nil for the "ja_JP.UTF-8" locale, though.
Yes, that’s a cosmetic bug on our part. The file-name coding system alias,
which is actually what’s used in the C code, is supposed to be equivalent to
the file-name-coding-system variable, but I hadn’t maintained this
relationship in writing the startup code. I’ll fix that.
Try
LC_CTYPE=ja_JP.UTF-8 xemacs-21.5-b28 -batch -eval "(princ (coding-system-aliasee 'file-name))"
if you want to check that.
> > (Note that nil, your default, corresponds to the binary,
> > no-conversion coding system under XEmacs, which, for example, Mac OS
> > X will not accept when asked to create a file name with non-ASCII
> > characters in that encoding, it requires valid UTF-8.)
>
> Once I have modified mm-(decode|encode)-coding-(string|region)
> so as to do nothing in XEmacs with the coding system nil. But I
> overlooked what happens when `file-name-coding-system' is nil.
> I think XEmacs' way, i.e. treating nil as binary, is not a good
> idea.
I agree. I don’t know why that decision was made.
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghe, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
next prev parent reply other threads:[~2009-01-13 12:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <18794.15468.881403.994781@parhasard.net>
2009-01-11 21:54 ` Reiner Steib
2009-01-12 1:08 ` Katsumi Yamaoka
2009-01-12 12:02 ` Aidan Kehoe
2009-01-13 6:46 ` Katsumi Yamaoka
2009-01-13 12:02 ` Aidan Kehoe [this message]
2009-01-14 6:36 ` Katsumi Yamaoka
2009-01-14 10:57 ` Katsumi Yamaoka
2009-01-14 11:33 ` Aidan Kehoe
2009-01-14 20:16 ` Reiner Steib
2009-01-14 20:48 ` Aidan Kehoe
2009-01-15 0:25 ` Katsumi Yamaoka
2009-01-15 0:35 ` Aidan Kehoe
2009-01-16 8:05 ` Katsumi Yamaoka
2009-01-16 14:19 ` Aidan Kehoe
2009-01-14 20:56 ` Aidan Kehoe
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=18796.33500.65305.970938@parhasard.net \
--to=kehoea@parhasard.net \
--cc=ding@gnus.org \
--cc=yamaoka@jpl.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.
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 NNTP newsgroup(s).