[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/htmlize 9b49540 133/134: Replace cl with cl-lib
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/htmlize 9b49540 133/134: Replace cl with cl-lib |
Date: |
Sat, 7 Aug 2021 09:17:22 -0400 (EDT) |
branch: elpa/htmlize
commit 9b49540fd624961893b98ad4b2a07bb236c955d0
Author: Alex Branham <alex.branham@gmail.com>
Commit: Hrvoje Nikšić <hniksic@gmail.com>
Replace cl with cl-lib
---
htmlize.el | 74 +++++++++++++++++++++++++++++++-------------------------------
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/htmlize.el b/htmlize.el
index 89caf3b..a3738c2 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -82,7 +82,7 @@
;;; Code:
-(require 'cl)
+(require 'cl-lib)
(eval-when-compile
(defvar font-lock-auto-fontify)
(defvar font-lock-support-mode)
@@ -550,7 +550,7 @@ list."
(when (plist-get imgprops :file)
(let ((location (plist-get (cdr (find-image (list imgprops))) :file)))
(when location
- (setq imgprops (plist-put (copy-list imgprops) :file location)))))
+ (setq imgprops (plist-put (cl-copy-list imgprops) :file location)))))
(if htmlize-force-inline-images
(let ((location (plist-get imgprops :file))
data)
@@ -597,9 +597,9 @@ list."
(put-text-property 0 (length htmlize-ellipsis) 'htmlize-ellipsis t
htmlize-ellipsis)
(defun htmlize-match-inv-spec (inv)
- (member* inv buffer-invisibility-spec
- :key (lambda (i)
- (if (symbolp i) i (car i)))))
+ (cl-member inv buffer-invisibility-spec
+ :key (lambda (i)
+ (if (symbolp i) i (car i)))))
(defun htmlize-decode-invisibility-spec (invisible)
;; Return t, nil, or `ellipsis', depending on how invisible text should be
inserted.
@@ -619,7 +619,7 @@ list."
;; CDR, replace the invisible text with an ellipsis.
(let ((match (if (symbolp invisible)
(htmlize-match-inv-spec invisible)
- (some #'htmlize-match-inv-spec invisible))))
+ (cl-some #'htmlize-match-inv-spec invisible))))
(cond ((null match) t)
((cdr-safe (car match)) 'ellipsis)
(t nil)))))
@@ -643,7 +643,7 @@ list."
(if additions
(let ((textlist nil)
(strpos 0))
- (dolist (add (stable-sort additions #'< :key #'car))
+ (dolist (add (cl-stable-sort additions #'< :key #'car))
(let ((addpos (car add))
(addtext (cdr add)))
(push (substring text strpos addpos) textlist)
@@ -988,7 +988,7 @@ If no rgb.txt file is found, return nil."
;; type `htmlize-fstruct', while the term "face" is reserved for Emacs
;; faces.
-(defstruct htmlize-fstruct
+(cl-defstruct htmlize-fstruct
foreground ; foreground color, #rrggbb
background ; background color, #rrggbb
size ; size
@@ -1002,7 +1002,7 @@ If no rgb.txt file is found, return nil."
(defun htmlize-face-set-from-keyword-attr (fstruct attr value)
;; For ATTR and VALUE, set the equivalent value in FSTRUCT.
- (case attr
+ (cl-case attr
(:foreground
(setf (htmlize-fstruct-foreground fstruct) (htmlize-color-to-rgb value)))
(:background
@@ -1035,7 +1035,7 @@ If no rgb.txt file is found, return nil."
(while head
(let ((inherit (face-attribute (car head) :inherit)))
(cond ((listp inherit)
- (setcdr tail (copy-list inherit))
+ (setcdr tail (cl-copy-list inherit))
(setq tail (last tail)))
((eq inherit 'unspecified))
(t
@@ -1043,11 +1043,11 @@ If no rgb.txt file is found, return nil."
(setq tail (cdr tail)))))
(pop head))
(let ((size-list
- (loop
+ (cl-loop
for f in face-list
for h = (face-attribute f :height)
collect (if (eq h 'unspecified) nil h))))
- (reduce 'htmlize-merge-size (cons nil size-list)))))
+ (cl-reduce 'htmlize-merge-size (cons nil size-list)))))
(defun htmlize-face-css-name (face)
;; Generate the css-name property for the given face. Emacs places
@@ -1115,10 +1115,10 @@ If no rgb.txt file is found, return nil."
;; ...)
;; for the given list of boolean attributes.
(cons 'progn
- (loop for attr in attr-list
- for attr-sym = (intern (format "htmlize-fstruct-%s" attr))
- collect `(when (,attr-sym ,source)
- (setf (,attr-sym ,dest) (,attr-sym ,source))))))
+ (cl-loop for attr in attr-list
+ for attr-sym = (intern (format "htmlize-fstruct-%s" attr))
+ collect `(when (,attr-sym ,source)
+ (setf (,attr-sym ,dest) (,attr-sym ,source))))))
(defun htmlize-merge-size (merged next)
;; Calculate the size of the merge of MERGED and NEXT.
@@ -1146,8 +1146,8 @@ If no rgb.txt file is found, return nil."
;; return it.
(car fstruct-list))
(t
- (reduce #'htmlize-merge-two-faces
- (cons (make-htmlize-fstruct) fstruct-list)))))
+ (cl-reduce #'htmlize-merge-two-faces
+ (cons (make-htmlize-fstruct) fstruct-list)))))
;; GNU Emacs 20+ supports attribute lists in `face' properties. For
;; example, you can use `(:foreground "red" :weight bold)' as an
@@ -1263,14 +1263,14 @@ overlays that specify `face'."
(while (< pos (point-max))
(setq face-prop (get-text-property pos 'face)
next (or (next-single-property-change pos 'face) (point-max)))
- (setq faces (nunion (htmlize-decode-face-prop face-prop)
- faces :test 'equal))
+ (setq faces (cl-nunion (htmlize-decode-face-prop face-prop)
+ faces :test 'equal))
(setq pos next)))
;; Faces used by overlays.
(dolist (overlay (overlays-in (point-min) (point-max)))
(let ((face-prop (overlay-get overlay 'face)))
- (setq faces (nunion (htmlize-decode-face-prop face-prop)
- faces :test 'equal))))
+ (setq faces (cl-nunion (htmlize-decode-face-prop face-prop)
+ faces :test 'equal))))
faces))
(if (>= emacs-major-version 25)
@@ -1280,14 +1280,14 @@ overlays that specify `face'."
(defun htmlize-sorted-overlays-at (pos)
;; Like OVERLAYS-AT with the SORTED argument, for older Emacsen.
(let ((overlays (overlays-at pos)))
- (setq overlays (sort* overlays #'<
- :key (lambda (o)
- (- (overlay-end o) (overlay-start o)))))
+ (setq overlays (cl-sort overlays #'<
+ :key (lambda (o)
+ (- (overlay-end o) (overlay-start o)))))
(setq overlays
- (stable-sort overlays #'<
- :key (lambda (o)
- (let ((prio (overlay-get o 'priority)))
- (if (numberp prio) prio 0)))))
+ (cl-stable-sort overlays #'<
+ :key (lambda (o)
+ (let ((prio (overlay-get o 'priority)))
+ (if (numberp prio) prio 0)))))
(nreverse overlays))))
@@ -1308,9 +1308,9 @@ overlays that specify `face'."
;; Faces from overlays.
(let ((overlays
;; Collect overlays at point that specify `face'.
- (delete-if-not (lambda (o)
- (overlay-get o 'face))
- (nreverse (htmlize-sorted-overlays-at (point)))))
+ (cl-delete-if-not (lambda (o)
+ (overlay-get o 'face))
+ (nreverse (htmlize-sorted-overlays-at (point)))))
list face-prop)
(dolist (overlay overlays)
(setq face-prop (overlay-get overlay 'face)
@@ -1422,9 +1422,9 @@ it's called with the same value of KEY. All other times,
the cached
(htmlize-css-specs (gethash 'default face-map))
"\n ")
"\n }\n")
- (dolist (face (sort* (copy-list buffer-faces) #'string-lessp
- :key (lambda (f)
- (htmlize-fstruct-css-name (gethash f face-map)))))
+ (dolist (face (cl-sort (cl-copy-list buffer-faces) #'string-lessp
+ :key (lambda (f)
+ (htmlize-fstruct-css-name (gethash f
face-map)))))
(let* ((fstruct (gethash face face-map))
(cleaned-up-face-name
(let ((s
@@ -1627,7 +1627,7 @@ it's called with the same value of KEY. All other times,
the cached
;; happens in invisible regions).
(when (> (length text) 0)
;; Open the new markup if necessary and insert the text.
- (when (not (equalp fstruct-list last-fstruct-list))
+ (when (not (cl-equalp fstruct-list last-fstruct-list))
(funcall close-markup)
(setq last-fstruct-list fstruct-list
close-markup (funcall text-markup fstruct-list
htmlbuf)))
@@ -1876,7 +1876,7 @@ corresponding source file."
(provide 'htmlize)
;; Local Variables:
-;; byte-compile-warnings: (not cl-functions unresolved obsolete)
+;; byte-compile-warnings: (not unresolved obsolete)
;; End:
;;; htmlize.el ends here
- [nongnu] elpa/htmlize 296b18e 033/134: Extract a bit of code outside buffer-substring-no-invisible., (continued)
- [nongnu] elpa/htmlize 296b18e 033/134: Extract a bit of code outside buffer-substring-no-invisible., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize e3d020e 059/134: Remove explicit references to MULE., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 5dbea0b 079/134: Convert the auto-link-creation machinery to use the `htmlize-link' property., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize bad6391 082/134: Look for PROP., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 380ba4b 084/134: Bumped version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 5b29cde 090/134: Update NEWS., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 7eb326a 099/134: Fix package header format, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 4570d0a 103/134: Add README., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 8f46e10 105/134: Use htmlpreview., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 78318a2 114/134: Support face-remapping-alist. (#13), ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 9b49540 133/134: Replace cl with cl-lib,
ELPA Syncer <=
- [nongnu] elpa/htmlize a040bdd 127/134: Don't try to call color-instance-rgb-components., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 0a73b2b 043/134: Change `insert-text' method to `text-markup', so that the text can be, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize ec862a1 049/134: Get rid of byte-compiler warnings., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 3308bf9 052/134: Preserve the `display' property during untabification., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 62020d5 054/134: Fix erroneous comment., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize ef8b865 055/134: Add some docs., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 148ac7d 061/134: Consistently eliminate unnecessary string creation in (apply #'concat ...)., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 3faeac8 069/134: Explicitly mark sort as stable., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize af69752 062/134: Consistently handle the multitude of ways to specify the `face' property., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 0ba773b 067/134: Specify some `rgb.txt' locations that actually exist!, ELPA Syncer, 2021/08/07