[Top][All Lists]

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

Re: [VM] searching in mime encoded email

From: Uday Reddy
Subject: Re: [VM] searching in mime encoded email
Date: Sat, 21 Jan 2012 10:53:14 +0100

[Julian sent in a response yesterday, but it wasn't copied to mailing list.
Do you want to re-send it to the mailing list, Julian?]

Julian Bradfield writes:

> The folder is made up of bytes. There's no getting round that.
> Come to that, *any* file is made up of bytes. It doesn't get converted
> to characters until it's read into an Emacs buffer with a given coding
> system.
> In VM's case, folder files are read into folder buffers with the
> binary coding system, and so the folder buffer is also a sequence of
> bytes (which are punned with characters 0 to 255).
> It's inherently impossible to meaningfully treat a folder as a
> sequence of characters - unless you already know that all the
> characters in it are represented in the same coding system.

Good, I think we are on the same page now.

To re-state what I wrote last night, I am thinking of VM folders made up of
*characters*.  They could be used with a new file extension suffix, e.g.,
".vm".  On the disk, they would be in some coding system such as UTF-8.
When they are loaded into folder buffers, they would be text files in
Emacs's internal encoding.  (In Gnu Emacs, the "coding system" of a buffer
specifies how to move data in and out of the buffer, in particular how it
should be stored on disk.  It has nothing to do with how the characters are
represented inside Emacs.  They could be represented how ever Emacs pleases
and we don't care.  If XEmacs does it differently, please let me know.  I
will check on that.)  All the text/plain parts in such a folder would
be in the default coding system of the folder.  No "charset" headers.  All
the attachments would be MIME-encoded to appear as ASCII.  So, they won't
get munged inside Emacs or when they are saved to disk.

The current VM folders are made of *bytes*.  But when one saves messages
from a byte folder into a character folder, they get transformed
appropriately.  (The signatures are verified and stripped.  Encrypted parts?
We will need an option to either decrypt them and store them as "plain text"
or to store them as is.)  One could also choose to work with character
folders *all the time*, and transform messages from the byte format to
character format when they arrive.

People being people, they will also want to save messages from ".vm" folders
into byte folders.  We either prohibit that, or re-encode the messages as
proper MIME messages before saving into byte folders.

So, I am contesting the idea that it is inherently impossible to have
folders as sequences of characters.


reply via email to

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