summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Lundin <mdl@imapmail.org>2014-07-28 23:56:42 -0500
committerBastien Guerry <bzg@altern.org>2014-07-29 15:21:21 +0200
commit507244d56b055e7595ba94fe89d45c7ddb2559df (patch)
treef150c63a371c95f1cf9681fa3d8c069d3a134726
parent812a88965765d60e8d3917bdf370fdbf1ed8250a (diff)
downloadorg-mode-507244d56b055e7595ba94fe89d45c7ddb2559df.tar.gz
Remove unnecessary invocations of org-mode
* lisp/ox-publish.el: (org-publish-find-title) (org-publish-find-date) Fix unnecessary invocations of org-mode with org-inhibit-startup. The functions above call org-mode with org-inhibit-startup in org buffers that are already open. The result is that these open buffers lose some crucial local variables during publishing. For instance, an open buffer will lose its dir-local-variables-alist setting during publishing. There is no need to call org-mode here, because org-mode is a) either already initialized in the buffer or b) initialized via earlier call to find-file-no-select. This looks to me like a relic of some past time when these functions were called in temporary buffers that contained copies of the file's contents.
-rw-r--r--lisp/ox-publish.el5
1 files changed, 1 insertions, 4 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index b38fca9..24546ea 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -801,11 +801,9 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
"Find the title of FILE in project."
(or
(and (not reset) (org-publish-cache-get-file-property file :title nil t))
- (let* ((org-inhibit-startup t)
- (visiting (find-buffer-visiting file))
+ (let* ((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
@@ -826,7 +824,6 @@ time in `current-time' format."
(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))
:date)))
(unless visiting (kill-buffer file-buf))