summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2008-03-10 21:46:41 +0000
committerBastien Guerry <bzg@altern.org>2008-03-10 21:46:41 +0000
commit1e1cc09504136afe239c4a7a90a0f4004ec886c9 (patch)
tree451a30add0aba73e18a3b01a9d1363829a1525ca
parentdcb226432184a0773af07269158d41efb9f1ba9d (diff)
downloadorg-mode-1e1cc09504136afe239c4a7a90a0f4004ec886c9.tar.gz
Several bugfixes in org-publish.el
(org-publish-expand-components): Remove null projects from the list of components. (org-publish-attachment): Bugfix: handle the mandatory argument pub-dir. Removed unused retrieval of the :publishing-directory property. (org-publish-file): Bugfix: when using a relative directory as the publishing directory, convert it to a directory filename. (org-publish-project): New alias for `org-publish'
-rw-r--r--ChangeLog11
-rw-r--r--org-publish.el26
2 files changed, 25 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fd33b5..30d76e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-03-10 Bastien Guerry <bzg@altern.org>
+
+ * org-publish.el (org-publish-expand-components): Remove null
+ projects from the list of components.
+ (org-publish-attachment): Bugfix: handle the mandatory argument
+ pub-dir. Removed unused retrieval of the :publishing-directory
+ property.
+ (org-publish-file): Bugfix: when using a relative directory as
+ the publishing directory, convert it to a directory filename.
+ (org-publish-project): New alias.
+
2008-03-10 Phil Jackson <phil@shellarchive.co.uk>
* org-irc.el (org-irc-get-erc-link): port now converted to a
diff --git a/org-publish.el b/org-publish.el
index 07bd61c..d2628c7 100644
--- a/org-publish.el
+++ b/org-publish.el
@@ -405,8 +405,8 @@ If NO-EXCLUSION is non-nil, don't exclude files."
"Expand PROJECT into an alist of its components."
(let* ((components (plist-get (cdr project) :components)))
(org-publish-delete-dups
- (mapcar (lambda(c) (assoc c org-publish-project-alist))
- components))))
+ (delq nil (mapcar (lambda(c) (assoc c org-publish-project-alist))
+ components)))))
(defun org-publish-get-base-files (project &optional exclude-regexp)
"Return a list of all files in PROJECT.
@@ -494,18 +494,15 @@ See `org-publish-org-to' to the list of arguments."
See `org-publish-org-to' to the list of arguments."
(org-publish-org-to "html" plist filename pub-dir))
-(defun org-publish-attachment (plist filename)
+(defun org-publish-attachment (plist filename pub-dir)
"Publish a file with no transformation of any kind.
-PLIST is the property list for the given project.
-FILENAME is the filename of the file to be published."
+See `org-publish-org-to' to the list of arguments."
;; make sure eshell/cp code is loaded
(eval-and-compile
(require 'eshell)
(require 'esh-maint)
(require 'em-unix))
- (let ((destination (file-name-as-directory
- (plist-get plist :publishing-directory))))
- (eshell/cp filename destination)))
+ (eshell/cp filename pub-dir))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Publishing files, sets of files, and indices
@@ -526,10 +523,13 @@ FILENAME is the filename of the file to be published."
(abbreviate-file-name filename))))
(error "Can't publish file outside of a project")))))
(project-plist (cdr project))
- (publishing-function (or (plist-get project-plist :publishing-function)
- 'org-publish-org-to-html))
- (base-dir (file-truename (plist-get project-plist :base-directory)))
- (pub-dir (file-truename (plist-get project-plist :publishing-directory)))
+ (publishing-function
+ (or (plist-get project-plist :publishing-function)
+ 'org-publish-org-to-html))
+ (base-dir (file-name-as-directory
+ (file-truename (plist-get project-plist :base-directory))))
+ (pub-dir (file-name-as-directory
+ (file-truename (plist-get project-plist :publishing-directory))))
tmp-pub-dir)
(setq tmp-pub-dir
(file-name-directory
@@ -594,6 +594,8 @@ Default for INDEX-FILENAME is 'index.org'."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Interactive publishing functions
+(defalias 'org-publish-project 'org-publish "Publish project.")
+
;;;###autoload
(defun org-publish (project &optional force)
"Publish PROJECT."