>>>> "Darryl" == Darryl Okahata
<darrylo(a)sr.hp.com> writes:
Darryl> Well, instead of file-coding, what about hooks, in
Darryl> the grand sense of Emacs:
As a matter of architecture, it's probably better. But since it is
orthogonal to the ambiguity problem, I don't know if it's worth the
effort enough to get done soon.
Darryl> Also, are there any multilingual encodings that use
Darryl> 0x00-0x1f (aside from the usual LF, CR, TAB, BS, & FF)?
Unicode. Asians will use Unicode in files for the space savings over
UTF-8 (all ideographs are 3 bytes, and all syllabic characters are 2
bytes).
> 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.
Darryl> Yes, and mangling crypt.el to properly handle writes
Darryl> isn't too bad (as long as some symbol, other than `nil',
Darryl> can be used to represent `binary' in file-coding). The
Darryl> big problem is reading in encoded/encrypted files; the EOL
Darryl> detection in file-coding often corrupts the binary file.
Binding `coding-system-for-read' to `binary', using
`insert-file-contents-literally', or passing `binary' as the optional
CODING-SYSTEM argument to `insert-file-contents-internal' all should
work.
> We still need something like your patches. I hope you'll
> submit them.
Darryl> Well, I first need your "explicit-binary-symbol"
Darryl> file-coding fixes. My current patches assume that
Darryl> call-process uses "binary" for subprocess output (instead
Darryl> of the current "undecided"); I have to do this, because
Yes. I think this should be made the default. This is one place
where a hook should definitely be provided to do the guessing. You'd
need an oracle to do this right, especially since a process can change
its mind about which coding system it's going to spew without warning
XEmacs.
Darryl> there is currently no non-nil symbol I can bind to
Darryl> coding-system-for-read to represent binary.
Not documented outside of the source, I guess....
(coding-system-docstring 'binary)
Darryl> [ Well, I suppose I could use `no-conversion-unix' to
Darryl> represent binary. It's unclean, though. Does anyone know
Darryl> if `no-conversion-unix' does any converting? ]
'binary is an alias for 'no-conversion-unix. Both do absolutely no
conversion. (The file-format hooks etc may get run, but that's
independent of the file-coding stuff.) This is documented
somewhere.... Argh!
(get-coding-system nil)
(get-coding-system 'binary)
(get-coding-system 'no-conversion-unix)
The first two are `eq' because of the way `get-coding-system' is
implemented. The last is not `equal' to the other two, but all its
testable properties are `eq' to those of 'binary (they're memcpy's of
each other, so they'd better be).
--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
__________________________________________________________________________
__________________________________________________________________________
What are those two straight lines for? "Free software rules."