[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#40155: 27.0.90; `math-truc' called with `nil' during `calc-graph-fas
From: |
Narendra Joshi |
Subject: |
bug#40155: 27.0.90; `math-truc' called with `nil' during `calc-graph-fast' call |
Date: |
Fri, 27 Mar 2020 21:54:06 +0100 |
Hi Mattias,
Thanks for the explanation. The patch fixes the original issue and
other calculations I tried didn't seem to be affected.
I found out that `calc` doesn't set the LineStyles (and maybe
PointStyles as well but I am not sure how to hand those over to
gnuplot command) properly for the gnuplot command. I think it should
do something similar to the patch I have attached.
Best,
Narendra
On Fri, Mar 27, 2020 at 6:37 PM Mattias Engdegård <mattiase@acm.org> wrote:
>
> Thanks for the report. Explanation:
>
> The graph code does
>
> (and (Math-num-integerp lstyle) (math-trunc lstyle))
>
> but Math-num-integerp returns true for nil, and math-trunc returns the
> argument if it satisfies Math-integerp, which used to return true for nil as
> well. Thus, the expression above 'works' (ie, returns nil) when lstyle is nil
> as well.
>
> However, Math-integerp was changed in Emacs 27 to use native bignums, and no
> longer returns true for nil, resulting in the error. Changing
> Math-num-integerp to return false for nil would make the code work again,
> this time in the way originally intended.
>
> Would you try this patch? (Please try various other operations as well, in
> case the change had unintended consequences.)
>
0001-Fix-setting-linestyle-in-calc-graph-fns.patch
Description: Text Data