From ccd01d1aee5cf5093e4237399a61a24ca3d4b0f9 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 3 Aug 2020 00:59:26 +0530 Subject: 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. --- ennum.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ennum.el') diff --git a/ennum.el b/ennum.el index bfd3bc7..a5a37ab 100644 --- a/ennum.el +++ b/ennum.el @@ -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)))) -- cgit v1.2.3