From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Girard Subject: Re: [PATCH] Allow org-collector to display heading indentation Date: Fri, 30 Mar 2012 22:55:27 +0200 Message-ID: References: <4466.1333137165@alphaville> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDirQ-0006BO-3S for emacs-orgmode@gnu.org; Fri, 30 Mar 2012 16:55:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDirO-00054Y-4i for emacs-orgmode@gnu.org; Fri, 30 Mar 2012 16:55:51 -0400 Received: from mail-vx0-f169.google.com ([209.85.220.169]:35737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDirN-00054M-Tx for emacs-orgmode@gnu.org; Fri, 30 Mar 2012 16:55:50 -0400 Received: by vcbfk14 with SMTP id fk14so821984vcb.0 for ; Fri, 30 Mar 2012 13:55:48 -0700 (PDT) In-Reply-To: <4466.1333137165@alphaville> 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: emacs-orgmode >From eaf9e5f06279069ed1072425fd020d8f0442d04f Mon Sep 17 00:00:00 2001 From: Nicolas Girard Date: Fri, 30 Mar 2012 22:53:13 +0200 Subject: [PATCH] Allow org-collector to display heading indentation --- contrib/lisp/org-collector.el | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/contrib/lisp/org-collector.el b/contrib/lisp/org-collector.el index da612e9..2476d62 100644 --- a/contrib/lisp/org-collector.el +++ b/contrib/lisp/org-collector.el @@ -121,6 +121,7 @@ preceeding the dblock, then update the contents of the dblock." (scope (plist-get params :scope)) (noquote (plist-get params :noquote)) (colnames (plist-get params :colnames)) + (indent (plist-get params :indent)) (content-lines (org-split-string (plist-get params :content) "\n")) id table line pos) (save-excursion @@ -135,7 +136,7 @@ preceeding the dblock, then update the contents of the dblock." (setq stringformat (if noquote "%s" "%S")) (setq table (org-propview-to-table (org-propview-collect cols stringformat conds match scope inherit - (if colnames colnames cols)) stringformat)) + (if colnames colnames cols) indent) stringformat)) (widen)) (setq pos (point)) (when content-lines @@ -171,13 +172,18 @@ variables and values specified in props" (when p (cons n p)))) inherit)))) -(defun org-propview-collect (cols stringformat &optional conds match scope inherit colnames) +(defun org-propview-collect (cols stringformat &optional conds match scope inherit colnames indent) (interactive) ;; collect the properties from every header (let* ((header-props (let ((org-trust-scanner-tags t) alst) (org-map-entries - (quote (cons (cons "ITEM" (org-get-heading t)) + (quote (cons (cons "ITEM" + (let ((item (org-get-heading t)) + (level (- (org-current-level) 1))) + (if (and indent (> level 0)) + (format "\\%s %s" + (make-string level ?- ) item) item))) (org-propview-get-with-inherited inherit))) match scope))) ;; read property values -- 1.7.8.rc1