GNU bug report logs - #30424
[patch] replace cl with cl-lib

Previous Next

Package: auctex;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Sun, 11 Feb 2018 18:11:01 UTC

Severity: normal

Tags: patch

Done: Mosè Giordano <mose <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mosè Giordano <mose <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#30424: closed ([patch] replace cl with cl-lib)
Date: Sat, 17 Feb 2018 18:56:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 17 Feb 2018 19:54:50 +0100
with message-id <CAKtYQqTH2A8hEoYvtkSPEMPgD1MFxoG0DH0m3fnxR2p=mfPozQ <at> mail.gmail.com>
and subject line Re: bug#30424: [patch] replace cl with cl-lib
has caused the debbugs.gnu.org bug report #30424,
regarding [patch] replace cl with cl-lib
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
30424: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=30424
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Alex Branham <alex.branham <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: [patch] replace cl with cl-lib
Date: Sun, 11 Feb 2018 12:10:49 -0600
[Message part 3 (text/plain, inline)]
The attached patch replaces cl with cl-lib.

From 6bc94eaee8a189af5f847878b6280c6a1a0e4b54 Mon Sep 17 00:00:00 2001
From: Alex Branham <branham <at> utexas.edu>
Date: Tue, 30 Jan 2018 20:56:13 -0600
Subject: [PATCH] Replace cl with cl-lib

---
 bib-cite.el        |  5 +++--
 font-latex.el      |  2 +-
 latex.el           |  3 ++-
 style/babel.el     |  3 ++-
 style/caption.el   | 22 +++++++++++-----------
 style/empheq.el    | 12 ++++++------
 style/enumitem.el  | 18 +++++++++---------
 style/floatrow.el  | 17 +++++++++--------
 style/fvextra.el   |  9 +++++----
 style/listings.el  | 11 ++++++-----
 style/mdframed.el  | 13 +++++++------
 style/tcolorbox.el |  7 ++++---
 12 files changed, 65 insertions(+), 57 deletions(-)

diff --git a/bib-cite.el b/bib-cite.el
index 0be0eb0b..5cb8a1d2 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -589,7 +589,8 @@
 ;; ----------------------------------------------------------------------------
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 (defgroup bib-cite nil
   "bib-cite, LaTeX minor-mode to display \\cite, \\ref and \\label commands."
@@ -2427,7 +2428,7 @@ bib-dos-or-os2-variable affects:
 			 (or (and (fboundp 'TeX-split-string)
 				  (TeX-split-string sep-char value))
 			     (dired-split sep-char value)))))
-      (loop for x in entries if (bib-cite-file-directory-p x) collect x))))
+      (cl-loop for x in entries if (bib-cite-file-directory-p x) collect x))))
 
 (provide 'bib-cite)
 ;;; bib-cite.el ends here
diff --git a/font-latex.el b/font-latex.el
index 9b621985..1df751ad 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -43,7 +43,7 @@
 (require 'tex)
 
 (eval-when-compile
-  (require 'cl))
+  (require 'cl-lib))
 
 (defgroup font-latex nil
   "Font-latex text highlighting package."
diff --git a/latex.el b/latex.el
index c2d8a4ca..05d6f55c 100644
--- a/latex.el
+++ b/latex.el
@@ -31,7 +31,8 @@
 (require 'tex)
 (require 'tex-style)
 (require 'tex-ispell)
-(eval-when-compile (require 'cl))       ;FIXME: Use cl-lib.
+(eval-when-compile
+  (require 'cl-lib))
 
 ;;; Syntax
 
diff --git a/style/babel.el b/style/babel.el
index c1119b9b..d8c5e3ff 100644
--- a/style/babel.el
+++ b/style/babel.el
@@ -30,7 +30,8 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 (defvar LaTeX-babel-language-list
   '("afrikaans"
diff --git a/style/caption.el b/style/caption.el
index df6328e3..f23e59da 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -34,8 +34,8 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -168,19 +168,19 @@ in `caption'-completions."
       ;; For `\DeclareCaptionOption', only add the value
       ;; (remember:      key=^^^^^^, val="defined key")
       (if (string-equal key "option")
-	  (pushnew (list val) opts :test #'equal)
+	  (cl-pushnew (list val) opts :test #'equal)
 	;; For anything but `\DeclareCaptionOption', do the standard
 	;; procedure.  Again, take care of `subrefformat' for `subcaption.el'.
 	(if val-match
 	    (progn
 	      (when (and (string-equal key "labelformat")
 			 (boundp 'LaTeX-subcaption-key-val-options))
-		(pushnew (list "subrefformat"
-			       (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
-			 opts :test #'equal))
-	      (pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
-		       opts :test #'equal))
-	  (pushnew (list key (list val)) opts :test #'equal)))
+		(cl-pushnew (list "subrefformat"
+			          (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
+			    opts :test #'equal))
+	      (cl-pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
+		          opts :test #'equal))
+	  (cl-pushnew (list key (list val)) opts :test #'equal)))
       (setq LaTeX-caption-key-val-options-local (copy-alist opts))))
   ;; Support for environments defined with newfloat.sty: These
   ;; environments are added to "type" and "type*" key:
@@ -192,8 +192,8 @@ in `caption'-completions."
 	     (val-match (cdr (assoc key LaTeX-caption-key-val-options-local)))
 	     (temp (copy-alist LaTeX-caption-key-val-options-local))
 	     (opts (assq-delete-all (car (assoc key temp)) temp)))
-	(pushnew (list key (TeX-delete-duplicate-strings (apply #'append val val-match)))
-		 opts :test #'equal)
+	(cl-pushnew (list key (TeX-delete-duplicate-strings (apply #'append val val-match)))
+		    opts :test #'equal)
 	(setq LaTeX-caption-key-val-options-local (copy-alist opts))))))
 
 (defun LaTeX-arg-caption-command (optional &optional prompt)
diff --git a/style/empheq.el b/style/empheq.el
index 4365136e..b0231e82 100644
--- a/style/empheq.el
+++ b/style/empheq.el
@@ -31,8 +31,8 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -142,11 +142,11 @@
 	      (where (cadr delims)))
 	  (if (string= where "Left")
 	      (progn
-		(pushnew (concat TeX-esc "empheq" delim) lval :test #'equal)
-		(pushnew (concat TeX-esc "empheqbig" delim) lval :test #'equal))
+		(cl-pushnew (concat TeX-esc "empheq" delim) lval :test #'equal)
+		(cl-pushnew (concat TeX-esc "empheqbig" delim) lval :test #'equal))
 	    (progn
-	      (pushnew (concat TeX-esc "empheq" delim) rval :test #'equal)
-	      (pushnew (concat TeX-esc "empheqbig" delim) rval :test #'equal)))))
+	      (cl-pushnew (concat TeX-esc "empheq" delim) rval :test #'equal)
+	      (cl-pushnew (concat TeX-esc "empheqbig" delim) rval :test #'equal)))))
       (when lval
 	(setq tmp (assq-delete-all (car (assoc "left" tmp)) tmp))
 	(setq lvals (append lval lvals))
diff --git a/style/enumitem.el b/style/enumitem.el
index f347446a..1518a7a6 100644
--- a/style/enumitem.el
+++ b/style/enumitem.el
@@ -38,8 +38,8 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -266,9 +266,9 @@ in `enumitem'-completions."
 	   (temp (copy-alist LaTeX-enumitem-key-val-options-local))
 	   (opts (assq-delete-all (car (assoc key temp)) temp)))
       (if val-match
-	  (pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
-		   opts :test #'equal)
-	(pushnew (list key (list val)) opts :test #'equal))
+	  (cl-pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
+		      opts :test #'equal)
+	(cl-pushnew (list key (list val)) opts :test #'equal))
       (setq LaTeX-enumitem-key-val-options-local (copy-alist opts))))
   (dolist (newalign (LaTeX-enumitem-SetLabelAlign-list))
     (let* ((key "align")
@@ -276,8 +276,8 @@ in `enumitem'-completions."
 	   (val-match (cdr (assoc key LaTeX-enumitem-key-val-options-local)))
 	   (temp (copy-alist LaTeX-enumitem-key-val-options-local))
 	   (opts (assq-delete-all (car (assoc key temp)) temp)))
-      (pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
-	       opts :test #'equal)
+      (cl-pushnew (list key (TeX-delete-duplicate-strings (apply #'append (list val) val-match)))
+	          opts :test #'equal)
       (setq LaTeX-enumitem-key-val-options-local (copy-alist opts)))))
 
 (TeX-add-style-hook
@@ -405,13 +405,13 @@ in `enumitem'-completions."
        (lambda ()
 	 (let ((enums '("enumerate")))
 	   (when (LaTeX-provided-package-options-member "enumitem" "inline")
-	     (pushnew "enumerate*" enums :test #'equal))
+	     (cl-pushnew "enumerate*" enums :test #'equal))
 	   (dolist (env-type (LaTeX-enumitem-newlist-list))
 	     (let ((env   (car env-type))
 		   (type  (cadr env-type)))
 	       (when (or (string-equal type "enumerate")
 			 (string-equal type "enumerate*"))
-		 (pushnew env enums :test #'equal))))
+		 (cl-pushnew env enums :test #'equal))))
 	   (completing-read "List name: " enums)))))
 
     ;; "Align" is added as new value to "align" key in key-val list.
diff --git a/style/floatrow.el b/style/floatrow.el
index 5beb1096..bc358d1b 100644
--- a/style/floatrow.el
+++ b/style/floatrow.el
@@ -58,8 +58,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -317,15 +318,15 @@
 			  (assq-delete-all (car (assoc key temp)) temp)))))
 	(cond ((string= key "precode")
 	       (dolist (x vcode-keys)
-		 (pushnew (list x (TeX-delete-duplicate-strings (append (list val) val-match)))
-			  opts :test #'equal)))
+		 (cl-pushnew (list x (TeX-delete-duplicate-strings (append (list val) val-match)))
+			     opts :test #'equal)))
 	      ((string= key "floatrowsep")
 	       (dolist (x sep-keys)
-		 (pushnew (list x (TeX-delete-duplicate-strings (append (list val) val-match)))
-			  opts :test #'equal)))
+		 (cl-pushnew (list x (TeX-delete-duplicate-strings (append (list val) val-match)))
+			     opts :test #'equal)))
 	      (t
-	       (pushnew (list key (TeX-delete-duplicate-strings (append (list val) val-match)))
-			opts :test #'equal)))
+	       (cl-pushnew (list key (TeX-delete-duplicate-strings (append (list val) val-match)))
+			   opts :test #'equal)))
 	(setq LaTeX-floatrow-key-val-options-local (copy-alist opts))))))
 
 (defun LaTeX-floatrow-arg-floatbox (optional)
diff --git a/style/fvextra.el b/style/fvextra.el
index eeb7d37a..7f49d6cc 100644
--- a/style/fvextra.el
+++ b/style/fvextra.el
@@ -31,8 +31,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 (defvar LaTeX-fvextra-key-val-options
   '(;; 3 General options
@@ -99,8 +100,8 @@
       (dolist (x keys)
 	(setq tmp (assq-delete-all (car (assoc x tmp)) tmp))
 	(if (string= x "highlightcolor")
-	    (pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test #'equal)
-	  (pushnew (list x (append '("none") (mapcar #'car (funcall colorcmd)))) tmp :test #'equal)))
+	    (cl-pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test #'equal)
+	  (cl-pushnew (list x (append '("none") (mapcar #'car (funcall colorcmd)))) tmp :test #'equal)))
       (setq LaTeX-fancyvrb-key-val-options-local
 	    (copy-alist tmp)))))
 
diff --git a/style/listings.el b/style/listings.el
index 73ddc00f..52adba34 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -40,8 +40,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; The following are options taken from chapter 4 of the listings
 ;; manual (2007/02/22 Version 1.4).
@@ -284,9 +285,9 @@ with user-defined values via the \"lstdefinestyle\" macro."
 	 (key (car elt))
 	 (temp (copy-alist LaTeX-listings-key-val-options-local))
 	 (opts (assq-delete-all (car (assoc key temp)) temp)))
-    (pushnew (list key (TeX-delete-duplicate-strings
-			(mapcar #'car (LaTeX-listings-lstdefinestyle-list))))
-	     opts :test #'equal)
+    (cl-pushnew (list key (TeX-delete-duplicate-strings
+			   (mapcar #'car (LaTeX-listings-lstdefinestyle-list))))
+	        opts :test #'equal)
     (setq LaTeX-listings-key-val-options-local
 	  (copy-alist opts))))
 
diff --git a/style/mdframed.el b/style/mdframed.el
index cd26e3fd..ed643dac 100644
--- a/style/mdframed.el
+++ b/style/mdframed.el
@@ -37,8 +37,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -214,9 +215,9 @@
 	   (val (cadr (assoc "style" LaTeX-mdframed-key-val-options)))
 	   (temp (copy-alist LaTeX-mdframed-key-val-options-local))
 	   (opts (assq-delete-all (car (assoc key temp)) temp)))
-      (pushnew (list key (TeX-delete-duplicate-strings
-			  (append val (mapcar #'car (LaTeX-mdframed-mdfdefinestyle-list)))))
-	       opts :test #'equal)
+      (cl-pushnew (list key (TeX-delete-duplicate-strings
+			     (append val (mapcar #'car (LaTeX-mdframed-mdfdefinestyle-list)))))
+	          opts :test #'equal)
       (setq LaTeX-mdframed-key-val-options-local
 	    (copy-alist opts))))
   ;;
@@ -242,7 +243,7 @@
 	   (tmp (copy-alist LaTeX-mdframed-key-val-options-local)))
       (dolist (x keys)
 	(setq tmp (assq-delete-all (car (assoc x tmp)) tmp))
-	(pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test #'equal))
+	(cl-pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test #'equal))
       (setq LaTeX-mdframed-key-val-options-local
 	    (copy-alist tmp)))))
 
diff --git a/style/tcolorbox.el b/style/tcolorbox.el
index 6805983b..b8e65122 100644
--- a/style/tcolorbox.el
+++ b/style/tcolorbox.el
@@ -40,8 +40,9 @@
 
 ;;; Code:
 
-;; Needed for compiling `pushnew':
-(eval-when-compile (require 'cl))
+;; Needed for compiling `cl-pushnew':
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Needed for auto-parsing.
 (require 'tex)
@@ -476,7 +477,7 @@ e.g. \"tcolorboxlib-raster.el\"."
 	 (tmp (copy-alist LaTeX-tcolorbox-keyval-options-local)))
     (dolist (key keys)
       (setq tmp (assq-delete-all (car (assoc key tmp)) tmp))
-      (pushnew
+      (cl-pushnew
        (list key (mapcar #'car (LaTeX-xcolor-definecolor-list))) tmp :test #'equal))
     (setq LaTeX-tcolorbox-keyval-options-local (copy-alist tmp)))
   (setq LaTeX-tcolorbox-keyval-options-full
-- 
2.16.1



[0001-Replace-cl-with-cl-lib.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Mosè Giordano <mose <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 30424-done <at> debbugs.gnu.org
Subject: Re: bug#30424: [patch] replace cl with cl-lib
Date: Sat, 17 Feb 2018 19:54:50 +0100
Hi Alex,

patch installed, thanks!

2018-02-16 16:05 GMT+01:00 Alex Branham <alex.branham <at> gmail.com>:
> Yes, that's right. I noticed a few comments like, "FIXME use cl-lib
> instead of cl" when writing the flymake support and decided that it
> would be a pretty easy fix for me to contribute.

Good idea, I think those are cookies left by Stefan :-)

Bye,
Mosè


This bug report was last modified 7 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.