From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: Re: SOLVED: elisp formulas in column view (without converting to tables) Date: Sat, 14 Mar 2009 01:33:52 +0000 Message-ID: <8763icj3b3.fsf@it.com> References: <87sklh0z18.fsf@it.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LiIlR-0004hO-Nr for emacs-orgmode@gnu.org; Fri, 13 Mar 2009 21:34:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LiIlN-0004f0-Lc for emacs-orgmode@gnu.org; Fri, 13 Mar 2009 21:34:13 -0400 Received: from [199.232.76.173] (port=52322 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LiIlN-0004ex-IU for emacs-orgmode@gnu.org; Fri, 13 Mar 2009 21:34:09 -0400 Received: from main.gmane.org ([80.91.229.2]:45638 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LiIlN-0002oX-2h for emacs-orgmode@gnu.org; Fri, 13 Mar 2009 21:34:09 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LiIlI-0000LG-Tq for emacs-orgmode@gnu.org; Sat, 14 Mar 2009 01:34:04 +0000 Received: from 87-194-46-7.bethere.co.uk ([87.194.46.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Mar 2009 01:34:04 +0000 Received: from news by 87-194-46-7.bethere.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Mar 2009 01:34:04 +0000 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 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