emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mark Edgington <edgimar@gmail.com>
To: Mark Edgington <edgimar@gmail.com>,
	emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Arbitrary lisp functions in column-attributes
Date: Sun, 3 Nov 2013 22:09:30 -0500	[thread overview]
Message-ID: <CAMsBe8qCW5iMLLnCwnfQYR+c=frxmT+TfCPP5kZmZ5CGoWQ8+g@mail.gmail.com> (raw)
In-Reply-To: <87k3gp157z.fsf@gmail.com>

> 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 ‘identity’ 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

  reply	other threads:[~2013-11-04  3:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 16:41 Arbitrary lisp functions in column-attributes Mark Edgington
2013-10-31 17:56 ` Aaron Ecay
2013-11-01 19:47   ` Mark Edgington
2013-11-03 22:38     ` Aaron Ecay
2013-11-04  3:09       ` Mark Edgington [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-10-28 17:00 Mark Edgington
2013-11-04 12:08 ` Bastien
2013-11-04 17:56   ` Mark Edgington
2013-11-05 21:06     ` Bastien
2013-11-06  5:02       ` Mark Edgington
2013-11-06  8:20         ` Bastien

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='CAMsBe8qCW5iMLLnCwnfQYR+c=frxmT+TfCPP5kZmZ5CGoWQ8+g@mail.gmail.com' \
    --to=edgimar@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).