[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [PATCH] convert htmlize.el to use cl-lib rather than cl
From: |
Stig Brautaset |
Subject: |
[O] [PATCH] convert htmlize.el to use cl-lib rather than cl |
Date: |
Fri, 14 Jul 2017 21:00:48 +0100 |
User-agent: |
mu4e 0.9.19; emacs 26.0.50 |
Did a rather mechanical translation here, but test results seems to be
the same as before. Are patches like these something you're interested
in?
>From 68310479b615c80fb53aa112d274e2b76c0e2b70 Mon Sep 17 00:00:00 2001
From: Stig Brautaset <address@hidden>
Date: Fri, 14 Jul 2017 20:49:01 +0100
Subject: [PATCH 3/3] htmlize.el: use prefixed functions from cl-lib.el rather
than cl.el
---
contrib/lisp/htmlize.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/contrib/lisp/htmlize.el b/contrib/lisp/htmlize.el
index 8358830a4..f49d29a51 100644
--- a/contrib/lisp/htmlize.el
+++ b/contrib/lisp/htmlize.el
@@ -91,7 +91,7 @@
;;; Code:
-(require 'cl)
+(require 'cl-lib)
(eval-when-compile
(defvar unresolved)
(if (string-match "XEmacs" emacs-version)
@@ -1071,7 +1071,7 @@ If no rgb.txt file is found, return nil."
until (or (not f) (eq f 'unspecified))
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
@@ -1169,8 +1169,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
@@ -1412,7 +1412,7 @@ property and by buffer overlays that specify `face'."
That means that GENERATOR will be evaluated and returned the first time
it's called with the same value of KEY. All other times, the cached
\(memoized) value will be returned."
- (let ((value (gensym)))
+ (let ((value (cl-gensym)))
`(let ((,value (gethash ,key htmlize-memoization-table)))
(unless ,value
(setq ,value ,generator)
@@ -1593,7 +1593,7 @@ it's called with the same value of KEY. All other times,
the cached
(unwind-protect
(let* ((buffer-faces (htmlize-faces-in-buffer))
(face-map (htmlize-make-face-map (adjoin 'default
buffer-faces)))
- (places (gensym))
+ (places (cl-gensym))
(title (if (buffer-file-name)
(file-name-nondirectory (buffer-file-name))
(buffer-name))))
--
2.11.0 (Apple Git-81)
Stig
--
; GNU Emacs 26.0.50, Org mode version 9.0.9
- [O] [PATCH] convert htmlize.el to use cl-lib rather than cl,
Stig Brautaset <=