emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Łukasz Stelmach" <lukasz.stelmach@iem.pw.edu.pl>
To: emacs-orgmode@gnu.org
Subject: [PATCH] can't :include files in org-publish-project-alist
Date: Sat, 21 Aug 2010 16:24:35 +0200	[thread overview]
Message-ID: <87occwjb6k.fsf@kotik.lan> (raw)

EHLO.

I've just discovered that I can't publish a simple webpage anymore (some
options under C-c C-e sitll work but F and P don't). Short investigation
shows that when I run:

(org-publish-get-project-from-filename "/home/steelman/dydaktyka/index.org")

in the *scratch* buffer I get

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument stringp ("index.org"))
  string-match(("index.org") "/home/steelman/dydaktyka/index.org")
  (and i (string-match i filename))
  (or (and i (string-match i filename)) (and (not ...) (string-match xm filename)))
  (if (or (and i ...) (and ... ...)) (progn (setq project-name ...) (throw ... project-name)))
[...]
--8<---------------cut here---------------end--------------->8---

assuming my org-publish-project-alist

--8<---------------cut here---------------start------------->8---
(setq org-publish-project-alist
      '(("dydaktyka-org"
         :base-directory "~/dydaktyka"
         :base-extension "org"
         :publishing-directory "/some/dir"
         :exclude ".*"
         :table-of-contents nil
         :publishing-function org-publish-org-to-html
         :include ("index.org")) ; <---- HERE
        ("dydaktyka-files"
         :base-directory "~/dydaktyka/data"
         :recursive t
         :publishing-directory "/some/dir/data"
         :base-extension "odt"
         :publishing-function org-publish-attachment)
        ("dydaktyka" :components ("dydaktyka-org" "dydaktyka-files"))))
--8<---------------cut here---------------end--------------->8---

However, with parenthesis around "index.org" removed the function seems to
work fine and returns

--8<---------------cut here---------------start------------->8---
("dydaktyka-org" :base-directory "~/dydaktyka" :base-extension "org"
 :publishing-directory "/some/dir"
 :exclude ".*"
 :table-of-contents nil
 :publishing-function org-publish-org-to-html
 :include "index.org")
--8<---------------cut here---------------end--------------->8---

All this leads to a patch like this:

--8<---------------cut here---------------start------------->8---
Fix org-publish to accept list of files to :include again

Fix a regression introduced by Sebastian Rose's 339d6fe4 that makes
org-publish-get-project-from-filename function break if a project's
:include parameter contains a list of strings.

diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index 6324eba..8a02df1 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -466,12 +466,15 @@ matching filenames."
          ;; [[info:org:Selecting%20files]] shows how this is supposed to work:
          (let* ((r (plist-get (cdr prj) :recursive))
                 (b (expand-file-name (plist-get (cdr prj) :base-directory)))
+                (b (concat b (when (string-match "[^/]$" b) "/"))) ; How about Win?
                 (x (or (plist-get (cdr prj) :base-extension) "org"))
                 (e (plist-get (cdr prj) :exclude))
                 (i (plist-get (cdr prj) :include))
                 (xm (concat "^" b (if r ".+" "[^/]+") "\\.\\(" x "\\)$")))
            (when (or
-                  (and i (string-match i filename))
+                  (and i (stringp i) (string-match i filename))
+                  (and i (listp i) (member filename
+                                           (mapcar (lambda (x) (concat b x)) i)))
                   (and
                    (not (and e (string-match e filename)))
                    (string-match xm filename)))
--8<---------------cut here---------------end--------------->8---

-- 
Miłego dnia,
Łukasz Stelmach

             reply	other threads:[~2010-08-21 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-21 14:24 Łukasz Stelmach [this message]
2010-08-21 14:34 ` [PATCH] can't :include files in org-publish-project-alist Nick Dokos
2010-08-21 16:46   ` Łukasz Stelmach
2010-09-02 14:03     ` Bastien
2010-09-02 14:46       ` Łukasz Stelmach

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=87occwjb6k.fsf@kotik.lan \
    --to=lukasz.stelmach@iem.pw.edu.pl \
    --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).