diff options
author | Bastien Guerry <bzg@altern.org> | 2013-03-19 11:15:08 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-03-19 19:38:52 +0100 |
commit | f5bf08c92cc90abd1f8f253b9759e6d0a625e944 (patch) | |
tree | 00d4672832c5219b0484f7f636d2b6ba2fe9353f | |
parent | e996307556c9db8ee13923f9c548af4805d75c2a (diff) | |
download | org-mode-f5bf08c92cc90abd1f8f253b9759e6d0a625e944.tar.gz |
ox-org.el (org-org-publish-to-org): Kill buffers not visited at publication time
* ox-org.el (org-org-publish-to-org): Kill buffers not visited
at publication time.
-rw-r--r-- | lisp/ox-org.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/ox-org.el b/lisp/ox-org.el index 373589f..9bdc726 100644 --- a/lisp/ox-org.el +++ b/lisp/ox-org.el @@ -144,11 +144,13 @@ Return output file name." (when (plist-get plist :htmlized-source) (require 'htmlize) (require 'ox-html) - (or (find-buffer-visiting filename) - (find-file filename)) - (font-lock-fontify-buffer) - (let* ((htmlize-output-type 'css) - (newbuf (htmlize-buffer))) + (let* ((org-inhibit-startup t) + (htmlize-output-type 'css) + (visitingp (find-buffer-visiting filename)) + (work-buffer (or visitingp (find-file filename))) + newbuf) + (font-lock-fontify-buffer) + (setq newbuf (htmlize-buffer)) (with-current-buffer newbuf (when org-org-htmlized-css-url (goto-char (point-min)) @@ -159,7 +161,8 @@ Return output file name." "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">" org-org-htmlized-css-url) t t))) (write-file (concat pub-dir (file-name-nondirectory filename) ".html"))) - (kill-buffer newbuf)) + (kill-buffer newbuf) + (unless visitingp (kill-buffer work-buffer))) (set-buffer-modified-p nil))) (provide 'ox-org) |