From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Narendra Joshi Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000005ae8e05a1dc4edf" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="89435"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40155@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 27 21:55:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jHw0X-000N9K-JK for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Mar 2020 21:55:13 +0100 Original-Received: from localhost ([::1]:46858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHw0W-0004UJ-Bz for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Mar 2020 16:55:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40107) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHw0M-0004UD-Vn for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2020 16:55:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHw0L-0007zN-RY for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2020 16:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHw0L-0007yG-Jz for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2020 16:55:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jHw0L-0007rD-JK for bug-gnu-emacs@gnu.org; Fri, 27 Mar 2020 16:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Narendra Joshi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Mar 2020 20:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40155 X-GNU-PR-Package: emacs Original-Received: via spool by 40155-submit@debbugs.gnu.org id=B40155.158534246730133 (code B ref 40155); Fri, 27 Mar 2020 20:55:01 +0000 Original-Received: (at 40155) by debbugs.gnu.org; 27 Mar 2020 20:54:27 +0000 Original-Received: from localhost ([127.0.0.1]:33373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHvzn-0007px-0l for submit@debbugs.gnu.org; Fri, 27 Mar 2020 16:54:27 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:37927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jHvzj-0007pi-LA for 40155@debbugs.gnu.org; Fri, 27 Mar 2020 16:54:24 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id s1so13148552wrv.5 for <40155@debbugs.gnu.org>; Fri, 27 Mar 2020 13:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mc4RYRMSGk9Pxk4Ko2slxVMpqYSEfeH4jn9REcsHyyc=; b=j1giTKvv4tYFqs4eCXBTXGYj2ZfrvUuPy8YJjNpzFpxHNl9qqgK41z45S2eMfTZQG4 5l+TbeuR3dc7pokkJlvLPIUb/iJmLF21urVkvsSGZvzoE1T2Ed314cQKgV3AHtO2rZ8W AvnFzgfPeBlnFLuUtsz4I5aAJWlVn/DXASl14OQurxFYpEqBdC5E6ZT9UcvGIewPoEHd mAsKrNuYbRhSFvAk1VrTwjrk5IH4Y1AaLFRQJ+I85g4XhQ5bMF6S7dvfg3TqMTwVotwZ N1wPVUgui1DHuGt9jgp2kzrihAdQieeJoVPLtW3BaNb3RYu8gv9DCe5oL4Cp9w0rtL4O gH9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mc4RYRMSGk9Pxk4Ko2slxVMpqYSEfeH4jn9REcsHyyc=; b=mlJf97QhGwJ2a2n5M4asSDOlLJv8jR1D5gbQIlyhASS0bYPkvw2fXB9YrTTiqt4sKN uwAE8qN5SVJBegsE1H9rvWP4wpRPvZmJW6af4/XhLn1WMFqfY5JmJ1P3xaX90U9TxuX0 wZ7qbKC3MtpOSxyQlKOUV7d0FNPYaktm3+O8kicjoMLzkIubvOHVRptprk+WYHGbLeSE kqQW/qTFlO/fquJdGVtooaE/VZnZNRWvJl7iDRelD9qbOx9XrtOclfutqXmcRN/d81Kb X7H6qXyyATc3Ouz1UcSI4NTxLA5SKpLfFubpnrco9ZINqCK2Z3bB/LzQ5NQZPQmJEfvp IPUw== X-Gm-Message-State: ANhLgQ25M5Wgm6wl109PFtSqBqbluQkPUk/ETuFanucQuot6iYL631aX LEI+B9WPEsInp4QSR8F1UN6+WKfpUGlIwZBLmw== X-Google-Smtp-Source: ADFU+vtsV8cuUaZB/8Ma/AE31vVw25vr9FEuJzz0iIKxiNieMRM+7Q/dGXih0keUHtc3U7dpNqsuw87Mbfk322pwj1A= X-Received: by 2002:a5d:4f92:: with SMTP id d18mr1357820wru.400.1585342457416; Fri, 27 Mar 2020 13:54:17 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177791 Archived-At: --00000000000005ae8e05a1dc4edf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=C3=A5rd w= rote: > > 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 ar= gument 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 n= il 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, i= n case the change had unintended consequences.) > --00000000000005ae8e05a1dc4edf Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Fix-setting-linestyle-in-calc-graph-fns.patch" Content-Disposition: attachment; filename="0001-Fix-setting-linestyle-in-calc-graph-fns.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k8anxsup0 RnJvbSAxZjQwZjIzZGY3MTk0NmZiZWQ3NTg4MWM2ZGNhNTRlZGE5NDcwMmMyIE1vbiBTZXAgMTcg MD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