emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/comp-run 9b2bc295dba 2/3: * comp: make comp-run don't require cl


From: Andrea Corallo
Subject: scratch/comp-run 9b2bc295dba 2/3: * comp: make comp-run don't require cl-lib at runtime
Date: Fri, 3 Nov 2023 13:57:14 -0400 (EDT)

branch: scratch/comp-run
commit 9b2bc295dba41143a202fee6099de5c43e7c47f5
Author: Andrea Corallo <acorallo@gnu.org>
Commit: Andrea Corallo <acorallo@gnu.org>

    * comp: make comp-run don't require cl-lib at runtime
    
    * lisp/emacs-lisp/comp-run.el (cl-lib): Require it only at compile
    time.
    (native-compile-async-skip-p): Use 'seq-some'.
    (native--compile-async): Don't use 'cl-substitute'.
---
 lisp/emacs-lisp/comp-run.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el
index bf54c64dd68..9ea770135c1 100644
--- a/lisp/emacs-lisp/comp-run.el
+++ b/lisp/emacs-lisp/comp-run.el
@@ -31,7 +31,7 @@
 
 ;;; Code:
 
-(require 'cl-lib)
+(eval-when-compile (require 'cl-lib))
 (require 'warnings)
 
 (defgroup comp-run nil
@@ -209,7 +209,7 @@ LOAD and SELECTOR work as described in 
`native--compile-async'."
       ;; any of the regexps in
       ;; `native-comp-jit-compilation-deny-list' matches.
       (and (eq load 'late)
-           (cl-some (lambda (re)
+           (seq-some (lambda (re)
                       (string-match-p re file))
                     native-comp-jit-compilation-deny-list))))
 
@@ -433,14 +433,18 @@ bytecode definition was not changed in the meantime)."
             (t (signal 'native-compiler-error
                        (list "Not a file nor directory" file-or-dir)))))
     (dolist (file file-list)
-      (if-let ((entry (cl-find file comp-files-queue :key #'car :test 
#'string=)))
+      (if-let ((entry (seq-find (lambda (x) (string= file (car x))) 
comp-files-queue)))
           ;; Most likely the byte-compiler has requested a deferred
           ;; compilation, so update `comp-files-queue' to reflect that.
           (unless (or (null load)
                       (eq load (cdr entry)))
             (setf comp-files-queue
-                  (cl-substitute (cons file load) (car entry) comp-files-queue
-                                 :key #'car :test #'string=)))
+                  (cl-loop for i in comp-files-queue
+                           with old = (car entry)
+                           if (string= (car i) old)
+                             collect (cons file load)
+                           else
+                             collect i)))
 
         (unless (native-compile-async-skip-p file load selector)
           (let* ((out-filename (comp-el-to-eln-filename file))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]