From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: Property inheritance in Org-collector Date: Sat, 08 Jan 2011 14:17:27 -0700 Message-ID: <87ei8nw0vx.fsf@gmail.com> References: <4D2822F4.2020904@christianmoe.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=50905 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbgAk-0001zf-Gd for emacs-orgmode@gnu.org; Sat, 08 Jan 2011 16:18:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbgAj-0005S2-4k for emacs-orgmode@gnu.org; Sat, 08 Jan 2011 16:18:02 -0500 Received: from mail-px0-f169.google.com ([209.85.212.169]:56488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbgAi-0005Rv-T0 for emacs-orgmode@gnu.org; Sat, 08 Jan 2011 16:18:01 -0500 Received: by pxi12 with SMTP id 12so4476000pxi.0 for ; Sat, 08 Jan 2011 13:18:00 -0800 (PST) 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: "d.tchin" Cc: emacs-orgmode@gnu.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.