From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 12:28:04 2024 Received: (at submit) by debbugs.gnu.org; 27 May 2024 16:28:04 +0000 Received: from localhost ([127.0.0.1]:45121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBdCb-0006HD-VG for submit@debbugs.gnu.org; Mon, 27 May 2024 12:28:03 -0400 Received: from lists.gnu.org ([209.51.188.17]:32870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBci8-0002hT-0k for submit@debbugs.gnu.org; Mon, 27 May 2024 11:56:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBchy-0004tU-Sv for bug-gnu-emacs@gnu.org; Mon, 27 May 2024 11:56:22 -0400 Received: from mx.sdf.org ([205.166.94.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBchv-00079B-7Y for bug-gnu-emacs@gnu.org; Mon, 27 May 2024 11:56:22 -0400 Received: from localhost (89-80-25-212.abo.bbox.fr [89.80.25.212]) (authenticated (0 bits)) by mx.sdf.org (8.16.1/8.14.3) with ESMTPSA id 44RFuEFb004045 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Mon, 27 May 2024 15:56:15 GMT From: Davide Pola To: bug-gnu-emacs@gnu.org Subject: 30.0.50; [PATCH] rename comp-run.el and comp-cstr.el private functions Date: Mon, 27 May 2024 17:56:08 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=205.166.94.24; envelope-from=dpo@sdf.org; helo=mx.sdf.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 27 May 2024 12:27:58 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Hi, Here's a patch to refactor some functions in lisp/emacs-lisp/comp-run.el and lisp/emacs-lisp/comp-run.el . P.S. first time contributing here. I hope I haven't messed up anything in the process. Davide --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-rename-comp-run.el-and-comp-cstr.el-private-function.patch >From 399929cd07245705dc2b6bf4e1a549a52cbc6ff9 Mon Sep 17 00:00:00 2001 From: Davide Pola Date: Fri, 24 May 2024 15:28:04 +0200 Subject: [PATCH] Rename comp-run.el and comp-cstr.el private functions * lisp/emacs-lisp/comp-run.el (native-compile-async-skip-p) (comp-async-runnings, comp-effective-async-max-jobs) (comp-accept-and-process-async-output, comp-run-async-workers) (comp-trampoline-search): * lisp/emacs-lisp/comp-cstr.el (comp-cstr-copy, comp-cstrs-homogeneous, comp-split-pos-neg) (comp-normalize-valset, comp-union-valsets) (comp-intersection-valsets, comp-normalize-typeset) (comp-union-typesets, comp-intersect-two-typesets) (comp-intersect-typesets, comp-range-union) (comp-range-intersection, comp-range-negation, comp-cstr-add-2) (comp-cstr-sub-2, comp-cstr-union-homogeneous-no-range) (comp-cstr-union-homogeneous, comp-cstr-union-1-no-mem) (comp-cstr-union-1, comp-cstr-union-make) (comp-cstr-intersection-make): rename using -- separator convention for private functions --- lisp/emacs-lisp/comp-cstr.el | 140 +++++++++++++++++------------------ lisp/emacs-lisp/comp-run.el | 32 ++++---- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index b13c63a2a08..b679a1b476f 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -117,7 +117,7 @@ comp-cstr-ctxt :documentation "Hash pred -> type.") (union-typesets-mem (make-hash-table :test #'equal) :type hash-table :documentation "Serve memoization for -`comp-union-typesets'.") +`comp--union-typesets'.") ;; TODO we should be able to just cons hash this. (common-supertype-mem (make-hash-table :test #'equal) :type hash-table :documentation "Serve memoization for @@ -127,10 +127,10 @@ comp-cstr-ctxt `comp-cstr-ctxt-subtype-p-mem'.") (union-1-mem-no-range (make-hash-table :test #'equal) :type hash-table :documentation "Serve memoization for -`comp-cstr-union-1'.") +`comp--cstr-union-1'.") (union-1-mem-range (make-hash-table :test #'equal) :type hash-table :documentation "Serve memoization for -`comp-cstr-union-1'.") +`comp--cstr-union-1'.") (intersection-mem (make-hash-table :test #'equal) :type hash-table :documentation "Serve memoization for `intersection-mem'.")) @@ -158,7 +158,7 @@ with-comp-cstr-accessors `(comp-cstr-neg ,x))) ,@body)) -(defun comp-cstr-copy (cstr) +(defun comp--cstr-copy (cstr) "Return a deep copy of CSTR." (with-comp-cstr-accessors (make-comp-cstr :typeset (copy-sequence (typeset cstr)) @@ -190,7 +190,7 @@ comp-cstr-null-p (null (neg cstr)) (equal (valset cstr) '(nil))))) -(defun comp-cstrs-homogeneous (cstrs) +(defun comp--cstrs-homogeneous (cstrs) "Check if constraints CSTRS are all homogeneously negated or non-negated. Return `pos' if they are all positive, `neg' if they are all negated or nil otherwise." @@ -205,7 +205,7 @@ comp-cstrs-homogeneous ((zerop n-neg) (cl-return 'pos)) ((zerop n-pos) (cl-return 'neg))))) -(defun comp-split-pos-neg (cstrs) +(defun comp--split-pos-neg (cstrs) "Split constraints CSTRS into non-negated and negated. Return them as multiple value." (cl-loop @@ -229,7 +229,7 @@ comp-cstr-t ;;; Value handling. -(defun comp-normalize-valset (valset) +(defun comp--normalize-valset (valset) "Sort and remove duplicates from VALSET then return it." (cl-sort (cl-remove-duplicates valset :test #'eq) (lambda (x y) @@ -246,13 +246,13 @@ comp-normalize-valset (< (sxhash-equal x) (sxhash-equal y))))))) -(defun comp-union-valsets (&rest valsets) +(defun comp--union-valsets (&rest valsets) "Union values present into VALSETS." - (comp-normalize-valset (cl-reduce #'cl-union valsets))) + (comp--normalize-valset (cl-reduce #'cl-union valsets))) -(defun comp-intersection-valsets (&rest valsets) +(defun comp--intersection-valsets (&rest valsets) "Union values present into VALSETS." - (comp-normalize-valset (cl-reduce #'cl-intersection valsets))) + (comp--normalize-valset (cl-reduce #'cl-intersection valsets))) ;;; Type handling. @@ -305,7 +305,7 @@ comp--normalize-typeset0 (cl-return-from main 'restart))))) typeset)) -(defun comp-normalize-typeset (typeset) +(defun comp--normalize-typeset (typeset) "Sort TYPESET and return it." (cl-sort (comp--normalize-typeset0 (cl-remove-duplicates typeset)) #'comp--sym-lessp)) @@ -338,7 +338,7 @@ comp-supertypes (or (assq type (comp-cstr-ctxt-typeof-types comp-ctxt)) (error "Type %S missing from typeof-types!" type))) -(defun comp-union-typesets (&rest typesets) +(defun comp--union-typesets (&rest typesets) "Union types present into TYPESETS." (or (gethash typesets (comp-cstr-ctxt-union-typesets-mem comp-ctxt)) (puthash typesets @@ -355,10 +355,10 @@ comp-union-typesets ;; the other types. unless (comp--intersection types res) do (push (car types) res) - finally return (comp-normalize-typeset res)) + finally return (comp--normalize-typeset res)) (comp-cstr-ctxt-union-typesets-mem comp-ctxt)))) -(defun comp-intersect-two-typesets (t1 t2) +(defun comp--intersect-two-typesets (t1 t2) "Intersect typesets T1 and T2." (with-comp-cstr-accessors (cl-loop @@ -372,13 +372,13 @@ comp-intersect-two-typesets other-types) collect type)))) -(defun comp-intersect-typesets (&rest typesets) +(defun comp--intersect-typesets (&rest typesets) "Intersect types present into TYPESETS." (unless (cl-some #'null typesets) (if (length= typesets 1) (car typesets) - (comp-normalize-typeset - (cl-reduce #'comp-intersect-two-typesets typesets))))) + (comp--normalize-typeset + (cl-reduce #'comp--intersect-two-typesets typesets))))) ;;; Integer range handling @@ -428,7 +428,7 @@ comp-cstr-greatest-in-range "Greater entry in RANGE." (cdar (last range))) -(defun comp-range-union (&rest ranges) +(defun comp--range-union (&rest ranges) "Combine integer intervals RANGES by union set operation." (cl-loop with all-ranges = (apply #'append ranges) @@ -454,7 +454,7 @@ comp-range-union (cl-decf nest) finally return (reverse res))) -(defun comp-range-intersection (&rest ranges) +(defun comp--range-intersection (&rest ranges) "Combine integer intervals RANGES by intersecting." (cl-loop with all-ranges = (apply #'append ranges) @@ -486,7 +486,7 @@ comp-range-intersection (cl-decf nest) finally return (reverse res))) -(defun comp-range-negation (range) +(defun comp--range-negation (range) "Negate range RANGE." (if (null range) '((- . +)) @@ -512,15 +512,15 @@ comp-cstr-set-cmp-range '(float)) (valset dst) () (range dst) (if (range old-dst) - (comp-range-intersection (range old-dst) + (comp--range-intersection (range old-dst) ext-range) ext-range) (neg dst) nil) (comp-cstr-shallow-copy dst old-dst)))) (defmacro comp-cstr-set-range-for-arithm (dst src1 src2 &rest range-body) - ;; Prevent some code duplication for `comp-cstr-add-2' - ;; `comp-cstr-sub-2'. + ;; Prevent some code duplication for `comp--cstr-add-2' + ;; `comp--cstr-sub-2'. (declare (debug (range-body)) (indent defun)) `(with-comp-cstr-accessors @@ -539,12 +539,12 @@ comp-cstr-set-range-for-arithm '(float)) (range ,dst) ,@range-body)))))) -(defun comp-cstr-add-2 (dst src1 src2) +(defun comp--cstr-add-2 (dst src1 src2) "Sum SRC1 and SRC2 into DST." (comp-cstr-set-range-for-arithm dst src1 src2 `((,(comp-range-+ l1 l2) . ,(comp-range-+ h1 h2))))) -(defun comp-cstr-sub-2 (dst src1 src2) +(defun comp--cstr-sub-2 (dst src1 src2) "Subtract SRC1 and SRC2 into DST." (comp-cstr-set-range-for-arithm dst src1 src2 (let ((l (comp-range-- l1 h2)) @@ -556,17 +556,17 @@ comp-cstr-sub-2 ;;; Union specific code. -(defun comp-cstr-union-homogeneous-no-range (dst &rest srcs) +(defun comp--cstr-union-homogeneous-no-range (dst &rest srcs) "As `comp-cstr-union' but excluding the irange component. All SRCS constraints must be homogeneously negated or non-negated." ;; Type propagation. (setf (comp-cstr-typeset dst) - (apply #'comp-union-typesets (mapcar #'comp-cstr-typeset srcs))) + (apply #'comp--union-typesets (mapcar #'comp-cstr-typeset srcs))) ;; Value propagation. (setf (comp-cstr-valset dst) - (comp-normalize-valset + (comp--normalize-valset (cl-loop with values = (mapcar #'comp-cstr-valset srcs) ;; TODO sort. @@ -581,12 +581,12 @@ comp-cstr-union-homogeneous-no-range dst) -(defun comp-cstr-union-homogeneous (range dst &rest srcs) +(defun comp--cstr-union-homogeneous (range dst &rest srcs) "Combine SRCS by union set operation setting the result in DST. Do range propagation when RANGE is non-nil. All SRCS constraints must be homogeneously negated or non-negated. DST is returned." - (apply #'comp-cstr-union-homogeneous-no-range dst srcs) + (apply #'comp--cstr-union-homogeneous-no-range dst srcs) ;; Range propagation. (setf (comp-cstr-neg dst) (when srcs @@ -597,15 +597,15 @@ comp-cstr-union-homogeneous (comp-subtype-p 'integer x)) (comp-cstr-typeset dst)) (if range - (apply #'comp-range-union + (apply #'comp--range-union (mapcar #'comp-cstr-range srcs)) '((- . +))))) dst) -(cl-defun comp-cstr-union-1-no-mem (range &rest srcs) +(cl-defun comp--cstr-union-1-no-mem (range &rest srcs) "Combine SRCS by union set operation setting the result in DST. Do range propagation when RANGE is non-nil. -Non memoized version of `comp-cstr-union-1'. +Non memoized version of `comp--cstr-union-1'. DST is returned." (with-comp-cstr-accessors (let ((dst (make-comp-cstr))) @@ -614,22 +614,22 @@ comp-cstr-union-1-no-mem (valset dst) () (range dst) () (neg dst) nil) - (cl-return-from comp-cstr-union-1-no-mem dst))) + (cl-return-from comp--cstr-union-1-no-mem dst))) ;; Check first if we are in the simple case of all input non-negate ;; or negated so we don't have to cons. - (when-let ((res (comp-cstrs-homogeneous srcs))) - (apply #'comp-cstr-union-homogeneous range dst srcs) - (cl-return-from comp-cstr-union-1-no-mem dst)) + (when-let ((res (comp--cstrs-homogeneous srcs))) + (apply #'comp--cstr-union-homogeneous range dst srcs) + (cl-return-from comp--cstr-union-1-no-mem dst)) ;; Some are negated and some are not - (cl-multiple-value-bind (positives negatives) (comp-split-pos-neg srcs) - (let* ((pos (apply #'comp-cstr-union-homogeneous range + (cl-multiple-value-bind (positives negatives) (comp--split-pos-neg srcs) + (let* ((pos (apply #'comp--cstr-union-homogeneous range (make-comp-cstr) positives)) ;; We'll always use neg as result as this is almost ;; always necessary for describing open intervals ;; resulting from negated constraints. - (neg (apply #'comp-cstr-union-homogeneous range + (neg (apply #'comp--cstr-union-homogeneous range (make-comp-cstr :neg t) negatives))) ;; Type propagation. (when (and (typeset pos) @@ -660,7 +660,7 @@ comp-cstr-union-1-no-mem (typeset neg))) (comp-cstr-shallow-copy dst pos) (setf (neg dst) nil) - (cl-return-from comp-cstr-union-1-no-mem dst)) + (cl-return-from comp--cstr-union-1-no-mem dst)) ;; Verify disjoint condition between positive types and ;; negative types coming from values, in case give-up. @@ -678,7 +678,7 @@ comp-cstr-union-1-no-mem ;; Value propagation. (cond ((and (valset pos) (valset neg) - (equal (comp-union-valsets (valset pos) (valset neg)) + (equal (comp--union-valsets (valset pos) (valset neg)) (valset pos))) ;; Pos is a superset of neg. (give-up)) @@ -701,9 +701,9 @@ comp-cstr-union-1-no-mem (equal (range pos) (range neg))) (give-up) (setf (range neg) - (comp-range-negation - (comp-range-union - (comp-range-negation (range neg)) + (comp--range-negation + (comp--range-union + (comp--range-negation (range neg)) (range pos)))))) (comp-cstr-shallow-copy dst (if (comp-cstr-empty-p neg) @@ -719,7 +719,7 @@ comp-cstr-union-1-no-mem dst))) -(defun comp-cstr-union-1 (range dst &rest srcs) +(defun comp--cstr-union-1 (range dst &rest srcs) "Combine SRCS by union set operation setting the result in DST. Do range propagation when RANGE is non-nil. DST is returned." @@ -729,8 +729,8 @@ comp-cstr-union-1 (comp-cstr-ctxt-union-1-mem-no-range comp-ctxt))) (res (or (gethash srcs mem-h) (puthash - (mapcar #'comp-cstr-copy srcs) - (apply #'comp-cstr-union-1-no-mem range srcs) + (mapcar #'comp--cstr-copy srcs) + (apply #'comp--cstr-union-1-no-mem range srcs) mem-h)))) (comp-cstr-shallow-copy dst res) res))) @@ -752,12 +752,12 @@ comp-cstr-intersection-homogeneous ;; Type propagation. (setf (typeset dst) - (apply #'comp-intersect-typesets + (apply #'comp--intersect-typesets (mapcar #'comp-cstr-typeset srcs))) ;; Value propagation. (setf (valset dst) - (comp-normalize-valset + (comp--normalize-valset (cl-loop for src in srcs append @@ -780,7 +780,7 @@ comp-cstr-intersection-homogeneous (unless (cl-some (lambda (type) (comp-subtype-p 'integer type)) (typeset dst)) - (apply #'comp-range-intersection + (apply #'comp--range-intersection (cl-loop for src in srcs ;; Collect effective ranges. @@ -803,14 +803,14 @@ comp-cstr-intersection-no-mem (range dst) () (neg dst) nil) (cl-return-from comp-cstr-intersection-no-mem dst))) - (when-let ((res (comp-cstrs-homogeneous srcs))) + (when-let ((res (comp--cstrs-homogeneous srcs))) (if (eq res 'neg) - (apply #'comp-cstr-union-homogeneous t dst srcs) + (apply #'comp--cstr-union-homogeneous t dst srcs) (apply #'comp-cstr-intersection-homogeneous dst srcs)) (cl-return-from comp-cstr-intersection-no-mem dst)) ;; Some are negated and some are not - (cl-multiple-value-bind (positives negatives) (comp-split-pos-neg srcs) + (cl-multiple-value-bind (positives negatives) (comp--split-pos-neg srcs) (let* ((pos (apply #'comp-cstr-intersection-homogeneous (make-comp-cstr) positives)) (neg (apply #'comp-cstr-intersection-homogeneous @@ -858,8 +858,8 @@ comp-cstr-intersection-no-mem do (setf found t)))) (setf (range pos) - (comp-range-intersection (range pos) - (comp-range-negation (range neg))) + (comp--range-intersection (range pos) + (comp--range-negation (range neg))) (valset pos) (cl-set-difference (valset pos) (valset neg))) @@ -1072,30 +1072,30 @@ comp-cstr-<= (defun comp-cstr-add (dst srcs) "Sum SRCS into DST." - (comp-cstr-add-2 dst (cl-first srcs) (cl-second srcs)) + (comp--cstr-add-2 dst (cl-first srcs) (cl-second srcs)) (cl-loop for src in (nthcdr 2 srcs) - do (comp-cstr-add-2 dst dst src))) + do (comp--cstr-add-2 dst dst src))) (defun comp-cstr-sub (dst srcs) "Subtract SRCS into DST." - (comp-cstr-sub-2 dst (cl-first srcs) (cl-second srcs)) + (comp--cstr-sub-2 dst (cl-first srcs) (cl-second srcs)) (cl-loop for src in (nthcdr 2 srcs) - do (comp-cstr-sub-2 dst dst src))) + do (comp--cstr-sub-2 dst dst src))) (defun comp-cstr-union-no-range (dst &rest srcs) "Combine SRCS by union set operation setting the result in DST. Do not propagate the range component. DST is returned." - (apply #'comp-cstr-union-1 nil dst srcs)) + (apply #'comp--cstr-union-1 nil dst srcs)) (defun comp-cstr-union (dst &rest srcs) "Combine SRCS by union set operation setting the result in DST. DST is returned." - (apply #'comp-cstr-union-1 t dst srcs)) + (apply #'comp--cstr-union-1 t dst srcs)) -(defun comp-cstr-union-make (&rest srcs) +(defun comp--cstr-union-make (&rest srcs) "Combine SRCS by union set operation and return a new constraint." (apply #'comp-cstr-union (make-comp-cstr) srcs)) @@ -1106,7 +1106,7 @@ comp-cstr-intersection (let* ((mem-h (comp-cstr-ctxt-intersection-mem comp-ctxt)) (res (or (gethash srcs mem-h) (puthash - (mapcar #'comp-cstr-copy srcs) + (mapcar #'comp--cstr-copy srcs) (apply #'comp-cstr-intersection-no-mem srcs) mem-h)))) (comp-cstr-shallow-copy dst res) @@ -1132,7 +1132,7 @@ comp-cstr-intersection-no-hashcons do (push v strip-values) (push (cl-type-of v) strip-types)) (when strip-values - (setf (typeset dst) (comp-union-typesets (typeset dst) strip-types) + (setf (typeset dst) (comp--union-typesets (typeset dst) strip-types) (valset dst) (cl-set-difference (valset dst) strip-values))) (cl-loop for (l . h) in (range dst) when (or (bignump l) (bignump h)) @@ -1140,7 +1140,7 @@ comp-cstr-intersection-no-hashcons (cl-return)))) dst)) -(defun comp-cstr-intersection-make (&rest srcs) +(defun comp--cstr-intersection-make (&rest srcs) "Combine SRCS by intersection set operation and return a new constraint." (apply #'comp-cstr-intersection (make-comp-cstr) srcs)) @@ -1208,10 +1208,10 @@ comp-type-spec-to-cstr ((pred atom) (comp--type-to-cstr type-spec)) (`(or . ,rest) - (apply #'comp-cstr-union-make + (apply #'comp--cstr-union-make (mapcar #'comp-type-spec-to-cstr rest))) (`(and . ,rest) - (apply #'comp-cstr-intersection-make + (apply #'comp--cstr-intersection-make (mapcar #'comp-type-spec-to-cstr rest))) (`(not ,cstr) (comp-cstr-negation-make (comp-type-spec-to-cstr cstr))) @@ -1225,7 +1225,7 @@ comp-type-spec-to-cstr ;; No float range support :/ (comp--type-to-cstr 'float)) (`(member . ,rest) - (apply #'comp-cstr-union-make (mapcar #'comp--value-to-cstr rest))) + (apply #'comp--cstr-union-make (mapcar #'comp--value-to-cstr rest))) (`(function ,args ,ret) (make-comp-cstr-f :args (mapcar (lambda (x) diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el index 5cc61579030..b45ba41c637 100644 --- a/lisp/emacs-lisp/comp-run.el +++ b/lisp/emacs-lisp/comp-run.el @@ -138,7 +138,7 @@ native-comp-enable-subr-trampolines (declare-function comp-el-to-eln-filename "comp.c") (declare-function native-elisp-load "comp.c") -(defun native-compile-async-skip-p (file load selector) +(defun native--compile-async-skip-p (file load selector) "Return non-nil if FILE's compilation should be skipped. LOAD and SELECTOR work as described in `native--compile-async'." @@ -164,7 +164,7 @@ comp-files-queue (defvar comp-async-compilations (make-hash-table :test #'equal) "Hash table file-name -> async compilation process.") -(defun comp-async-runnings () +(defun comp--async-runnings () "Return the number of async compilations currently running. This function has the side effect of cleaning-up finished processes from `comp-async-compilations'" @@ -178,7 +178,7 @@ comp-async-runnings (hash-table-count comp-async-compilations)) (defvar comp-num-cpus nil) -(defun comp-effective-async-max-jobs () +(defun comp--effective-async-max-jobs () "Compute the effective number of async jobs." (if (zerop native-comp-async-jobs-number) (or comp-num-cpus @@ -190,7 +190,7 @@ comp-last-scanned-async-output (make-variable-buffer-local 'comp-last-scanned-async-output) ;; From warnings.el (defvar warning-suppress-types) -(defun comp-accept-and-process-async-output (process) +(defun comp--accept-and-process-async-output (process) "Accept PROCESS output and check for diagnostic messages." (if native-comp-async-report-warnings-errors (let ((warning-suppress-types @@ -218,14 +218,14 @@ comp-accept-and-process-async-output (defconst comp-valid-source-re (rx ".el" (? ".gz") eos) "Regexp to match filename of valid input source files.") -(defun comp-run-async-workers () +(defun comp--run-async-workers () "Start compiling files from `comp-files-queue' asynchronously. When compilation is finished, run `native-comp-async-all-done-hook' and display a message." (cl-assert (null comp-no-spawn)) (if (or comp-files-queue - (> (comp-async-runnings) 0)) - (unless (>= (comp-async-runnings) (comp-effective-async-max-jobs)) + (> (comp--async-runnings) 0)) + (unless (>= (comp--async-runnings) (comp--effective-async-max-jobs)) (cl-loop for (source-file . load) = (pop comp-files-queue) while source-file @@ -312,7 +312,7 @@ comp-run-async-workers (run-hook-with-args 'native-comp-async-cu-done-functions source-file) - (comp-accept-and-process-async-output process) + (comp--accept-and-process-async-output process) (ignore-errors (delete-file temp-file)) (let ((eln-file (comp-el-to-eln-filename source-file1))) @@ -322,10 +322,10 @@ comp-run-async-workers (file-exists-p eln-file)) (native-elisp-load eln-file (eq load1 'late)))) - (comp-run-async-workers)) + (comp--run-async-workers)) :noquery (not native-comp-async-query-on-exit)))) (puthash source-file process comp-async-compilations)) - when (>= (comp-async-runnings) (comp-effective-async-max-jobs)) + when (>= (comp--async-runnings) (comp--effective-async-max-jobs)) do (cl-return))) ;; No files left to compile and all processes finished. (run-hooks 'native-comp-async-all-done-hook) @@ -348,7 +348,7 @@ comp-warn-primitives "List of primitives we want to warn about in case of redefinition. This are essential for the trampoline machinery to work properly.") -(defun comp-trampoline-search (subr-name) +(defun comp--trampoline-search (subr-name) "Search a trampoline file for SUBR-NAME. Return the trampoline if found or nil otherwise." (cl-loop @@ -371,7 +371,7 @@ comp-subr-trampoline-install (memq subr-name native-comp-never-optimize-functions) (gethash subr-name comp-installed-trampolines-h)) (cl-assert (subr-primitive-p subr)) - (when-let ((trampoline (or (comp-trampoline-search subr-name) + (when-let ((trampoline (or (comp--trampoline-search subr-name) (comp-trampoline-compile subr-name)))) (comp--install-trampoline subr-name trampoline))))) @@ -437,7 +437,7 @@ native--compile-async else collect i))) - (unless (native-compile-async-skip-p file load selector) + (unless (native--compile-async-skip-p file load selector) (let* ((out-filename (comp-el-to-eln-filename file)) (out-dir (file-name-directory out-filename))) (unless (file-exists-p out-dir) @@ -449,11 +449,11 @@ native--compile-async (display-warning 'comp (format "No write access for %s skipping." out-filename))))))) - ;; Perhaps nothing passed `native-compile-async-skip-p'? + ;; Perhaps nothing passed `native--compile-async-skip-p'? (when (and added-something ;; Don't start if there's one already running. - (zerop (comp-async-runnings))) - (comp-run-async-workers)))) + (zerop (comp--async-runnings))) + (comp--run-async-workers)))) ;;;###autoload (defun native-compile-async (files &optional recursively load selector) -- 2.39.3 (Apple Git-146) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 13:31:12 2024 Received: (at 71229) by debbugs.gnu.org; 27 May 2024 17:31:12 +0000 Received: from localhost ([127.0.0.1]:45159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBeBk-0007r6-DC for submit@debbugs.gnu.org; Mon, 27 May 2024 13:31:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBeBi-0007qq-H7 for 71229@debbugs.gnu.org; Mon, 27 May 2024 13:31:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBeBT-0006x9-Tq; Mon, 27 May 2024 13:30:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=XTejYzJxxJEla77DY5fuIRsqLhFxTsaxseqEtuuS6Jw=; b=monNHDqqSDj3oxRkNSFx nOzFbyaR+VoCayu1qhIwKf/+7JZl2eOkBzW06IEBclFA/15xIYAF/DpjuFsXWwa4M/Gm/1tjmtMh5 HRNjp4N3WYWMIdf0xM3IuZ0PXvDJOaGCAikUiGN6nmwiVjMOeAGQrpVD46BtfZkkkmMtu/B0TJMYZ 0qyRGzHSnHCfmvmBR7t5WYkLKx+5Xk+21aPs+VvIHUnK0Ejtv7x1OQCSyPnUYePE1iLvhWkaNT8Ge pzWMLvWaBSVy/5rdQAPlj+VBX9/EL0vb56vVITvTQ9nYylddRLva7Fxxat6Vn+vOos4AjOCVOydm0 ZIl2nHJ/dJzwKA==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sBeBS-0005Vj-TE; Mon, 27 May 2024 13:30:55 -0400 From: Andrea Corallo To: 71229@debbugs.gnu.org Subject: Re: bug#71229: 30.0.50; [PATCH] rename comp-run.el and comp-cstr.el private functions In-Reply-To: (Davide Pola via's message of "Mon, 27 May 2024 17:56:08 +0200") References: Date: Mon, 27 May 2024 13:30:54 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71229 Cc: Davide Pola X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Davide Pola via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Hi, > > Here's a patch to refactor some functions in lisp/emacs-lisp/comp-run.el > and lisp/emacs-lisp/comp-run.el . > > P.S. first time contributing here. I hope I haven't messed up anything in > the process. > > Davide Hi Davide, thanks for the patch, ATM I don't see you in copyright.list but AFAIR you already started the copyright paperwork with FSF. Please let me know when the process is completed (or ping me if it's stuck) so we can proceed. Best Regards Andrea From debbugs-submit-bounces@debbugs.gnu.org Wed May 29 11:47:53 2024 Received: (at 71229-done) by debbugs.gnu.org; 29 May 2024 15:47:53 +0000 Received: from localhost ([127.0.0.1]:41482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCLWr-0005BS-5V for submit@debbugs.gnu.org; Wed, 29 May 2024 11:47:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCLWo-0005B8-Gb for 71229-done@debbugs.gnu.org; Wed, 29 May 2024 11:47:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCLWX-0007c7-74; Wed, 29 May 2024 11:47:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=p9UzgJMW6d3DXUqGRjihJob19JSPmFY8EB9oB+EY7w8=; b=S5eJGTSkke/KNc87cnjK oRwfEvOMIf9W642aZS6JqZgNLP3uwzAyNFzxOQhw8z53UyPsH5f/GNhfgHxh5WU0dCXQrAPvLe57k 3z5O0Q1Wonia1zzQuxtMbqr9cZ0svIWXal6hmmBbliDWPkUueGCDi1oEg4v9cHDo0zwhYaZCdljPU IZpWP6v18IyopXs0ZgraP05p4Z2Dq29hkKXdaUdosMj6wXyK9lLmOUj2Qljfy02pjC3B9q48wHf8H ms1H90/YVyMB7MjE5eHLR7ywMklHWO9rtmxi+aS1rVu/D3mRLY31ENNHqH3aMUrnAnt53JEbKc7OQ C4HX6CNPNpwQ3A==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sCLWU-0002sR-Nw; Wed, 29 May 2024 11:47:32 -0400 From: Andrea Corallo To: 71229-done@debbugs.gnu.org Subject: Re: bug#71229: 30.0.50; [PATCH] rename comp-run.el and comp-cstr.el private functions In-Reply-To: (Andrea Corallo's message of "Mon, 27 May 2024 13:30:54 -0400") References: Date: Wed, 29 May 2024 11:47:30 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71229-done Cc: Davide Pola X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Andrea Corallo writes: > Davide Pola via "Bug reports for GNU Emacs, the Swiss army knife of text > editors" writes: > >> Hi, >> >> Here's a patch to refactor some functions in lisp/emacs-lisp/comp-run.el >> and lisp/emacs-lisp/comp-run.el . >> >> P.S. first time contributing here. I hope I haven't messed up anything in >> the process. >> >> Davide > > Hi Davide, > > thanks for the patch, ATM I don't see you in copyright.list but AFAIR > you already started the copyright paperwork with FSF. > > Please let me know when the process is completed (or ping me if it's > stuck) so we can proceed. Okay I pushed your patch to master with a nit change to the Changelog entry. Thanks for picking this up, closing. Andrea From unknown Sat Jun 21 10:26:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 27 Jun 2024 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator