emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 23.0.60; Can't start emacs when filename contains national character


From: Stefan Monnier
Subject: Re: 23.0.60; Can't start emacs when filename contains national character
Date: Sat, 29 Mar 2008 16:22:53 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> > That probably means I used the wrong to/make-multibyte function to fix
>> > the problem.  Will look into it, thanks.
>> 
>> I recommend to stay as far away from string-to/as/make-unit/multibyte
>> as possible.  Use en/decode-coding-string instead.

> That's what I did eventually.  I tried to be smart at first, to maybe
> avoid the overhead of full-fledged decoding, but gave up and used
> DECODE_FILE instead.

If the issue is performance, maybe we should just improve
(en|de)code-coding-string to recognize those few special cases and
redirect them to string-(to|as)-(uni|multi)byte.

Note that is set-unibyte-charset is never called (which should always be
the case now), string-make-foo is identical to string-to-foo.

So the remaining two cases ("to" and "as") work as follows:

    "to" = `binary'
    "as" = internal CS (i.e. `utf-8-emacs', but was `emacs-mule' before)

Funnily enough we do not have a coding-system `emacs-internal' which
would be `emacs-mule' in Emacs-22 and `utf-8-emacs' in Emacs-23.
I guess we can use

  (if (coding-system-p 'utf-8-emacs) 'utf-8-emacs 'emacs-mule)

if we need it.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]