From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stig Brautaset Subject: [PATCH] convert htmlize.el to use cl-lib rather than cl Date: Fri, 14 Jul 2017 21:00:48 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dW6ll-0001HO-PP for emacs-orgmode@gnu.org; Fri, 14 Jul 2017 16:00:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dW6lg-0006w5-TB for emacs-orgmode@gnu.org; Fri, 14 Jul 2017 16:00:57 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:60431) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dW6lg-0006vP-Lv for emacs-orgmode@gnu.org; Fri, 14 Jul 2017 16:00:52 -0400 Received: from mfilter11-d.gandi.net (mfilter11-d.gandi.net [217.70.178.131]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 4FD14FB89E for ; Fri, 14 Jul 2017 22:00:51 +0200 (CEST) Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter11-d.gandi.net (mfilter11-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id WBraAQAQONfm for ; Fri, 14 Jul 2017 22:00:49 +0200 (CEST) Received: from localhost (host86-165-101-30.range86-165.btcentralplus.com [86.165.101.30]) (Authenticated sender: mailbox@brautaset.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 9B49CFB8B3 for ; Fri, 14 Jul 2017 22:00:49 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org Mode --=-=-= Content-Type: text/plain 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? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0003-htmlize.el-use-prefixed-functions-from-cl-lib.el-rat.patch >From 68310479b615c80fb53aa112d274e2b76c0e2b70 Mon Sep 17 00:00:00 2001 From: Stig Brautaset 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) --=-=-= Content-Type: text/plain Stig -- ; GNU Emacs 26.0.50, Org mode version 9.0.9 --=-=-=--