From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [PATCH 2/8] ox-taskjuggler.el: factor 'org-export-map-special-nodes' Date: Thu, 12 Nov 2015 17:42:51 +0100 Message-ID: <87ziyjjhis.fsf@gmx.us> References: <8737wen6gr.fsf@feelingofgreen.ru> <87y4e6lrs9.fsf@feelingofgreen.ru> <87twoulrqy.fsf_-_@feelingofgreen.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwuxz-0004Cf-HG for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 11:43:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwuxv-0002rq-FH for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 11:43:19 -0500 Received: from plane.gmane.org ([80.91.229.3]:56431) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwuxv-0002rf-8o for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 11:43:15 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zwuxt-0006Zz-6t for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 17:43:13 +0100 Received: from 62.80.108.11 ([62.80.108.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2015 17:43:13 +0100 Received: from rasmus by 62.80.108.11 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2015 17:43:13 +0100 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@gnu.org Kosyrev Serge <_deepfire@feelingofgreen.ru> writes: > * ox-taskjuggler.el (org-taskjuggler-map-special-nodes): > new function to capture mapping over tagged special nodes. > (org-taskjuggler-project-plan): factor to use the new function. > ;;; Translator Functions > +(defun org-taskjuggler-map-special-nodes (tag tree f) > + (org-element-map tree 'headline > + (lambda (hl) > + (and (member tag (org-export-get-tags hl info)) Should it look care about case? Otherwise member-ignore-case. > + (funcall f hl))) > + info nil 'headline)) > (defun org-taskjuggler-project-plan (contents info) > "Build TaskJuggler project plan. > @@ -647,13 +653,10 @@ Return complete project plan as a string in TaskJuggler syntax." > ;; `org-taskjuggler-resource-tag'. Only gather top level > ;; resources. > (apply 'append > - (org-element-map tree 'headline > - (lambda (hl) > - (and (member org-taskjuggler-resource-tag > - (org-export-get-tags hl info)) > - (org-element-map (org-element-contents hl) 'headline > - 'identity info nil 'headline))) > - info nil 'headline)))) > + (org-taskjuggler-map-special-nodes > + org-taskjuggler-resource-tag tree > + (lambda (hl) (org-element-map (org-element-contents hl) 'headline > + 'identity info nil 'headline)))))) Do you need org-taskjuggler-map-special-nodes elsewhere (sorry, I can’t keep all of your patches in mind at the same time)? Rasmus -- ツ