;;; ox-publish.el --- Publish Related Org Mode Files as a Website
-;; Copyright (C) 2006-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2015 Free Software Foundation, Inc.
;; Author: David O'Toole <dto@gnu.org>
;; Maintainer: Carsten Dominik <carsten DOT dominik AT gmail DOT com>
`:sitemap-sort-files'
The site map is normally sorted alphabetically. You can
- change this behaviour setting this to `anti-chronologically',
+ change this behavior setting this to `anti-chronologically',
`chronologically', or nil.
`:sitemap-ignore-case'
(visiting (find-buffer-visiting file))
(buffer (or visiting (find-file-noselect file))))
(with-current-buffer buffer
- (org-mode)
(let ((title
- (let ((property (plist-get (org-export-get-environment) :title)))
- (if property (org-element-interpret-data property)
+ (let ((property
+ (plist-get
+ ;; protect local variables in open buffers
+ (if visiting
+ (org-export-with-buffer-copy (org-export-get-environment))
+ (org-export-get-environment))
+ :title)))
+ (if property
+ (org-no-properties (org-element-interpret-data property))
(file-name-nondirectory (file-name-sans-extension file))))))
(unless visiting (kill-buffer buffer))
(org-publish-cache-set-file-property file :title title)
any other case use the file system's modification time. Return
time in `current-time' format."
(if (file-directory-p file) (nth 5 (file-attributes file))
- (let* ((visiting (find-buffer-visiting file))
+ (let* ((org-inhibit-startup t)
+ (visiting (find-buffer-visiting file))
(file-buf (or visiting (find-file-noselect file nil)))
(date (plist-get
(with-current-buffer file-buf
- (let ((org-inhibit-startup t)) (org-mode))
- (org-export-get-environment))
+ (if visiting
+ (org-export-with-buffer-copy (org-export-get-environment))
+ (org-export-get-environment)))
:date)))
(unless visiting (kill-buffer file-buf))
;; DATE is either a timestamp object or a secondary string. If it
;; project is still a string here.
(list (assoc project org-publish-project-alist)))))
(if async
- (org-export-async-start 'ignore
+ (org-export-async-start (lambda (results) nil)
`(let ((org-publish-use-timestamps-flag
(if ',force nil ,org-publish-use-timestamps-flag)))
(org-publish-projects ',project-alist)))
in another process."
(interactive "P")
(if async
- (org-export-async-start 'ignore
+ (org-export-async-start (lambda (results) nil)
`(progn
(when ',force (org-publish-remove-all-timestamps))
(let ((org-publish-use-timestamps-flag
(interactive "P")
(let ((file (buffer-file-name (buffer-base-buffer))))
(if async
- (org-export-async-start 'ignore
+ (org-export-async-start (lambda (results) nil)
`(let ((org-publish-use-timestamps-flag
(if ',force nil ,org-publish-use-timestamps-flag)))
(org-publish-file ,file)))