diff options
author | Aaron Ecay <aaronecay@gmail.com> | 2018-05-10 01:17:12 +0100 |
---|---|---|
committer | Aaron Ecay <aaronecay@gmail.com> | 2018-05-10 01:17:12 +0100 |
commit | 673165c0352cf65d8ba3c17c997344b46bcc6a75 (patch) | |
tree | 0dea6f1c3ed41c312b7cb14f7fdc2b9e21c9bd96 | |
parent | ccfe51d83c2af13de55569e9e87e8811428cfb12 (diff) | |
download | org-mode-673165c0352cf65d8ba3c17c997344b46bcc6a75.tar.gz |
ox-*: single-armed “if” -> “when”
* lisp/ox-html.el (org-html-htmlize-generate-css):
(org-html-template, org-html-final-function):
* lisp/ox-publish.el (org-publish-cache-set-file-property):
* lisp/ox-texinfo.el (org-texinfo-quote-block): Transform ‘if’ with no
else to ‘when’.
-rw-r--r-- | lisp/ox-html.el | 26 | ||||
-rw-r--r-- | lisp/ox-publish.el | 2 | ||||
-rw-r--r-- | lisp/ox-texinfo.el | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 41b0aa3..962d0b1 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1764,12 +1764,12 @@ produce code that uses these same face definitions." (htmlize-region (point-min) (point-max)))) (pop-to-buffer-same-window "*html*") (goto-char (point-min)) - (if (re-search-forward "<style" nil t) - (delete-region (point-min) (match-beginning 0))) - (if (re-search-forward "</style>" nil t) - (delete-region (1+ (match-end 0)) (point-max))) + (when (re-search-forward "<style" nil t) + (delete-region (point-min) (match-beginning 0))) + (when (re-search-forward "</style>" nil t) + (delete-region (1+ (match-end 0)) (point-max))) (beginning-of-line 1) - (if (looking-at " +") (replace-match "")) + (when (looking-at " +") (replace-match "")) (goto-char (point-min))) (defun org-html--make-string (n string) @@ -2097,12 +2097,12 @@ holding export options." ;; Postamble. (org-html--build-pre/postamble 'postamble info) ;; Possibly use the Klipse library live code blocks. - (if (plist-get info :html-klipsify-src) - (concat "<script>" (plist-get info :html-klipse-selection-script) - "</script><script src=\"" - org-html-klipse-js - "\"></script><link rel=\"stylesheet\" type=\"text/css\" href=\"" - org-html-klipse-css "\"/>")) + (when (plist-get info :html-klipsify-src) + (concat "<script>" (plist-get info :html-klipse-selection-script) + "</script><script src=\"" + org-html-klipse-js + "\"></script><link rel=\"stylesheet\" type=\"text/css\" href=\"" + org-html-klipse-css "\"/>")) ;; Closing document. "</body>\n</html>")) @@ -3716,8 +3716,8 @@ contextual information." (with-temp-buffer (insert contents) (set-auto-mode t) - (if (plist-get info :html-indent) - (indent-region (point-min) (point-max))) + (when (plist-get info :html-indent) + (indent-region (point-min) (point-max))) (buffer-substring-no-properties (point-min) (point-max)))) diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index 3658d41..e2da553 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -1321,7 +1321,7 @@ the file including them will be republished as well." Use cache file of PROJECT-NAME. If the entry does not exist, it will be created. Return VALUE." ;; Evtl. load the requested cache file: - (if project-name (org-publish-initialize-cache project-name)) + (when project-name (org-publish-initialize-cache project-name)) (let ((pl (org-publish-cache-get filename))) (if pl (progn (plist-put pl property value) value) (org-publish-cache-get-file-property diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index e93a6c7..83600f1 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1342,8 +1342,8 @@ CONTENTS holds the contents of the block. INFO is a plist holding contextual information." (let* ((title (org-element-property :name quote-block)) (start-quote (concat "@quotation" - (if title - (format " %s" title))))) + (when title + (format " %s" title))))) (format "%s\n%s@end quotation" start-quote contents))) ;;;; Radio Target |