From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ed Hirgelt" Subject: Problem with org-publish-get-plists Date: Fri, 25 Aug 2006 10:58:11 -0700 Message-ID: <44d0d9630608251058s4e61f9c7mfec5b01389367630@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GGfwb-0005Xf-Qn for emacs-orgmode@gnu.org; Fri, 25 Aug 2006 13:58:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GGfwa-0005XQ-Ur for emacs-orgmode@gnu.org; Fri, 25 Aug 2006 13:58:13 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGfwa-0005XN-P0 for emacs-orgmode@gnu.org; Fri, 25 Aug 2006 13:58:12 -0400 Received: from [64.233.166.182] (helo=py-out-1112.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GGg4v-0007uE-19 for emacs-orgmode@gnu.org; Fri, 25 Aug 2006 14:06:49 -0400 Received: by py-out-1112.google.com with SMTP id d42so1012428pyd for ; Fri, 25 Aug 2006 10:58:11 -0700 (PDT) Content-Disposition: inline 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: emacs-orgmode@gnu.org I was having problems publishing with 2 projects in the project list. I tracked it down to the org-publish-files hash table. All the files from both projects were mapped to the same project, the last one. This was caused by org-publish-get-plists. Below is the modified version that seems to work nicely for me. The trick as that plists was getting appended to each time through the loop which is great for the return value, but the loop over the content of plists assumed that project applied to all. This change uses single to be the current element in plists. The return value remains the same. Hope this helps. Thanks, Ed ----------------------------------------------------------------- (defun org-publish-get-plists (&optional project-name) "Return a list of property lists for project PROJECT-NAME. When argument is not given, return all property lists for all projects." (let ((alist (if project-name (list (assoc project-name org-publish-project-alist)) org-publish-project-alist)) (project nil) (plists nil) (single nil) (components nil)) ;; ;; (while (setq project (pop alist)) ;; what kind of project is it? (if (setq components (plist-get (cdr project) :components)) ;; meta project. annotate each plist with name of enclosing project (setq single (apply 'append (mapcar 'org-publish-get-plists components))) ;; normal project (setq single (list (cdr project)))) ;; (setq plists (append plists single)) (dolist (p single) (let* ((exclude (plist-get p :exclude)) (files (org-publish-get-base-files p exclude))) (dolist (f files) (puthash (file-truename f) (car project) org-publish-files))))) plists)) -- Ed Hirgelt Discovery consists of seeing what everybody has seen and thinking what nobody has thought.