emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeff Trull <edaskel@att.net>
To: emacs-orgmode@gnu.org
Subject: Formulas on table cells containing '$'
Date: Mon, 15 May 2023 14:47:47 -0700	[thread overview]
Message-ID: <CAF_DUeFAqMNG39-nTz1wxBt5qLyQTyQtT-=mW1jiz-B91Q9B9A@mail.gmail.com> (raw)
In-Reply-To: CAF_DUeFAqMNG39-nTz1wxBt5qLyQTyQtT-=mW1jiz-B91Q9B9A.ref@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

While investigating an error executing a table formula I discovered that
cells containing '$' cause column references to be executed even when no
attempt is made to evaluate cell contents as code. Here's a simple example:

#+TITLE: demonstrate strange error in currency column

| 3/1/2023  | Deposit                | $200.00 |
| 3/13/2023 | Interest               | $1.13   |
| 4/1/2023  | Deposit                | $301.22 |
|-----------+------------------------+---------|
|           | Number of Transactions |         |
#+TBLFM: @4$3='(length '(@1$3..@I$3))

Evaluating the table formula produces a 'Invalid field specifier "$200"'
message. In more complicated examples you just see a #ERROR in the cell.
With formula debugging turned on, I can evaluate the expanded expression
with no errors.

This is surprising for a number of reasons:

   1. The formula makes no use of the cell contents
   2. The formula debugger notes an error but actually shows a valid
   expression
   3. Columns with currencies will be fairly common esp in imports from
   financial institutions
   4. This error happens before the formula is evaluated so there is no
   chance to remove the problem character in the formula as I do with the
   commas ',' which are also present

Is this by design? If so, I was unable to find any documentation explaining
it.

Thanks,
Jeff

[-- Attachment #2: Type: text/html, Size: 1628 bytes --]

       reply	other threads:[~2023-05-15 21:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAF_DUeFAqMNG39-nTz1wxBt5qLyQTyQtT-=mW1jiz-B91Q9B9A.ref@mail.gmail.com>
2023-05-15 21:47 ` Jeff Trull [this message]
2023-05-18 18:55   ` Formulas on table cells containing '$' Bruno Barbier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAF_DUeFAqMNG39-nTz1wxBt5qLyQTyQtT-=mW1jiz-B91Q9B9A@mail.gmail.com' \
    --to=edaskel@att.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).