Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Specifying coding system for Imap.cache files

14 views
Skip to first unread message

blueman

unread,
Jun 29, 2012, 12:32:03 PM6/29/12
to
When running vm on a Windows machine, I typically add
( "^C:/myhome/mail/" 'raw-text-unix) to the alist file-coding-system-alist since I want to keep all my mail files in the unix file system coding without the annoying carriage returns (^M) at the end of each line.

However, this doesn't seem to be working for the imap-cache folders even though they are stored in the same mail heirarchy...

Unfortunately, these ^M characters then seem to sometimes generate an error when reading imap mail since the coding system gets messed up.

So, is there any way to get the imap-cache files to respect the file
coding system that I am setting for their directory? i.e., is there a way to specify the coding system that vm uses to write to an imap-cache file?

Thanks

Uday S Reddy

unread,
Jun 30, 2012, 7:41:17 PM6/30/12
to viewma...@nongnu.org
blueman writes:

> When running vm on a Windows machine, I typically add ( "^C:/myhome/mail/"
> 'raw-text-unix) to the alist file-coding-system-alist since I want to keep
> all my mail files in the unix file system coding without the annoying
> carriage returns (^M) at the end of each line.
>
> However, this doesn't seem to be working for the imap-cache folders even
> though they are stored in the same mail heirarchy...

First of all, VM doesn't set line ending formats. Emacs does.

Secondly, the variable file-coding-system-alist, according to its
documentation, sets the coding system for *reading* files, not writing them.
So, it is a bad idea to set line-ending format there (or even one single
coding system for all types of files). From what you write later on, I
suspect that your imap-cache folders might have gotten corrupted as a
result.

How Gnu Emacs decides the line ending format for the files it creates is a
bit of a mystery. All I have in my customizations is

(if running-fsf
;; (setq-default buffer-file-coding-system 'iso-latin-1-unix)
(setq default-buffer-file-coding-system 'utf-8-unix)
)

This seems to tell Emacs that it should use unix line endings all the time.
I can't be sure. But I have never had Emacs create new files with DOS line
endings.

Cheers,
Uday

0 new messages