From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: [Bug] Formula editor (C-c ') does not parse first/last row/column specifications correctly Date: Sun, 26 Feb 2012 22:23:56 +0100 Message-ID: <87ehth5lw3.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1lZl-0007ge-23 for emacs-orgmode@gnu.org; Sun, 26 Feb 2012 16:24:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1lZj-0003uy-LV for emacs-orgmode@gnu.org; Sun, 26 Feb 2012 16:24:12 -0500 Received: from plane.gmane.org ([80.91.229.3]:47737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1lZj-0003uo-En for emacs-orgmode@gnu.org; Sun, 26 Feb 2012 16:24:11 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S1lZg-000737-Er for emacs-orgmode@gnu.org; Sun, 26 Feb 2012 22:24:08 +0100 Received: from pd9eb2640.dip.t-dialin.net ([217.235.38.64]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Feb 2012 22:24:08 +0100 Received: from Stromeko by pd9eb2640.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Feb 2012 22:24:08 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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