[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiled file behaves differently than the uncompiled file (Was Re:
From: |
David Kastrup |
Subject: |
Re: Compiled file behaves differently than the uncompiled file (Was Re: bug#19582) |
Date: |
Wed, 28 Jan 2015 09:42:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Jay Belanger <address@hidden> writes:
> Wolfgang Jenkner <address@hidden> writes:
> ...
>> In emacs -Q, do `M-x calc' then convert, say 1m, to cm, i.e.,
>>
>> ' 1 m <return> u c c m <return>
>>
>> This gives `100 cm' on top of the stack (a plain integer scalar).
>>
>> Next, start another emacs -Q instance, do `M-x calc' and then, before
>> anything else, `M-: (load-library "calc-units")'.
>>
>> Now the same conversion exercise as before gives `100. cm' on the stack
>> instead (a calc float).
>
> The float appears because Calc does units simplifications differently if the
> calc-units.elc file is loaded too soon. I'm not sure why. I could
> probably narrow the problem down a little more, but not too far since
> the problem is in the elc file, not the el file.
>
> If the calc-units.elc file is loaded when it is supposed to be, the
> float doesn't
> appear.
> If the calc-units.elc file is loaded right away, then the float appears.
> If the calc-units.el file is loaded right away, then the float doesn't appear.
>
> What could cause the elc file to behave differently than the el file?
One obvious candidate is
(eval-when-compile
(require 'calc-alg))
This will _not_ be loaded by calc-unit.elc, but it will be loaded by
calc-unit.el.
So try loading it before calc-unit.elc and see whether that makes a
difference.
--
David Kastrup