Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-24 Thread Christian Moe
Great! Thanks for following through on this, Dan! Yours, Christian Kyle Meyer writes: > Daniele Nicolodi writes: > >> Thank you for the review, Kyle. >> >> Another updated patch set is attached. > > Thank you for the update. > > Applied, tweaking the manual entry to use "a unit" rather than "a

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-24 Thread Kyle Meyer
Daniele Nicolodi writes: > Thank you for the review, Kyle. > > Another updated patch set is attached. Thank you for the update. Applied, tweaking the manual entry to use "a unit" rather than "an unit". 1: bd7e16ca2 = 1: bd7e16ca2 org-table: Remove unused org-tbl-calc-modes variable declarati

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-24 Thread Daniele Nicolodi
Thank you for the review, Kyle. Another updated patch set is attached. Cheers, Dan On 24/11/2020 06:35, Kyle Meyer wrote: > Daniele Nicolodi writes: > >> Subject: [PATCH 1/3] org-table: Remove unused org-tbl-calc-modes variable >> declaration > > Looks good. > >> Subject: [PATCH 2/3] org-ta

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-23 Thread Kyle Meyer
Daniele Nicolodi writes: > Subject: [PATCH 1/3] org-table: Remove unused org-tbl-calc-modes variable > declaration Looks good. > Subject: [PATCH 2/3] org-table: Simplify mode string parsing > and reduce scope of local variables. [...] > - (if (string-match ";" formula) > - (let ((tmp

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-23 Thread Daniele Nicolodi
An updated patch series is attached. Thank you. Cheers, Dan From d2ab4d06e19620c0347425861e4534cde8656543 Mon Sep 17 00:00:00 2001 From: Daniele Nicolodi Date: Mon, 23 Nov 2020 23:44:51 +0100 Subject: [PATCH 1/3] org-table: Remove unused org-tbl-calc-modes variable declaration * org-table.el (

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-23 Thread Daniele Nicolodi
On 23/11/2020 23:25, Kyle Meyer wrote: > Daniele Nicolodi writes: > >> On 23/11/2020 04:14, Kyle Meyer wrote: >>> You already mentioned that you plan to add documentation. It'd also be >>> good to add a test to test-org-table.el and a NEWS entry. >> >> By the way, have you seen my other patch wit

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-23 Thread Kyle Meyer
Daniele Nicolodi writes: > On 23/11/2020 04:14, Kyle Meyer wrote: >> Daniele Nicolodi writes: [...] >>> diff --git a/lisp/org-table.el b/lisp/org-table.el >>> index 4baad2600..6b92656bd 100644 >>> --- a/lisp/org-table.el >>> +++ b/lisp/org-table.el >>> @@ -2447,11 +2447,12 @@ location of point." >

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-23 Thread Kyle Meyer
Daniele Nicolodi writes: > On 23/11/2020 04:14, Kyle Meyer wrote: >> You already mentioned that you plan to add documentation. It'd also be >> good to add a test to test-org-table.el and a NEWS entry. > > By the way, have you seen my other patch with some documentation updates > for Org tables?

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-23 Thread Daniele Nicolodi
On 23/11/2020 04:14, Kyle Meyer wrote: > You already mentioned that you plan to add documentation. It'd also be > good to add a test to test-org-table.el and a NEWS entry. By the way, have you seen my other patch with some documentation updates for Org tables? Cheers, Dan

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-23 Thread Daniele Nicolodi
Hello Kyle, thank you for the review. It is much appreciated as lisp (and Emacs lisp in particular) is not the language I am most fluent in. On 23/11/2020 04:14, Kyle Meyer wrote: > Daniele Nicolodi writes: > >> Subject: [PATCH 1/4] org-table: Fix table formula mode string handling >> >> * lisp/

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-22 Thread Kyle Meyer
Daniele Nicolodi writes: > Subject: [PATCH 1/4] org-table: Fix table formula mode string handling > > * lisp/org-table.el (org-table-eval-formula): Move mode lookup table > from org-table--set-calc-mode to here. > > * lisp/org-table.el (org-table--set-calc-mode): Use plist-put instead > of the bug

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-19 Thread Daniele Nicolodi
On 19/11/2020 06:58, Kyle Meyer wrote: > Daniele Nicolodi writes: > >> Hello, >> >> I don't think this is what is holding up review of these patches, but, I >> recently completed the paperwork for copyright assignment to the FSF. > > Thanks for this series (and thanks to Eric for the feedback in

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-18 Thread Kyle Meyer
Daniele Nicolodi writes: > Hello, > > I don't think this is what is holding up review of these patches, but, I > recently completed the paperwork for copyright assignment to the FSF. Thanks for this series (and thanks to Eric for the feedback in the previous thread). I'm sorry for the slow respo

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-11-07 Thread Daniele Nicolodi
Hello, I don't think this is what is holding up review of these patches, but, I recently completed the paperwork for copyright assignment to the FSF. Cheers, Dan On 24/10/2020 17:33, Daniele Nicolodi wrote: > Hello, > > attached there are a few patches reworking the parsing of org-table > form

[PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-24 Thread Daniele Nicolodi
Hello, attached there are a few patches reworking the parsing of org-table formula mode strings 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 f

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-21 Thread Daniele Nicolodi
Hello, after working on this I realized that the org-tbl-calc-modes variables is used only locally despite being declare globally. Maybe a remnant from pre-lexical-binding times. Attached is a patch (on top of the others one in this thread) that simplifies things a little. Cheers, Dan On 20/10/

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Eric S Fraga
On Tuesday, 20 Oct 2020 at 16:32, Daniele Nicolodi wrote: > This may be because the org substitutes a "0" for the missing value, > thus an integer. This makes sense. Thank you. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-61-ga88806.dirty

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Eric S Fraga
On Tuesday, 20 Oct 2020 at 16:53, Daniele Nicolodi wrote: > There are other funny Calc behaviors: if an expression results in a > number with an unit where the numerical part is exactly 1, the printed > result looses the numerical part and only the units are printed. Yes, this I'm used to (and it

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Daniele Nicolodi
On 20/10/2020 16:32, Daniele Nicolodi wrote: > On 20/10/2020 16:19, Eric S Fraga wrote: >> Hello again, >> >> Following up on myself. I'm seeing some strange behaviour although unit >> calculations are working nicely. For instance, this table: >> >> #+begin_src org >> | stream | a

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Daniele Nicolodi
On 20/10/2020 16:19, Eric S Fraga wrote: > Hello again, > > Following up on myself. I'm seeing some strange behaviour although unit > calculations are working nicely. For instance, this table: > > #+begin_src org > | stream | a| b| c| total| >

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Eric S Fraga
On Tuesday, 20 Oct 2020 at 16:00, Daniele Nicolodi wrote: > To cover the use case of monetary quantities discussed in the other > thread I would like to also add an `m?` (or M?) flag that can combine > the effect of the existing `f?` flag and the new `u` flag. But I don't > know if sparing one char

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Eric S Fraga
Hello again, Following up on myself. I'm seeing some strange behaviour although unit calculations are working nicely. For instance, this table: #+begin_src org | stream | a| b| c| total| x_a | x_b | x_c | | | |

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Daniele Nicolodi
On 20/10/2020 15:44, Eric S Fraga wrote: > Just to say that I have done a quick test with this and I really like > it. Simple calculations with units of mol/s and mol/min work perfectly. Thank you for testing Eric. To cover the use case of monetary quantities discussed in the other thread I woul

Re: [PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Eric S Fraga
Just to say that I have done a quick test with this and I really like it. Simple calculations with units of mol/s and mol/min work perfectly. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-61-ga88806.dirty

[PATCH] org-table: Add mode flag to enable Calc units simplification mode

2020-10-20 Thread Daniele Nicolodi
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 i