On 18 Apr 2002, Stephen J. Turnbull stated:
>>>>> "nix" == nix
<nix(a)esperi.demon.co.uk> writes:
nix> Finsert_file_contents_internal() and don't bind the
nix> coding-system-for-read to the same value, you're asking for
nix> problems. I have a feeling that perhaps
nix> Finsert_file_contents_internal should do the binding itself.)
No. coding-system-for-read is a badly designed escape for user code.
The functions that implement io should not touch it.
In that case, insert_file_contents_internally shouldn't pass
Qinsert_file_contents to the file-name-handlers, then, because that is
encouraging them to insert the file contents *non*-literally, which is
not what was asked for.
(Probably it shouldbt' be calling the file-name-handlers directly at
all, and this job should be left to higher-level code that knows what
function is being called, or there should be an extra parameter to
insert_file_contents_internally that says whether it's being called for
a literal insertion or a non-literal one.)
nix> How can I? This is glyph-instantiation code: I have no
nix> (direct) control over when it's called!
You can bind variables in C, of course.
True. But the glyph code shouldn't empty the file-name-handler-alist, or
you'd be unable to have glyphs on EFS (for instance).
But it *should* call, or arrange for insert_file_contents_internally to
call, the functions in that alist with the *right* operation code :)
nix> --- well, in practice
nix> I know it'll always be called when I call `make-glyph', but I
nix> feel it's decidedly unwise to rely upon that.
Welcome to Mule.
`Decidedly unwise'? ;} ;}
You'd
be
hosed if somebody bound c-s-f-r before instantiating a glyph, but you
can argue that anybody who does that deserves to lose.
*That*'s OK.
(But still I consider it buggy for doing an explicitly-commanded
insert_file_contents_internally to accidentally turn into an
insert-file-contents... luckily the fix doesn't break anything, I think:
see above.
I haven't implemented this yet but I'll try it out.)
--
`Unless they've moved it since I last checked, travelling between
England and America does not involve crossing the equator.'
--- pir