From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: Better ways to address fields in tables Date: Wed, 24 Nov 2010 23:37:06 +0900 Message-ID: <684e3350-33b7-44cc-98c7-d94d7576ea90@email.android.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=58210 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLGhD-00077a-Vk for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 09:51:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLGh9-0005L5-36 for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 09:51:43 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:41826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLGh8-0005Kq-U8 for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 09:51:39 -0500 Received: by bwz16 with SMTP id 16so11670736bwz.0 for ; Wed, 24 Nov 2010 06:51:36 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" Hi, I was wondering whether it might be possible to address table fields, which float due to adding and deletion of rows, more easily and thought about two possible ways. The way I know (are there more ways?) | | A | B| |-+---+---| | | a | 1 | | | b | 1 | |-+---+---| | | s | 2 | |^| | f | |-+---+---| many many more rows.... To calculate the sum s of all rows between a and b even if there will be more or less any time later I, use f = vsum(@I..@II-1) Rather verbose for a simple sum. Might it be possible to adress the target fields relativ to horizonal lines? @II = vsum(@I..@II-1) This would make it independend of the number of rows in the block and there would be no need to assign a name to the field. On the other hand, I often use a description beside the actual field like the "s" in the above example and in reality it might be something like "sum of all foo". Now I have to assign a name for the variable (above simply "f") or e.g., sum_foo. I am ending up having two descriptions for the same field, a human readable and an arithmetical. Marking the first one (the one contains "s") in a special way could indicate to use it as a variablename for another field. | A | B| |---+---| | a | 1 | | b | 1 | |---+---| | s\> | 2 | Whereas \> indicates: Use this string as the variable name for the field to the right. Similar, there could be \< \^ \v to assign the string to the field to the left, above or below. This method would be redundant to the original method for fields above and below but less verbose. Kind of shortcut. Greetings Torsten