From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id gEPcMithBWYWXgAAqHPOHw:P1 (envelope-from ) for ; Thu, 28 Mar 2024 13:23:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gEPcMithBWYWXgAAqHPOHw (envelope-from ) for ; Thu, 28 Mar 2024 13:23:07 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=H5WE+9Ep; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711628587; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DbQDMf1dW4EU6+8P5QizvkP7WGOpuRyF0CrKazO0iT4=; b=Ij3UjzYPn9Vgu3JLw1Lcfj9HXG+98c+c8DD+4br+gsHIf0ReplXnRPzOMYQjE0obFaVNU6 xU3rMzL5pHA5OhyMh8JeHIU/VTb94eyOXN09GMQmU2gwCkjFIcoHhkPwyOzVgzHpe3TsrC CLRjKkA+Z1boadNXjivT7+4BciQMbMNFxSD9/9gOtDbZJx1dlILeCDToOv0OQj8ltzWMkv aPyJZXgVP4nigGkFd7yYBeznqGT5M91TsVGMhJss/LunKWfjzILaOXMw1YlS70CGhL9O2/ ag6KGButJ7s6iPPB2YApbd+0t09ZXU8iDe/DwkAkhrhv/sdKwdcNY4u549gpww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=H5WE+9Ep; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711628587; a=rsa-sha256; cv=none; b=fpeSU0SZCm6wfXhwmnkcJnzzYl1dfqiF0EB5AveaSDLtZLIF/YxW4CZUmMQIdf4Ku6Q49a qRR/JJwXAq9KZVKRuGTGX8MERME6xFKHIaCRpE1YyloDJQ0qIQbTtX48GXDy+Ad13oiQ5H ccXug5Vk38/V/32q0wFUr5Qj5v0/Pw9bLMAajHypRDKttWhHPZxOBMt9AFMwXVriuwV+bj XDl1xSjjZgshVJ9IgubpyqwkGPPaTLPl3aORpjW1u4LmadbCwStiwUKWcxBSdSzde3ore/ Vq/ZaAEv8iSB7PXqujPU+H0r1/RrsopljejcgYgfWV/wpiFY3QcJWkuJwdpulg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B96F71230C for ; Thu, 28 Mar 2024 13:23:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpolX-00022G-NU; Thu, 28 Mar 2024 08:21:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpolV-00021v-SW for emacs-orgmode@gnu.org; Thu, 28 Mar 2024 08:21:53 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpolU-0004nt-56 for emacs-orgmode@gnu.org; Thu, 28 Mar 2024 08:21:53 -0400 Received: by mail-pj1-x1041.google.com with SMTP id 98e67ed59e1d1-2a207208187so345778a91.2 for ; Thu, 28 Mar 2024 05:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711628510; x=1712233310; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=DbQDMf1dW4EU6+8P5QizvkP7WGOpuRyF0CrKazO0iT4=; b=H5WE+9EpWVyeTTqxTEmOOPDXAEjG9HlryyOPemM2OJgHBmovWzaed/wTwkEC/ARlVz 8x5D5Oafmfj9vqgf//j3k6AsNyGDEMEZ66kTphSFvaW7CZnFOnKCbgAIXa4IYv+40b3D WEEJ/Lag/ZPP9+K9rWmgPM8cbdZ3DeaQnqdrnthnr1Vfn9K2I+IZEbnKUSjtlCTezDrK KrytBfOPgH2Xv3ad6A3HBtNNfqrbxc6hhLAu1fwEwZ4i5t9HahItHYwJLQ9zqyxEovm2 tGibNEcXe/80CcsPXaBJtlavLtnuU3Peq4bmq6D9rwcR84t64R/Miive0iDFbehHG7RO HPHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711628510; x=1712233310; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DbQDMf1dW4EU6+8P5QizvkP7WGOpuRyF0CrKazO0iT4=; b=grCdwk/pBjZvRf5Z+LuV7E3EiPLFpY4UJZW2FMXfYHKrCdc41Knsvva5QfB73A/NP1 K/8glCVAxN+O9jyHCsK+AfIge6OfRE8nR5dmPKEFbyiRj1CuK9z/QlfAu87SrZpBK62h DeVCuCWM/6YQXCq0w9pcT8LEkx5XbzsUA9tJyWclNYwqt9aXUSzlgxAYsEiJTtjSH7NM n4MQ9ul82Ycmisb04GmmpYEkYHxsaE6frmHJ71IE+DPBfnhKPZ408SWkxK2mJxgTnsOS ox+Hyd6NyDaMTOTFrWkP05so71LvKYBHzvhQIC8iBDvhc3VQvNBZFFojhwUwLc1e9QIR M9BA== X-Gm-Message-State: AOJu0YwmERpcy9Pvp5+UmiDIjKSzhNUyvkcdRKNjNO2d2pxgEo6Q6Kls Twpbwd7Phxo4K328Y184+N1JLp0jDm3O+pVZHjAmmlJvWLFtlnfyXmdNmiHi47M= X-Google-Smtp-Source: AGHT+IG1v6boVu5Cc48pIlXCheMqwGFZTdRwzknvBv65MvBgsEpCAZ9gP23TsOqhCDU3AIgzT6pGtA== X-Received: by 2002:a17:90a:49ca:b0:2a0:9c16:2866 with SMTP id l10-20020a17090a49ca00b002a09c162866mr2278228pjm.33.1711628509822; Thu, 28 Mar 2024 05:21:49 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id x17-20020a17090a531100b002a0593432bbsm1233226pjh.52.2024.03.28.05.21.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 05:21:49 -0700 (PDT) From: Visuwesh To: emacs-orgmode@gnu.org Subject: [BUG] ob-calc and decimal number in :var [9.7-pre (release_9.6.17-1446-g252971 @ /home/viz/lib/emacs/straight/build/org/)] Date: Thu, 28 Mar 2024 17:51:46 +0530 Message-ID: <87edbu4kdh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1041.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.64 X-Migadu-Queue-Id: B96F71230C X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -9.64 X-TUID: /MOW3SNOCJQz Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ In emacs -Q, try evaluating the source block #+BEGIN_SRC calc :var thetarot=1.3 1/thetarot #+END_SRC and witness the following error: Debugger entered--Lisp error: (wrong-type-argument listp 1.3) nth(2 1.3) calc-div-fractions(1 1.3) math-div(1 1.3) math-mul-or-div(1 1.3 nil t) math-combine-prod(1 1.3 nil t t) math-simplify-one-divisor((1 1.3) (1.3)) math-simplify-divisor((1 1.3) (1.3) nil t) math-simplify-divide((/ 1 1.3)) #f(compiled-function (expr) #)((/ 1 1.3)) math-simplify-step((/ 1 1.3)) math-simplify((/ 1 1.3)) calc-normalize-fancy((/ 1 1.3)) calc-normalize((/ 1 1.3)) math-evaluate-expr((/ 1 1.3)) #f(compiled-function (line) #)("1/thetarot") mapc(#f(compiled-function (line) #) ("1/thetarot")) org-babel-execute:calc("1/thetarot\11" ((:var thetarot . 1.3) (:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no"))) org-babel-execute-src-block(nil ("calc" "1/thetarot\11" ((:var thetarot . 1.3) (:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) "" nil 148 "(ref:%s)")) org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil) call-interactively(org-ctrl-c-ctrl-c nil nil) command-execute(org-ctrl-c-ctrl-c) This happens because the decimal number 1.3 is not in the format calc expects. A VERY DIRTY patch to do this is diff --git a/lisp/ob-calc.el b/lisp/ob-calc.el index f36df77ff..6ef09032a 100644 --- a/lisp/ob-calc.el +++ b/lisp/ob-calc.el @@ -111,7 +116,7 @@ EL is taken from the output of `math-read-exprs'." (if (and (eq 'var (car el)) (member (cadr el) org--var-syms)) (progn (calc-recall (cadr el)) - (prog1 (calc-top 1) + (prog1 (math-read-exprs (format "%S" (calc-top 1))) (calc-pop 1))) (mapcar #'org-babel-calc-maybe-resolve-var el)) el)) but unfortunately, I don't have the time currently to polish this up. If someone doesn't beat me to it, I will send a more polished+tested patch by the beginning of May (if I get a lot of free time, I can try to make one in the meanwhile). Emacs : GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw scroll bars) of 2024-02-17 Package: Org mode version 9.7-pre (release_9.6.17-1446-g252971 @ /home/viz/lib/emacs/straight/build/org/)