[Top][All Lists]

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

Specification for org-table formula mode string

From: Daniele Nicolodi
Subject: Specification for org-table formula mode string
Date: Mon, 19 Oct 2020 23:54:52 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.1


I am looking at the parsing of org-table formula mode strings and I find
it quite confusing and I have an hard time understanding if it works the
way it does by design or by accident.

Formula mode strings are documented here


but the specification is not very strict and the parser implements
surprising behaviors. Would it make sense to tighten the specification
and the implementation?

I think being a bit more strict is what is accepted would help catching
typos and mistakes, but I am not sure that having formulas resulting in
#ERROR upon an org-mode upgrade is desirable. Also, maybe a specific
marker (#INVALID ?) should be used for invalid syntax.

The main problem with the current parsing code is that any character
that is not recognized as a valid mode flag is used as a value format
string. For example:

| 1 | 2 | OO3.000 |
#+TBLFM: $3=$1+$2;FOO%.3f

Is this by design? If so, what is the use case?

Thus is slightly more surprising:

| 1 | 2 | 3.000 OO |
#+TBLFM: $3=$1+$2;%.3f FOO

I argue the first form should result in an error. The second can either
result in an error or in everything following the % sign to be used as a
format string, although I am not sure there is a clear use case for this.

Thank you.


reply via email to

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