emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Yu <yu_icq@gmx.at>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Table formulas: Cannot use column names on the left hand side
Date: Thu, 16 Feb 2012 16:56:43 +0100	[thread overview]
Message-ID: <CANtbJLGsbjf9Y8w0C+FcrHWmWfrH_LBMx1-MBBoUpKgwEMc7tw@mail.gmail.com> (raw)

Hello!

I tried today to use named columns for calculations. While this works
on the right hand side of the equation, names don't seem to work for
the left hand side -- which is a problem, because a change in column
arrangement, that isn't caused by org functions (e.g. manually
inserting a column with rectangle-copying) may cause an input column
to be overwritten accidentially (e.g. having a formula $4=$3*$2+$1 and
then manually inserting a column for line markers as described in
"Advanced Features").

Exactly this happened to me recently, forcing me to redo some by-hand
evaluation.

Here some examples to clarify the problem:

-----------------------------------------------------------------------------

Recalculation attempts done each with C-u C-c C-c in the table and
with C-c C-c in the formula line, and with C-u C-c *.

Works fine:
|   a |   b | a+b |
|-----+-----+-----|
| 1.0 | 1.0 | 2.0 |
| 1.5 | 0.5 | 2.0 |
| 0.5 | 0.0 | 0.5 |
#+TBLFM: $3=$1+$2;%.1f

Doesn't Work:
|   |   a |   b | a+b |
|---+-----+-----+-----|
|   | 1.0 | 1.0 |     |
|   | 1.5 | 0.5 |     |
|   | 0.5 | 0.0 |     |
| ! |   a |   b | ab  |
#+TBLFM: $ab=$a+$b

Doesn't Work:
|   |   a |   b | a+b |
|---+-----+-----+-----|
|   | 1.0 | 1.0 |     |
|   | 1.5 | 0.5 |     |
|   | 0.5 | 0.0 |     |
| ! |   a |   b | ab  |
#+TBLFM: $4=$a+$b

Even this doesn't work
|   |   a |   b | a+b |
|---+-----+-----+-----|
|   | 1.0 | 1.0 |     |
|   | 1.5 | 0.5 |     |
|   | 0.5 | 0.0 |     |
| ! |   a |   b | ab  |
#+TBLFM: $4=$2+$3

This works again; This is sort of consistent with the specification,
that "Unmarked lines are exempt from recalculation with C-u C-c *",
but there was no mention, that it affects other methods of causing
recalculation too in `(info "(org)")'.
|   |   a |   b | a+b |
|---+-----+-----+-----|
| * | 1.0 | 1.0 |  2. |
| * | 1.5 | 0.5 |  2. |
| * | 0.5 | 0.0 | 0.5 |
| ! |   a |   b |  ab |
#+TBLFM: $4=$2+$3

This again does NOT work.
|   |   a |   b | a+b |
|---+-----+-----+-----|
| * | 1.0 | 1.0 |     |
| * | 1.5 | 0.5 |     |
| * | 0.5 | 0.0 |     |
| ! |   a |   b | ab  |
#+TBLFM: $ab=$2+$3

Works again.
|   |   a |   b | a+b |
|---+-----+-----+-----|
| * | 1.0 | 1.0 |  2. |
| * | 1.5 | 0.5 |  2. |
| * | 0.5 | 0.0 | 0.5 |
| ! |   a |   b |  ab |
#+TBLFM: $4=$a+$b

             reply	other threads:[~2012-02-16 15:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 15:56 Yu [this message]
2012-02-16 16:52 ` Table formulas: Cannot use column names on the left hand side Michael Brand

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=CANtbJLGsbjf9Y8w0C+FcrHWmWfrH_LBMx1-MBBoUpKgwEMc7tw@mail.gmail.com \
    --to=yu_icq@gmx.at \
    --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).