emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: [Bug] Formula editor (C-c ') does not parse first/last row/column specifications correctly
Date: Sun, 26 Feb 2012 22:23:56 +0100	[thread overview]
Message-ID: <87ehth5lw3.fsf@Rainer.invalid> (raw)


Consider the following org table

| Component                  |  Price |  Var-1 |  Var-2 |  Var-3 |  Var-4 |
|----------------------------+--------+--------+--------+--------+--------|
| CPU A                      | 119.90 |      1 |      1 |        |        |
| CPU B                      | 189.90 |        |        |      1 |      1 |
|----------------------------+--------+--------+--------+--------+--------|
| boxed                      |        |      1 |        |      1 |        |
| Fan A                      |  22.99 |        |      1 |        |      1 |
|----------------------------+--------+--------+--------+--------+--------|
| Mainboard A                |  47.90 |      1 |        |      1 |        |
| Mainboard B                |  97.99 |        |      1 |        |      1 |
|----------------------------+--------+--------+--------+--------+--------|
| integrated                 |        |      1 |        |      1 |        |
| Graphics A                 |  59.90 |        |      1 |        |      1 |
|----------------------------+--------+--------+--------+--------+--------|
| Case A                     |  29.99 |      1 |        |      1 |        |
| Case B                     |  39.99 |        |      1 |        |      1 |
|----------------------------+--------+--------+--------+--------+--------|
| PSU A                      |  29.99 |      1 |      1 |        |        |
| PSU B                      |  38.99 |        |        |      1 |      1 |
|----------------------------+--------+--------+--------+--------+--------|
| CPU/Fan/Mainboard/Graphics |        | 167.80 | 300.78 | 237.80 | 370.78 |
| Case/PSU                   |        |  59.98 |  69.98 |  68.98 |  78.98 |
|----------------------------+--------+--------+--------+--------+--------|
| Sum                        |        | 227.78 | 370.76 | 306.78 | 449.76 |
#+TBLFM: @>>>$<<<..@>>>$>=vsum(@I..-III * @I$<<..@-III$<<);%.2fEN::@>>$<<<..@>>$>=vsum(@-III..-I * @-III$<<..@-I$<<);%.2fEN::@>$<<<..@>$>=vsum(@-II..@-I);%.2f

Replace with these formulas for the second test:
#+TBLFM: @14$3..@14$6=vsum(@I..-III * @I$2..@-III$2);%.2fEN::@15$3..@15$6=vsum(@-III..-I * @-III$2..@-I$2);%.2fEN::@16$3..@16$6=vsum(@-II..@-I);%.2f


Enter the formula editor:

- row and column specifications relative to the beginning or end of the
  table (e.g. @>>$<<<) are not taken into account when showing the table
  highlight, in fact they seem to break parsing as the highlight in the
  table editor stops prematurely.

- range specifications relative to the target cell (e.g. @I$<<..-III$<<)
  produce highlights that are spanning the wrong fields.  It seems that
  they are always counting from the last line up.  Also check with the
  second TBLFM line.



Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

             reply	other threads:[~2012-02-26 21:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-26 21:23 Achim Gratz [this message]
2012-03-05 19:29 ` [Bug] Formula editor (C-c ') does not parse first/last row/column specifications correctly Achim Gratz

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=87ehth5lw3.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --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).