"Stephen J. Turnbull" <turnbull(a)sk.tsukuba.ac.jp> wrote:
Darryl> I'll bet that it is the file-coding insanity.
I've
Darryl> been going through file-coding hell trying to get crypt.el
Darryl> to work, and I'm coming to the conclusion that the design
Darryl> of the coding system is to blame (it's not a bug -- it's
Darryl> the design itself).
Well, you can take that position if you like. It's not unreasonable.
But ambiguous coding systems cannot be avoided in multilingual
applications for the foreseeable future; there are just too many
different encodings competing for 0x80-0xFF :-)
Well, instead of file-coding, what about hooks, in the grand sense
of Emacs:
Since we have "late", "early", etc. package-paths, what about
"late", and "early" insert-file hooks? The early hooks could be
responsible for handling binary-file issues (encoding,
encryption, etc.), and the "late" hooks could be used for
file-coding. This would probably be in
insert-file-contents-internal.
Also, are there any multilingual encodings that use 0x00-0x1f (aside
from the usual LF, CR, TAB, BS, & FF)? I'm wondering if we can make the
EOL detection mechanism a little smarter by assuming binary if 0x00 (and
hopefully other characters) exists in the byte stream. This wouldn't
fix the bug, but it could greatly decrease the chances of a user running
into it.
Darryl> One basic issue is that, if you use the default
Darryl> coding "undecided" and allow XEmacs to determine the
Why is this happening? The point is that if users are loading in
files, editing them as text, and then doing some crypt operation on
them, you have to write them out encoded before crypting them anyway.
Yes, and mangling crypt.el to properly handle writes isn't too bad
(as long as some symbol, other than `nil', can be used to represent
`binary' in file-coding). The big problem is reading in
encoded/encrypted files; the EOL detection in file-coding often corrupts
the binary file.
We still need something like your patches. I hope you'll submit
them.
Well, I first need your "explicit-binary-symbol" file-coding
fixes. My current patches assume that call-process uses "binary" for
subprocess output (instead of the current "undecided"); I have to do
this, because there is currently no non-nil symbol I can bind to
coding-system-for-read to represent binary.
[ Well, I suppose I could use `no-conversion-unix' to represent binary.
It's unclean, though. Does anyone know if `no-conversion-unix' does
any converting? ]
--
Darryl Okahata
darrylo(a)sr.hp.com
DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Hewlett-Packard, or of the
little green men that have been following him all day.