From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oD1oHqHmjl8pPwAA0tVLHw (envelope-from ) for ; Tue, 20 Oct 2020 13:31:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YPFIGqHmjl9NWgAA1q6Kng (envelope-from ) for ; Tue, 20 Oct 2020 13:31:13 +0000 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 77CA994014A for ; Tue, 20 Oct 2020 13:31:12 +0000 (UTC) Received: from localhost ([::1]:39114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUrjL-00045O-1V for larch@yhetil.org; Tue, 20 Oct 2020 09:31:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUriJ-00044H-2Z for emacs-orgmode@gnu.org; Tue, 20 Oct 2020 09:30:07 -0400 Received: from grinta.net ([109.74.203.128]:45184) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUriG-0000uc-0C for emacs-orgmode@gnu.org; Tue, 20 Oct 2020 09:30:06 -0400 Received: from black.local (unknown [46.165.233.56]) (Authenticated sender: daniele) by grinta.net (Postfix) with ESMTPSA id 11BFCED23C for ; Tue, 20 Oct 2020 13:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=2020; t=1603200602; bh=wdVgWMLMvQuE8SqB6H3F/LgbxRcLrvAVC8xEChnOI+E=; h=Subject:To:References:From:Date:In-Reply-To:From; b=YML+rsQe1RX1jxSjHUrE3W9JgNFeMkVIDnEjDX7xeXZU21mY7+/U5n73zAB0AzT8u 3TCMJM5wSrJCui5qyNsRfAcAs9KuLrmT21iQz8huoe6zw9N1SxfXTbrwykuHMg+BRj /flzwhEJM4lJ/1qg6VLTBXYKTrbWIPM6AvIendJqA7cgmej7U4JVm7PWGXkDxwzRpC Xzgf2HO1xGoEXdMYRLSsCSsivc4qsyMtIyWp4IG4kMjIArm2EYQrAq8jozde4CiLHC cMa+8xsSwlh9R9r/9YTAQSlTHytSv9y74YH446T/6uo2eq6GbdwKTHkqmVhnFkJvw9 UB+Q+I9QZlXjQ== Subject: [PATCH] org-table: Add mode flag to enable Calc units simplification mode To: emacs-orgmode@gnu.org References: <6d8c15c2-d1b0-d913-df39-c60381cff70b@grinta.net> From: Daniele Nicolodi Message-ID: <33143b05-a298-8277-313b-3a1deb69ad27@grinta.net> Date: Tue, 20 Oct 2020 15:30:00 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <6d8c15c2-d1b0-d913-df39-c60381cff70b@grinta.net> Content-Type: multipart/mixed; boundary="------------ECE6163D0E4A08A1D8C0CEB8" Content-Language: en-US Received-SPF: pass client-ip=109.74.203.128; envelope-from=daniele@grinta.net; helo=grinta.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/20 09:30:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, SPF_HELO_PASS=-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.23 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=grinta.net header.s=2020 header.b=YML+rsQe; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 2.09 X-TUID: 198wlM91HQCJ This is a multi-part message in MIME format. --------------ECE6163D0E4A08A1D8C0CEB8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hello, attached there are a few patches reworking the code, fixing the bug, and introducing a new mode flag to enable Calc's units simplification mode as discussed in a recent thread on the mailing list. I haven't updated the documentation. I can do it once we agree that this feature is a good idea. Cheers, Dan On 19/10/2020 17:38, Daniele Nicolodi wrote: > Hello, > > I am hacking org-table-eval-formula (see thread about monetary values in > org-tables) which uses this inline function: > > (defsubst org-table--set-calc-mode (var &optional value) > (if (stringp var) > (setq var (assoc var '(("D" calc-angle-mode deg) > ("R" calc-angle-mode rad) > ("F" calc-prefer-frac t) > ("S" calc-symbolic-mode t))) > value (nth 2 var) var (nth 1 var))) > (if (memq var org-tbl-calc-modes) > (setcar (cdr (memq var org-tbl-calc-modes)) value) > (cons var (cons value org-tbl-calc-modes))) > org-tbl-calc-modes) > > which I am not able to understand or which is not correct. > > The first (if ...) does some value substitutions, however, IIUC the > second (if ...) sets a new value for an entry in the org-tbl-calc-modes > plist if the entry is already present and builds a new plist with the > entry prepended if the entry is not there. However, the original plist > is returned and not the one with the new entry prepended. > > It does not seem to be the intended behavior. > > Shouldn't this be simply: > > (defsubst org-table--set-calc-mode (var &optional value) > (if (stringp var) > (setq var (assoc var '(("D" calc-angle-mode deg) > ("R" calc-angle-mode rad) > ("F" calc-prefer-frac t) > ("S" calc-symbolic-mode t))) > value (nth 2 var) var (nth 1 var))) > (plist-put org-tbl-calc-modes var value)) > > or, better, the code refactored to do not use this function? > > Cheers, > Dan > --------------ECE6163D0E4A08A1D8C0CEB8 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="0001-org-table-Fix-table-formula-mode-string-handling.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-org-table-Fix-table-formula-mode-string-handling.patch" RnJvbSBjNzQzNDk3NDg5N2Q5MzJmZTNhY2QxODJmMDZhOThhNjE3MTllMjA4IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBEYW5pZWxlIE5pY29sb2RpIDxkYW5pZWxlQGdyaW50 YS5uZXQ+CkRhdGU6IFR1ZSwgMjAgT2N0IDIwMjAgMTE6MDM6MTQgKzAyMDAKU3ViamVjdDog W1BBVENIIDEvM10gb3JnLXRhYmxlOiBGaXggdGFibGUgZm9ybXVsYSBtb2RlIHN0cmluZyBo YW5kbGluZwoKKiBsaXNwL29yZy10YWJsZS5lbCAob3JnLXRhYmxlLWV2YWwtZm9ybXVsYSk6 IE1vdmUgbW9kZSBsb29rdXAgdGFibGUKZnJvbSBvcmctdGFibGUtLXNldC1jYWxjLW1vZGUg dG8gaGVyZS4KCiogbGlzcC9vcmctdGFibGUuZWwgKG9yZy10YWJsZS0tc2V0LWNhbGMtbW9k ZSk6IFVzZSBwbGlzdC1wdXQgaW5zdGVhZApvZiB0aGUgYnVnZ3kgb3BlbiBjb2RlZCB2ZXJz aW9uLgotLS0KIGxpc3Avb3JnLXRhYmxlLmVsIHwgMjQgKysrKysrKysrKy0tLS0tLS0tLS0t LS0tCiAxIGZpbGUgY2hhbmdlZCwgMTAgaW5zZXJ0aW9ucygrKSwgMTQgZGVsZXRpb25zKC0p CgpkaWZmIC0tZ2l0IGEvbGlzcC9vcmctdGFibGUuZWwgYi9saXNwL29yZy10YWJsZS5lbApp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G9j YXRpb24gb2YgcG9pbnQuIgogCQkoc2V0cSBrZWVwLWVtcHR5IHQKIAkJICAgICAgZm10IChy ZXBsYWNlLW1hdGNoICIiIHQgdCBmbXQpKSkKIAkgICAgKHdoaWxlIChzdHJpbmctbWF0Y2gg IltEUkZTXSIgZm10KQotCSAgICAgIChzZXRxIG9yZy10YmwtY2FsYy1tb2RlcwotCQkgICAg KG9yZy10YWJsZS0tc2V0LWNhbGMtbW9kZSAobWF0Y2gtc3RyaW5nIDAgZm10KSkpCi0JICAg ICAgKHNldHEgZm10IChyZXBsYWNlLW1hdGNoICIiIHQgdCBmbXQpKSkKKwkgICAgICAobGV0 KiAoKGMgKHN0cmluZy10by1jaGFyIChtYXRjaC1zdHJpbmcgMCBmbXQpKSkKKwkJICAgICAo bW9kZSAoY2RyIChhc3NvYyBjICcoKD9EIGNhbGMtYW5nbGUtbW9kZSBkZWcpCisJCQkJCSAg ICg/UiBjYWxjLWFuZ2xlLW1vZGUgcmFkKQorCQkJCQkgICAoP0YgY2FsYy1wcmVmZXItZnJh YyB0KQorCQkJCQkgICAoP1MgY2FsYy1zeW1ib2xpYy1tb2RlIHQpKSkpKSkKKwkJKHNldHEg b3JnLXRibC1jYWxjLW1vZGVzIChvcmctdGFibGUtLXNldC1jYWxjLW1vZGUKKwkJCQkJICAo Y2FyIG1vZGUpIChjYWRyIG1vZGUpKQorCQkgICAgICBmbXQgKHJlcGxhY2UtbWF0Y2ggIiIg dCB0IGZtdCkpKSkKIAkgICAgKHVubGVzcyAoc3RyaW5nLW1hdGNoICJcXFMtIiBmbXQpCiAJ ICAgICAgKHNldHEgZm10IG5pbCkpKSkKICAgICAgICh3aGVuIChhbmQgKG5vdCBzdXBwcmVz cy1jb25zdCkgb3JnLXRhYmxlLWZvcm11bGEtdXNlLWNvbnN0YW50cykKLS0gCjIuMjguMAoK --------------ECE6163D0E4A08A1D8C0CEB8 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="0003-org-table-Add-mode-flag-to-enable-Calc-units-simplif.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0003-org-table-Add-mode-flag-to-enable-Calc-units-simplif.pa"; filename*1="tch" RnJvbSBhYWQ4ZWI1NDhlN2E3YTdmZGUxOTA4YTlmOWM2NmY5ODBkYTEwYjU2IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBEYW5pZWxlIE5pY29sb2RpIDxkYW5pZWxlQGdyaW50 YS5uZXQ+CkRhdGU6IFR1ZSwgMjAgT2N0IDIwMjAgMTU6MjI6MDIgKzAyMDAKU3ViamVjdDog W1BBVENIIDMvM10gb3JnLXRhYmxlOiBBZGQgbW9kZSBmbGFnIHRvIGVuYWJsZSBDYWxjIHVu aXRzCiBzaW1wbGlmaWNhdGlvbiBtb2RlCgoqIG9yZy10YWJsZS5lbCAob3JnLXRhYmxlLWV2 YWwtZm9ybXVsYSk6IEFkZCB0aGUgYHVgIG1vZGUgZmxhZyB0bwplbmFibGUgQ2FsYydzIHVu aXRzIHNpbXBsaWZpY2F0aW9uIG1vZGUuCi0tLQogbGlzcC9vcmctdGFibGUuZWwgfCAzICsr LQogMSBmaWxlIGNoYW5nZWQsIDIgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQoKZGlm ZiAtLWdpdCBhL2xpc3Avb3JnLXRhYmxlLmVsIGIvbGlzcC9vcmctdGFibGUuZWwKaW5kZXgg NGJhYWQyNjAwLi42YjkyNjU2YmQgMTAwNjQ0Ci0tLSBhL2xpc3Avb3JnLXRhYmxlLmVsCisr KyBiL2xpc3Avb3JnLXRhYmxlLmVsCkBAIC0yNDQ3LDExICsyNDQ3LDEyIEBAIGxvY2F0aW9u IG9mIHBvaW50LiIKIAkJICAoP2UgKG9yZy10YWJsZS0tc2V0LWNhbGMtbW9kZSAnY2FsYy1m bG9hdC1mb3JtYXQgKGxpc3QgJ2VuZyBuKSkpKSkKIAkgICAgICA7OyBSZW1vdmUgbWF0Y2hl ZCBmbGFncyBmcm9tIHRoZSBtb2RlIHN0cmluZy4KIAkgICAgICAoc2V0cSBmbXQgKHJlcGxh Y2UtbWF0Y2ggIiIgdCB0IGZtdCkpKQotCSAgICAod2hpbGUgKHN0cmluZy1tYXRjaCAiXFwo W3RUVU5MRURSRlNdXFwpIiBmbXQpCisJICAgICh3aGlsZSAoc3RyaW5nLW1hdGNoICJcXChb dHVUVU5MRURSRlNdXFwpIiBmbXQpCiAJICAgICAgKGxldCAoKGMgKHN0cmluZy10by1jaGFy IChtYXRjaC1zdHJpbmcgMSBmbXQpKSkpCiAJCShjbC1jYXNlIGMKIAkJICAoP3QgKHNldHEg ZHVyYXRpb24gdCBudW1iZXJzIHQKIAkJICAgICAgCSAgICBkdXJhdGlvbi1vdXRwdXQtZm9y bWF0IG9yZy10YWJsZS1kdXJhdGlvbi1jdXN0b20tZm9ybWF0KSkKKwkJICAoP3UgKG9yZy10 YWJsZS0tc2V0LWNhbGMtbW9kZSAnY2FsYy1zaW1wbGlmeS1tb2RlICd1bml0cykpCiAJCSAg KD9UIChzZXRxIGR1cmF0aW9uIHQgbnVtYmVycyB0IGR1cmF0aW9uLW91dHB1dC1mb3JtYXQg bmlsKSkKIAkJICAoP1UgKHNldHEgZHVyYXRpb24gdCBudW1iZXJzIHQgZHVyYXRpb24tb3V0 cHV0LWZvcm1hdCAnaGg6bW0pKQogCQkgICg/TiAoc2V0cSBudW1iZXJzIHQpKQotLSAKMi4y OC4wCgo= --------------ECE6163D0E4A08A1D8C0CEB8 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="0002-org-table-Simplify-mode-string-parsing.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0002-org-table-Simplify-mode-string-parsing.patch" RnJvbSBmYjhiNjJlNWZhYWJjYTJiNmM2NTE0ZTI1YmQzMDZmN2E1ZTg2OTZmIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBEYW5pZWxlIE5pY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