0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-16 07:16:32 +00:00

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'
This commit is contained in:
Bastien Guerry 2008-03-10 21:46:41 +00:00
parent dcb2264321
commit 1e1cc09504
2 changed files with 25 additions and 12 deletions

View file

@ -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

View file

@ -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."