emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: <news@aleblanc.cotse.net>
To: emacs-orgmode@gnu.org
Subject: Re: SOLVED: elisp formulas in column view (without converting to tables)
Date: Sat, 14 Mar 2009 01:33:52 +0000	[thread overview]
Message-ID: <8763icj3b3.fsf@it.com> (raw)
In-Reply-To: 87sklh0z18.fsf@it.com

<news@aleblanc.cotse.net> writes:

> Hi,
>    I have rewritten the org-columns-compute function to allow elisp
>    formulas in column view.
>    It allows you to specify how to accumulate values from child headers,
>    and how to specify the value for the current header, based on other
>    columns.
>    In the column specification you place elisp code between the braces
>    {} after the column name. This elisp should return a list of 2
>    values. The first value should be the value for that header, and the second
>    value should be the running total of values so far at that level, which will
>    eventually be used to set the value for the parent header.
>
>    The following values may be referenced by your elisp code:
>
>                | $name     | the value of the 'name' column for this header (swap 'name' for whatever columns you have) |
>                | curval    | the current value for this header                                                          |
>                | curtotal  | the running total from headers at the same level as this one                               |
>                | prevtotal | the total from headers below this level                                                    |
>

I forgot to mention that curtotal will be nil if the current header is
the first header at the current level, and prevtotal will be nil if the
current header has no children. You can test for these in your elisp functions.

-- 
aleblanc

  reply	other threads:[~2009-03-14  1:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-13 23:43 SOLVED: elisp formulas in column view (without converting to tables) news
2009-03-14  1:33 ` news [this message]
2009-03-16 20:15 ` news
2009-06-09  6:26   ` Carsten Dominik

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=8763icj3b3.fsf@it.com \
    --to=news@aleblanc.cotse.net \
    --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).