* [PATCH] convert htmlize.el to use cl-lib rather than cl
@ 2017-07-14 20:00 Stig Brautaset
2017-07-17 8:43 ` Rasmus
0 siblings, 1 reply; 2+ messages in thread
From: Stig Brautaset @ 2017-07-14 20:00 UTC (permalink / raw)
To: Org Mode
[-- 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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] convert htmlize.el to use cl-lib rather than cl
2017-07-14 20:00 [PATCH] convert htmlize.el to use cl-lib rather than cl Stig Brautaset
@ 2017-07-17 8:43 ` Rasmus
0 siblings, 0 replies; 2+ messages in thread
From: Rasmus @ 2017-07-17 8:43 UTC (permalink / raw)
To: emacs-orgmode
Stig Brautaset <stig@brautaset.org> writes:
> 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?
In principal, it would be good to use cl-lib, but htmlize.el is an
external package that Org relies on.
I think htmlize is maintained here:
https://github.com/hniksic/emacs-htmlize
Thanks,
Rasmus
--
I almost cut my hair, it happened just the other day
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-17 8:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-14 20:00 [PATCH] convert htmlize.el to use cl-lib rather than cl Stig Brautaset
2017-07-17 8:43 ` Rasmus
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).