diff options
author | Kai Tetzlaff <kai.tetzlaff@web.de> | 2011-08-18 13:17:56 +0000 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-10-22 10:41:15 +0200 |
commit | af0789a5a8951a87f050abb79313012f261bf4f0 (patch) | |
tree | 469e539ee45ff2b1389495ae8b4c8a5b54045e75 | |
parent | 989b079dd780900d878f7200b4a92f7570d58485 (diff) | |
download | org-mode-af0789a5a8951a87f050abb79313012f261bf4f0.tar.gz |
Variable publishing-directory? (resent with patch as attachment)
Bastien <bzg@altern.org> writes:
Hi Bastien,
> The patch looks good but I'd like to understand it better.
> Can you send an example configuration working with your patch?
In org-publish-project-alist, i have HTML publishing projects which
should be published to different target directories depending on e.g.
where emacs is running (which i determine in my init files using the MAC
address of the default GW, the name the machine, ...).
Here is an example: At home, i publish to a local directory
(:publishing-directory "~/tmp/publish-test") but at work i would like to
publish directly to a webserver (:publishing-directory
"/plinkx:doxydoc:~/public_html/publish-test" - this is on w32, using
tramps PuTTY/plink). To avoid having to change the definition of the
publishing project when i change locations i would like to construct the
actual value of :publishing-directory by calling a function:
("publishing-dir-test"
:base-directory "~/Documents/Work/RS"
:recursive t
:base-extension "org"
:exclude-tags ("intern")
:publishing-directory '(expand-file-name "publish-test" kt:org-default-publishing-dir)
:publishing-function org-publish-org-to-html)
Depending on the location i'm in, 'kt:org-default-publishing-dir' would
be set to either "~/tmp" or "/plinkx:doxydoc:~/public_html". Without the
patch, the example above does not work as the value of
:publishing-directory does not get evaluated.
> Also, please try to send git patch using these conventions:
> http://orgmode.org/worg/org-contribute.html#sec-5
>
> Thanks a lot!
Thanks for the hint. I've attached a revised version of the patch which
includes a changelog/commit msg - i hope that works for you.
Publish: allow dynamic construction of the publish destination.
* org-publish.el (org-publish-file): Added 'eval'ing the value of the
:publishing-directory property before using it as destination of the
publishing project. This allows to construct the publish destination
directory dynamically at run-time using the return value of a
function.
TINYCHANGE
-rw-r--r-- | lisp/org-publish.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/org-publish.el b/lisp/org-publish.el index 06402b4..4b4f857 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -684,7 +684,7 @@ See `org-publish-projects'." (pub-dir (file-name-as-directory (file-truename - (or (plist-get project-plist :publishing-directory) + (or (eval (plist-get project-plist :publishing-directory)) (error "Project %s does not have :publishing-directory defined" (car project)))))) tmp-pub-dir) |