emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: "d.tchin" <d.tchin@voila.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: Property inheritance in Org-collector
Date: Sat, 08 Jan 2011 14:17:27 -0700	[thread overview]
Message-ID: <87ei8nw0vx.fsf@gmail.com> (raw)
In-Reply-To: loom.20110108T131445-721@post.gmane.org

Unfortunately inheritance of properties in Org-mode requires explicitly
requesting the property by name (aside from a couple of built-in
Org-mode properties e.g. CATEGORY)

I've just pushed up a change to org-collector which allows properties to
be explicitly inherited using a new :inherit keyword, this is
demonstrated in the example below.  Having to explicitly mention the
property to be inherited is not ideal, but hopefully it is sufficient.

Cheers -- Eric

* Inheritance
#+BEGIN: propview  :cols (ITEM test CATEGORY) :scope tree :inherit (test)
| "ITEM"             | "test"   | "CATEGORY"    |
|--------------------+----------+---------------|
| "Inheritance"      | 0        | "inheritence" |
| "First level"      | "appear" | "level"       |
| "Test inheritance" | "appear" | "level"       |
|--------------------+----------+---------------|
|                    |          |               |
#+END:

** First level
  :PROPERTIES:
  :test:     appear
  :CATEGORY:  level
  :COLUMNS:  %34ITEM %plats %ingredient
  :END:     

#+begin_src emacs-lisp
  (org-entry-get (point) "CATEGORY" t)
#+end_src

#+results:
: level

*** Test inheritance
The org-collector uses the org-entry-properties function to collect
properties.  Notice that this function *only* inherits some special
properties known to Org-mode
#+begin_src emacs-lisp
  (flet ((to-table (lst) (mapcar (lambda (pair) (list (car pair) (cdr pair))) lst)))
   (to-table (org-entry-properties)))
#+end_src

#+results:
| FILE     | /home/eschulte/Desktop/inheritence.org |
| BLOCKED  |                                        |
| CATEGORY | level                                  |

in such properties are mentioned explicitly in the code of
org-entry-properties, and the special function org-get-categories is
used to collect (and inherit) categories.  In fact even calling
org-entry-get inside of this subtree with inheritance explicitly set
to t is not sufficient to 

#+begin_src emacs-lisp
  (org-entry-get (point) "CATEGORY" t)
#+end_src

#+results:
: level

#+begin_src emacs-lisp
  (org-entry-get (point) "test" t)
#+end_src

#+results:
: appear

I expect to have the same behavior for CATEGORY and test properties.
If you evaluate lisp expression you will notice that inheritance seems 
to works.

  reply	other threads:[~2011-01-08 21:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-08  8:40 Property inheritance in Org-collector Christian Moe
2011-01-08 12:41 ` d.tchin
2011-01-08 21:17   ` Eric Schulte [this message]
2011-01-11 14:21     ` d.tchin

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=87ei8nw0vx.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=d.tchin@voila.fr \
    --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).