[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Distinguish between blank and zero in org-mode spreadsheet

From: Michael Brand
Subject: Re: [O] Distinguish between blank and zero in org-mode spreadsheet
Date: Fri, 28 Dec 2012 15:10:22 +0100

Hi all

On Sat, Dec 15, 2012 at 10:23 AM, Bastien <address@hidden> wrote:
> Michael Brand <address@hidden> writes:
>> Ok, so I thought to try myself this time. Now it looks as I am on a
>> good way with a solution. With quite some ERT for this and some more
>> of basic formulas.
> Thanks for working on this, if there is a clean solution, I'm willing
> to add it for Org 8.0.

Patch 6 of the attached patches makes it possible to write
spreadsheet Calc formulas that check for empty fields: To sum the
first two columns unless one or both empty:
$3 = if("$1" = "nan" || "$2" = "nan", string(""), $1 + $2); E

The other patches:

- patch 1: testing/README: add howto run ERT partially

- patch 2: Add ERT for table alignment within Org buffer

  The new function org-test-table-target-expect is to simplify writing
  spreadsheet ERT by providing just a target table to apply the formula
  to, the expected result table and the table formula with optionally
  additional variants. The variants typically are to check the same
  result with a Lisp formula and a Calc formula. test-org-table.el is
  also a howto example collection as a user documentation.

- patch 3: Extend org-table-number-regexp

- patch 4: Add ERTs for basic spreadsheet functionality

  My plan is to add spreadsheet examples only to Org ERT
  (test-org-table.el) from now on and someday to move those I already
  made on Worg.

- patch 5: org-table.el: Fix range len bugs and inconsistencies

  The range len bugs may lead to wrong calculations for range references
  with empty fields when the range len is relevant.  Affects typically
  Calc vmean on simple range and without format specifier EN.  Also
  Lisp with e. g. `length' on simple range or with L.

Note: Org ERT passes after every single patch to document the behavior
of each patch.

After the review is complete please make sure that “make check” passes
before applying the patches and also before git push. I hope I got it
right with the require to resolve the dependencies.


Attachment: 0001-testing-README-add-howto-run-ERT-partially.patch.txt
Description: Text document

Attachment: 0002-Add-ERT-for-table-alignment-within-Org-buffer.patch.txt
Description: Text document

Attachment: 0003-Extend-org-table-number-regexp.patch.txt
Description: Text document

Attachment: 0004-Add-ERTs-for-basic-spreadsheet-functionality.patch.txt
Description: Text document

Attachment: 0005-org-table.el-Fix-range-len-bugs-and-inconsistencies.patch.txt
Description: Text document

Attachment: 0006-Use-nan-for-empty-fields-in-Calc-formulas.patch.txt
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]