Merge pull request #437 from kisaragi-hiu/cl-lib

Replace deprecated cl package with cl-lib
This commit is contained in:
Yujie Wen 2020-10-25 17:52:00 +08:00 committed by GitHub
commit 6542658d67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 12 deletions

View File

@ -32,7 +32,7 @@
;;; Code: ;;; Code:
(require 'ox-html) (require 'ox-html)
(require 'cl) (require 'cl-lib)
(org-export-define-derived-backend 'reveal 'html (org-export-define-derived-backend 'reveal 'html
@ -888,7 +888,7 @@ holding export options."
(defun org-reveal-parse-token (keyword info key &optional value) (defun org-reveal-parse-token (keyword info key &optional value)
"Return HTML tags or perform SIDE EFFECT according to key. "Return HTML tags or perform SIDE EFFECT according to key.
Use the previous section tag as the tag of the split section. " Use the previous section tag as the tag of the split section. "
(case (intern key) (cl-case (intern key)
(split (split
(let ((headline (org-element-property (let ((headline (org-element-property
:parent :parent
@ -943,7 +943,7 @@ Use the previous section tag as the tag of the split section. "
(and checkbox " "))) (and checkbox " ")))
(br (org-html-close-tag "br" nil info))) (br (org-html-close-tag "br" nil info)))
(concat (concat
(case type (cl-case type
(ordered (ordered
(let* ((counter term-counter-id) (let* ((counter term-counter-id)
(extra (if counter (format " value=\"%s\"" counter) ""))) (extra (if counter (format " value=\"%s\"" counter) "")))
@ -962,10 +962,10 @@ Use the previous section tag as the tag of the split section. "
;; Check-boxes in descriptive lists are associated to tag. ;; Check-boxes in descriptive lists are associated to tag.
(concat (format "<dt%s>%s</dt>" (concat (format "<dt%s>%s</dt>"
attr-html (concat checkbox term)) attr-html (concat checkbox term))
(format "<dd%s>" attr-html))))) (format "<dd%s>" attr-html)))))
(unless (eq type 'descriptive) checkbox) (unless (eq type 'descriptive) checkbox)
(and contents (org-trim contents)) (and contents (org-trim contents))
(case type (cl-case type
(ordered "</li>") (ordered "</li>")
(unordered "</li>") (unordered "</li>")
(descriptive "</dd>"))))) (descriptive "</dd>")))))
@ -993,7 +993,7 @@ and may change custom variables as SIDE EFFECT.
CONTENTS is nil. INFO is a plist holding contextual information." CONTENTS is nil. INFO is a plist holding contextual information."
(let ((key (org-element-property :key keyword)) (let ((key (org-element-property :key keyword))
(value (org-element-property :value keyword))) (value (org-element-property :value keyword)))
(case (intern key) (cl-case (intern key)
(REVEAL (org-reveal-parse-keyword-value keyword value info)) (REVEAL (org-reveal-parse-keyword-value keyword value info))
(REVEAL_HTML value) (REVEAL_HTML value)
(HTML value)))) (HTML value))))
@ -1074,7 +1074,7 @@ CONTENTS is the contents of the list. INFO is a plist holding
contextual information. contextual information.
Extract and set `attr_html' to plain-list tag attributes." Extract and set `attr_html' to plain-list tag attributes."
(let ((tag (case (org-element-property :type plain-list) (let ((tag (cl-case (org-element-property :type plain-list)
(ordered "ol") (ordered "ol")
(unordered "ul") (unordered "ul")
(descriptive "dl"))) (descriptive "dl")))
@ -1406,17 +1406,17 @@ transformed fragment attribute to ELEM's attr_html plist."
frag-list)) frag-list))
(items (org-element-contents elem)) (items (org-element-contents elem))
(default-style-list (default-style-list
(mapcar (lambda (a) default-style) (mapcar (lambda (a) default-style)
(number-sequence 1 (length items))))) (number-sequence 1 (length items)))))
(if frag-index (if frag-index
(mapcar* 'org-reveal--update-attr-html (cl-mapcar 'org-reveal--update-attr-html
items frag-list default-style-list (car (read-from-string frag-index))) items frag-list default-style-list (car (read-from-string frag-index)))
(let* ((last-frag (car (last frag-list))) (let* ((last-frag (car (last frag-list)))
(tail-list (mapcar (lambda (a) last-frag) (tail-list (mapcar (lambda (a) last-frag)
(number-sequence (+ (length frag-list) 1) (number-sequence (+ (length frag-list) 1)
(length items))))) (length items)))))
(nconc frag-list tail-list) (nconc frag-list tail-list)
(mapcar* 'org-reveal--update-attr-html items frag-list default-style-list))))) (cl-mapcar 'org-reveal--update-attr-html items frag-list default-style-list)))))
(t (org-reveal--update-attr-html elem frag default-style frag-index))) (t (org-reveal--update-attr-html elem frag default-style frag-index)))
elem))) elem)))