Re: [O] [Bug] Formula editor (C-c ') does not parse first/last row/column specifications correctly

2012-03-05 Thread Achim Gratz
Achim Gratz strom...@nexgo.de writes:
 Consider the following org table
[...]

I've had a look in org-table.el, I pity the person who'll have to
correct this... there are several stored and literal regex occurences
that are interacting in various ways to produce this.  I have found a
few literal regex occurences that are related to the formula editor
highlighting (but changing them broke other stuff), but I have
absolutely no idea how to correct the highlight into the table.


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

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




[O] [Bug] Formula editor (C-c ') does not parse first/last row/column specifications correctly

2012-02-26 Thread Achim Gratz

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