From: Stig Brautaset <stig@brautaset.org>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] convert htmlize.el to use cl-lib rather than cl
Date: Fri, 14 Jul 2017 21:00:48 +0100 [thread overview]
Message-ID: <m2pod27pqn.fsf@Margil.home> (raw)
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
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?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-htmlize.el-use-prefixed-functions-from-cl-lib.el-rat.patch --]
[-- Type: text/x-patch, Size: 2452 bytes --]
From 68310479b615c80fb53aa112d274e2b76c0e2b70 Mon Sep 17 00:00:00 2001
From: Stig Brautaset <stig@brautaset.org>
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 @@
\f
;;; 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)
[-- Attachment #3: Type: text/plain, Size: 53 bytes --]
Stig
--
; GNU Emacs 26.0.50, Org mode version 9.0.9
next reply other threads:[~2017-07-14 20:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-14 20:00 Stig Brautaset [this message]
2017-07-17 8:43 ` [PATCH] convert htmlize.el to use cl-lib rather than cl Rasmus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2pod27pqn.fsf@Margil.home \
--to=stig@brautaset.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.