emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Torsten Wagner <torsten.wagner@gmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Better ways to address fields in tables
Date: Wed, 24 Nov 2010 23:37:06 +0900	[thread overview]
Message-ID: <684e3350-33b7-44cc-98c7-d94d7576ea90@email.android.com> (raw)

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
 

                 reply	other threads:[~2010-11-24 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=684e3350-33b7-44cc-98c7-d94d7576ea90@email.android.com \
    --to=torsten.wagner@gmail.com \
    --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).