[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: propagating a coding setting across source files
From: |
Mike Gran |
Subject: |
Re: propagating a coding setting across source files |
Date: |
Wed, 11 Jan 2012 10:13:05 -0800 (PST) |
>>>> I added to the master file the following comment:
>>>>
>>>> ; coding: iso-8859-1
>>>>
>>>> which works as documented.
>>>> How can I avoid to add this comment line to all the other files
>>>> which are currently included by the master file using
> "load"?
>>>
>>> You can (fluid-set! %default-port-encoding "iso-8859-1").
>>>
>>> Let us know if this doesn't work.
>>
>> If I add this to my master file it does not help.
>> Where should I put your command?
>
> It could be that there is an issue regarding compile-time versus
> run-time;
>
> http://www.gnu.org/software/guile/manual/html_node/Eval-When.html
>
> If you put this at the top of your file, before any use-modules or
> anything like that, does it work?
>
> (eval-when (eval load compile)
> (fluid-set! %default-port-encoding "iso-8859-1"))
>
> You might need to run with --auto-compile=fresh to invalidate the
> caches.
Hey Andy,
I tried to dig through the logic of this the other day, and I'm not
sure that your suggestion can work. If "load" ends up calling
"primitive-load", then any file without a "coding:" line is UTF-8.
%default-port-encoding doesn't enter in to it.
But there is a lot between "load" and "primitive-load" that I didn't
try to trace through. I'm not sure under what conditions "load" calls
"primitive load".
Thanks,
Mike