Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Aidan Kehoe <kehoea@parhasard.net>
Cc: ding@gnus.org
Subject: Re: nnmail-pathname-coding-system breaks my XEmacs.
Date: Tue, 13 Jan 2009 15:46:52 +0900	[thread overview]
Message-ID: <b4m4p03bt43.fsf@jpl.org> (raw)
In-Reply-To: <18795.12614.222792.255516@parhasard.net>

>>>>> Aidan Kehoe <kehoea@parhasard.net> wrote:
>> cf. (info "(gnus)Non-ASCII Group Names")

> If this reflects the current state of affairs:

> nnmail-pathname-coding-system

>     The value of this variable should be a coding system or nil (which is
>     the default). The nnml back end, the nnrss back end, the NNTP marks
>     feature (see section 6.2.1.4 NNTP marks), the agent, and the cache use
>     non-ASCII group names in those files and directories. This variable
>     overrides the value of file-name-coding-system which specifies the
>     coding system used when encoding and decoding those file names and
>     directory names.

>     In XEmacs (with the mule feature), file-name-coding-system is the only
>     means to specify the coding system used to encode and decode file
>     names. Therefore, you, XEmacs users, have to set it to the coding system
>     that is suitable to encode and decode non-ASCII group names. On the
>     other hand, Emacs uses the value of default-file-name-coding-system if
>     file-name-coding-system is nil. Normally the value of
>     default-file-name-coding-system is initialized according to the locale,
>     so you will need to do nothing if the value is suitable to encode and
>     decode non-ASCII group names.

>         (from http://www.gnus.org/manual/gnus_40.html )

> why aren't you just using file-name-coding-system?

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

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.
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', 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)))

Otherwise, does this simple way help?

(defvar nnmail-pathname-coding-system
  (if (and (featurep 'xemacs)
	   ;; XEmacs w/o `file-coding' doesn't provide it.
	   (featurep 'file-coding))
      file-name-coding-system)
  "*Coding system for file name.")

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.

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

Regards,



  reply	other threads:[~2009-01-13  6:46 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 [this message]
2009-01-13 12:02         ` Aidan Kehoe
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=b4m4p03bt43.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=kehoea@parhasard.net \
    /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).