[Top][All Lists]

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

Re: Different (buffer-file-)coding-systems for different regions of one

From: Kai Großjohann
Subject: Re: Different (buffer-file-)coding-systems for different regions of one buffer? (for Rmail MIME)
Date: Thu, 22 May 2003 15:16:56 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

"Stefan Monnier" <monnier+gnu/address@hidden> writes:

>> Would it be possible to have different coding-systems (the decoding of
>> octets from a file into characters in a buffer) for different ranges
>> of octets in a file?
> Of course, it's possible: coding systems are operations, not data.
> Emacs offers straightforward ways to apply those operations to whole
> files when reading and saving them, as well as straightforward
> ways to apply those operations to parts of a buffer.

Actually, an mbox-coding-system sounds rather attractive to me.  I
think there are existing encodings that use escape sequences so
that an application reads ascii, then comes an escape sequence that
says "Japanese from here on", then comes another escape sequence that
says "ascii again".  Is this true?

Emacs-mule uses a similar mechanism, except that the escape sequences
are always applied to one character only.  So \201 means to read one
character in Latin-1, and so on.

And, conceptually, the charset specs in Content-Type headers are just
such escape sequences.

I guess it would be difficult to implement the encoding, but it would
be just what RMAIL needs.  You can then just find the file and then
narrow to certain regions.  I understand that Richard likes this way
of working with mailboxes.  (Reading the file into the buffer is
comparatively easy, but I'm not sure how to make sure that
read-then-write doesn't change the file.)
This line is not blank.

reply via email to

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