From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Edgington Subject: Re: Arbitrary lisp functions in column-attributes Date: Sun, 3 Nov 2013 22:09:30 -0500 Message-ID: References: <87li19b9yy.fsf@gmail.com> <87k3gp157z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdAYE-00019B-LA for emacs-orgmode@gnu.org; Sun, 03 Nov 2013 22:10:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdAYD-0002nf-DP for emacs-orgmode@gnu.org; Sun, 03 Nov 2013 22:10:02 -0500 Received: from mail-oa0-x236.google.com ([2607:f8b0:4003:c02::236]:39786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdAYD-0002mf-8E for emacs-orgmode@gnu.org; Sun, 03 Nov 2013 22:10:01 -0500 Received: by mail-oa0-f54.google.com with SMTP id o20so6714057oag.13 for ; Sun, 03 Nov 2013 19:10:00 -0800 (PST) In-Reply-To: <87k3gp157z.fsf@gmail.com> 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: Mark Edgington , emacs-orgmode > How about using an elisp babel block, with tabular results? Something > like (tested only very lightly): > > #+BEGIN_SRC elisp :results table > (cons > (list "Header A" "Header B") > (cons 'hline > (org-map-entries > (lambda () > (list > (princ (org-entry-get (point) "FOO")) > (princ (identity (org-entry-get (point) "BAR")))))))) > #+END_SRC > > Replace =91identity=92 with your desired lisp-level processing. Hi Aaron, I think this could be useful for doing some more general processing of the properties of trees (e.g. using functions of multiple properties), but it requires more "low-level" programming than just using a COLUMNS definition. Furthermore, as far as I can tell, you would need to use something other than org-entry-get to get an entry's headline (e.g. 'ITEM' in the COLUMNS definition). If you used babel to do this, you would also not be able to (without reinventing them in elisp) use any of the special summary functions, like when you specify COLUMNS to include %MYPROP(Col Title){mean}. Also, it requires extra conditional code to limit the results to the properties of a particular subtree. With dynamic blocks, I can just specify an ID. I do like the flexibility that the babel-block method offers, but maybe this same flexibility could be offered via a different kind of column-attribute definition -- perhaps a syntax like %FUNC(Col Title){myfunc,PROP1NAME,PROP2NAME,...} (or simply omit 'FUNC') which would pass PROP1NAME and PROP2NAME to myfunc. Thoughts? Regards, Mark