diff options
author | Arun Isaac | 2020-08-03 00:59:26 +0530 |
---|---|---|
committer | Arun Isaac | 2020-08-03 01:24:39 +0530 |
commit | ccd01d1aee5cf5093e4237399a61a24ca3d4b0f9 (patch) | |
tree | 73b6a33a5a4daa65c4b6cab4dbe2ad046ac20026 | |
parent | 2ef369f0fd06b4eb48b9f539553835838daf621f (diff) | |
download | ennum-ccd01d1aee5cf5093e4237399a61a24ca3d4b0f9.tar.gz ennum-ccd01d1aee5cf5093e4237399a61a24ca3d4b0f9.tar.lz ennum-ccd01d1aee5cf5093e4237399a61a24ca3d4b0f9.zip |
Use output-html-file argument passed to ennum-export-post.
Prior to this, the output-html-file was disregarded and recomputed
unnecessarily.
* ennum.el (ennum-export-post): Use output-html-file argument, instead
of recomputing it.
-rw-r--r-- | ennum.el | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -295,15 +295,15 @@ code, without surrounding template. See `org-export-as'. When optional argument OUTPUT-HTML-FILE is nil, return exported result as a string." - (let ((output-file (ennum--org-output-filename (ennum-post-filename post)))) - (ennum-mkdir-p (file-name-directory output-file)) - (let ((system-time-locale (map-elt (ennum-setting :locale-alist) - (ennum-post-language post) nil 'string=)) - (ext-plist (list :ennum-post post))) - (ennum-with-file-contents interned-org-file - (if output-html-file - (org-export-to-file 'ennum-html output-file nil nil nil body-only ext-plist) - (org-export-as 'ennum-html nil nil body-only ext-plist)))))) + (let ((system-time-locale (map-elt (ennum-setting :locale-alist) + (ennum-post-language post) nil 'string=)) + (ext-plist (list :ennum-post post))) + (ennum-with-file-contents interned-org-file + (cond + (output-html-file + (ennum-mkdir-p (file-name-directory output-html-file)) + (org-export-to-file 'ennum-html output-html-file nil nil nil body-only ext-plist)) + (t (org-export-as 'ennum-html nil nil body-only ext-plist)))))) (defun ennum-publish-post (post) (let ((interned-org-file (ennum-intern (ennum-post-filename post)))) |