path: root/lisp/ox-publish.el
diff options
authorS├ębastien Delafond <>2014-08-27 12:01:58 +0200
committerS├ębastien Delafond <>2014-08-27 12:01:58 +0200
commitf57fab831252ebe5037ceabe9843623c4bd14f15 (patch)
treed383b556871ea0034a90209c6d2dce523975701a /lisp/ox-publish.el
parent75a81babfdc3c8c643962fd77b034b42e20cbee3 (diff)
Imported Upstream version 8.2.7c
Diffstat (limited to 'lisp/ox-publish.el')
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index b38fca9..1dc790d 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -805,9 +805,14 @@ Default for SITEMAP-FILENAME is ''."
(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)))
+ (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))))))
@@ -822,12 +827,14 @@ If FILE is an Org file and provides a DATE keyword use it. In
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)))
(unless visiting (kill-buffer file-buf))
;; DATE is either a timestamp object or a secondary string. If it