From: Stefan Kangas Date: Sat, 22 Feb 2025 23:13:21 +0000 (+0100) Subject: Prefer incf to cl-incf in emacs-lisp/*.el X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=703dfe92a070119bdf7a0b47c755853f429d0d1e;p=emacs.git Prefer incf to cl-incf in emacs-lisp/*.el * lisp/emacs-lisp/backtrace.el (backtrace--print-func-and-args): * lisp/emacs-lisp/bindat.el (bindat--type): * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): * lisp/emacs-lisp/chart.el (chart-file-count): * lisp/emacs-lisp/cl-extra.el (cl-parse-integer, cl--print-table): * lisp/emacs-lisp/cl-generic.el (cl--defmethod-doc-pos): * lisp/emacs-lisp/cl-indent.el (common-lisp-loop-part-indentation) (common-lisp-indent-function-1, lisp-indent-defmethod): * lisp/emacs-lisp/cl-lib.el (cl--set-substring): * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): * lisp/emacs-lisp/cl-print.el (cl-print--cons-tail) (cl-print--vector-contents, cl-print--struct-contents) (cl-print--string-props): * lisp/emacs-lisp/cl-seq.el (cl-substitute): * lisp/emacs-lisp/comp-cstr.el (comp--range-union) (comp--range-intersection): * lisp/emacs-lisp/comp.el (comp-vec-append, comp--gen-counter) (comp--op-case, comp--limplify-lap-inst, comp--limplify-block) (comp--limplify-function, comp--maybe-add-vmvar, comp--fwprop*): * lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip): * lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): * lisp/emacs-lisp/elp.el (elp--make-wrapper): * lisp/emacs-lisp/ert-x.el (ert-kill-all-test-buffers): * lisp/emacs-lisp/ert.el (ert--stats-set-test-and-result) (ert-write-junit-test-summary-report): * lisp/emacs-lisp/memory-report.el (memory-report--symbol-plist) (memory-report--object-size-1): * lisp/emacs-lisp/oclosure.el (oclosure--index-table) (oclosure--define-functions): * lisp/emacs-lisp/package.el (package-menu--perform-transaction): * lisp/emacs-lisp/smie.el (smie-set-prec2tab, smie-prec2->grammar) (smie-config--guess, smie-config--guess-1): * lisp/emacs-lisp/syntax.el (syntax-propertize-rules) (syntax-ppss--update-stats): * lisp/emacs-lisp/track-changes.el (track-changes--after): Prefer incf to cl-incf. (cherry picked from commit ae37a1cc3d93d3703b43c5ab2d10f1f3e146cf90) --- diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el index aec6f420708..b395a13b0dd 100644 --- a/lisp/emacs-lisp/backtrace.el +++ b/lisp/emacs-lisp/backtrace.el @@ -750,7 +750,7 @@ Format it according to VIEW." (let ((fun-and-args (cons fun args))) (insert (backtrace--print-to-string fun-and-args))) ;; Skip the open-paren. - (cl-incf fun-beg))) + (incf fun-beg))) (when fun-file (make-text-button fun-beg (or fun-end diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index c70a7474cdc..c40cc0d53c8 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -682,7 +682,7 @@ is the name of a variable that will hold the value we need to pack.") (cl-defmethod bindat--type (op (_ (eql 'byte))) (bindat--pcase op ('unpack `(bindat--unpack-u8)) - (`(length . ,_) `(cl-incf bindat-idx 1)) + (`(length . ,_) `(incf bindat-idx 1)) (`(pack . ,args) `(bindat--pack-u8 . ,args)))) (cl-defmethod bindat--type (op (_ (eql 'uint)) n &optional le) @@ -690,7 +690,7 @@ is the name of a variable that will hold the value we need to pack.") (bindat--pcase op ('unpack `(if ,le (bindat--unpack-uintr ,n) (bindat--unpack-uint ,n))) - (`(length . ,_) `(cl-incf bindat-idx (/ ,n 8))) + (`(length . ,_) `(incf bindat-idx (/ ,n 8))) (`(pack . ,args) `(if ,le (bindat--pack-uintr ,n . ,args) (bindat--pack-uint ,n . ,args)))))) @@ -698,14 +698,14 @@ is the name of a variable that will hold the value we need to pack.") (cl-defmethod bindat--type (op (_ (eql 'str)) len) (bindat--pcase op ('unpack `(bindat--unpack-str ,len)) - (`(length . ,_) `(cl-incf bindat-idx ,len)) + (`(length . ,_) `(incf bindat-idx ,len)) (`(pack . ,args) `(bindat--pack-str ,len . ,args)))) (cl-defmethod bindat--type (op (_ (eql 'strz)) &optional len) (bindat--pcase op ('unpack `(bindat--unpack-strz ,len)) (`(length ,val) - `(cl-incf bindat-idx ,(cond + `(incf bindat-idx ,(cond ;; Optimizations if len is a literal number or nil. ((null len) `(1+ (length ,val))) ((numberp len) len) @@ -716,11 +716,11 @@ is the name of a variable that will hold the value we need to pack.") (cl-defmethod bindat--type (op (_ (eql 'bits)) len) (bindat--pcase op ('unpack `(bindat--unpack-bits ,len)) - (`(length . ,_) `(cl-incf bindat-idx ,len)) + (`(length . ,_) `(incf bindat-idx ,len)) (`(pack . ,args) `(bindat--pack-bits ,len . ,args)))) (cl-defmethod bindat--type (_op (_ (eql 'fill)) len) - `(progn (cl-incf bindat-idx ,len) nil)) + `(progn (incf bindat-idx ,len) nil)) (cl-defmethod bindat--type (_op (_ (eql 'align)) len) `(progn (cl-callf bindat--align bindat-idx ,len) nil)) @@ -747,7 +747,7 @@ is the name of a variable that will hold the value we need to pack.") (let `#'(lambda (,val) (setq bindat-idx (+ bindat-idx ,len))) fun) (guard (not (macroexp--fgrep `((,val)) len)))) ;; Optimize the case where the size of each element is constant. - `(cl-incf bindat-idx (* ,count ,len))) + `(incf bindat-idx (* ,count ,len))) ;; FIXME: It's tempting to use `(mapc (lambda (,val) ,exp) ,val)' ;; which would be more efficient when `val' is a list, ;; but that's only right if length of `val' is indeed `count'. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 3484374be3f..c4d7ac0dfdd 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2065,7 +2065,7 @@ also be compiled." (not (member source (dir-locals--all-files directory))) ;; File is requested to be ignored (not (string-match-p ignore-files-regexp source))) - (progn (cl-incf + (progn (incf (pcase (byte-recompile-file source force arg) ('no-byte-compile skip-count) ('t file-count) diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 5c45dc7a75d..008b25e9f2f 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -633,7 +633,7 @@ argument to `chart-sort' to sort the lists if desired." (m (member s extlst))) (unless (null s) (if m - (cl-incf (car (nthcdr (- (length extlst) (length m)) cntlst))) + (incf (car (nthcdr (- (length extlst) (length m)) cntlst))) (setq extlst (cons s extlst) cntlst (cons 1 cntlst)))))) ;; Let's create the chart! diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 2d9b8d0b0f1..0ebc89a3287 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -441,8 +441,8 @@ as an integer unless JUNK-ALLOWED is non-nil." (setq start (1+ start))))) (skip-whitespace) (let ((sign (cl-case (and (< start end) (aref string start)) - (?+ (cl-incf start) +1) - (?- (cl-incf start) -1) + (?+ (incf start) +1) + (?- (incf start) -1) (t +1))) digit sum) (while (and (< start end) @@ -910,7 +910,7 @@ Call `cl--find-class' to get TYPE's propname `cl--class'" `(space :align-to ,(+ col col-space))) "%s") formats) - (cl-incf col (+ col-space (aref cols i)))) + (incf col (+ col-space (aref cols i)))) (let ((format (mapconcat #'identity (nreverse formats)))) (insert (apply #'format format (mapcar (lambda (str) (propertize str 'face 'italic)) diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 0fa29fd6c13..71538a653bc 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -509,7 +509,7 @@ Presumes point is at the end of the `cl-defmethod' symbol." (let ((n 2)) (while (and (ignore-errors (forward-sexp 1) t) (not (eq (char-before) ?\)))) - (cl-incf n)) + (incf n)) n))) ;;;###autoload diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index 0695edc3d12..5ea7015adf0 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -179,13 +179,13 @@ the standard Lisp indent package." (when (and (eq lisp-indent-backquote-substitution-mode 'corrected)) (save-excursion (goto-char (elt state 1)) - (cl-incf loop-indentation - (cond ((eq (char-before) ?,) -1) - ((and (eq (char-before) ?@) - (progn (backward-char) - (eq (char-before) ?,))) - -2) - (t 0))))) + (incf loop-indentation + (cond ((eq (char-before) ?,) -1) + ((and (eq (char-before) ?@) + (progn (backward-char) + (eq (char-before) ?,))) + -2) + (t 0))))) (goto-char indent-point) (beginning-of-line) @@ -400,9 +400,9 @@ instead." ;; ",(...)" or ",@(...)" (when (eq lisp-indent-backquote-substitution-mode 'corrected) - (cl-incf sexp-column -1) + (incf sexp-column -1) (when (eq (char-after (1- containing-sexp)) ?\@) - (cl-incf sexp-column -1))) + (incf sexp-column -1))) (cond (lisp-indent-backquote-substitution-mode (setf tentative-calculated normal-indent) (setq depth lisp-indent-maximum-backtracking) @@ -706,7 +706,7 @@ optional\\|rest\\|key\\|allow-other-keys\\|aux\\|whole\\|body\\|environment\ (forward-sexp 2) (skip-chars-forward " \t\n") (while (looking-at "\\sw\\|\\s_") - (cl-incf nqual) + (incf nqual) (forward-sexp) (skip-chars-forward " \t\n")) (> nqual 0))) diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 2ab2f9f9022..c4843573ecc 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -162,9 +162,9 @@ to an element already in the list stored in PLACE. val)) (defun cl--set-substring (str start end val) - (if end (if (< end 0) (cl-incf end (length str))) + (if end (if (< end 0) (incf end (length str))) (setq end (length str))) - (if (< start 0) (cl-incf start (length str))) + (if (< start 0) (incf start (length str))) (concat (and (> start 0) (substring str 0 start)) val (and (< end (length str)) (substring str end)))) @@ -448,7 +448,7 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp ;;With optional argument N, returns Nth-to-last link (default 1)." ;; (if n ;; (let ((m 0) (p x)) -;; (while (consp p) (cl-incf m) (pop p)) +;; (while (consp p) (incf m) (pop p)) ;; (if (<= n 0) p ;; (if (< n m) (nthcdr (- m n) x) x))) ;; (while (consp (cdr x)) (pop x)) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 58f65c1c7d1..48d8a9c9a7f 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -1598,12 +1598,12 @@ For more details, see Info node `(cl)Loop Facility'. ((memq word '(sum summing)) (let ((what (pop cl--loop-args)) (var (cl--loop-handle-accum 0))) - (push `(progn (cl-incf ,var ,what) t) cl--loop-body))) + (push `(progn (incf ,var ,what) t) cl--loop-body))) ((memq word '(count counting)) (let ((what (pop cl--loop-args)) (var (cl--loop-handle-accum 0))) - (push `(progn (if ,what (cl-incf ,var)) t) cl--loop-body))) + (push `(progn (if ,what (incf ,var)) t) cl--loop-body))) ((memq word '(minimize minimizing maximize maximizing)) (push `(progn ,(macroexp-let2 macroexp-copyable-p temp diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 0399b179125..7017fcd5b83 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -161,7 +161,7 @@ (car slot) (nth 1 slot) type props))) (puthash (car slot) (+ i offset) index-table) - (cl-incf i)) + (incf i)) v)) (class (cl--struct-new-class name docstring diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 427f32862b2..62cda07ac73 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el @@ -100,7 +100,7 @@ Print the contents hidden by the ellipsis to STREAM." (cl-print-object (pop object) stream) (cl-print-insert-ellipsis object t stream) (setq object nil)) - (cl-incf count)) + (incf count)) (when object (princ " . " stream) (cl-print-object object stream)))) @@ -123,7 +123,7 @@ Print the contents hidden by the ellipsis to STREAM." (while (< i limit) (unless (= i start) (princ " " stream)) (cl-print-object (aref object i) stream) - (cl-incf i)) + (incf i)) (when (< limit len) (princ " " stream) (cl-print-insert-ellipsis object limit stream)))) @@ -298,7 +298,7 @@ into a button whose action shows the function's disassembly.") (princ (cl--slot-descriptor-name slot) stream) (princ " " stream) (cl-print-object (aref object (1+ i)) stream)) - (cl-incf i)) + (incf i)) (when (< limit len) (princ " " stream) (cl-print-insert-ellipsis object limit stream)))) @@ -369,7 +369,7 @@ primitives such as `prin1'.") (princ start-pos stream) (princ " " stream) (princ end-pos stream) (princ " " stream) (cl-print-object props stream) - (cl-incf interval-count)) + (incf interval-count)) (setq start-pos end-pos end-pos (next-property-change start-pos object len)))) (when (< start-pos len) diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index e9c1e531656..6e51b895b46 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -439,7 +439,7 @@ to avoid corrupting the original SEQ. (setq cl-seq (copy-sequence cl-seq)) (unless cl-from-end (setf (elt cl-seq cl-i) cl-new) - (cl-incf cl-i) + (incf cl-i) (decf cl-count)) (apply 'cl-nsubstitute cl-new cl-old cl-seq :count cl-count :start cl-i cl-keys)))))) diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 3cab66a7199..7931118361b 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -447,7 +447,7 @@ Return them as multiple value." do (when (zerop nest) (setf low i)) - (cl-incf nest) + (incf nest) else do (when (= nest 1) @@ -476,7 +476,7 @@ Return them as multiple value." (cl-return '())) if (eq x 'l) do - (cl-incf nest) + (incf nest) (when (= nest n-ranges) (setf low i)) else diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 2577d8bc7fb..bd80a3890b0 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -334,7 +334,7 @@ Useful to hook into pass checkers.") "Append ELT into VEC. Returns ELT." (puthash (comp-vec-end vec) elt (comp-vec-data vec)) - (cl-incf (comp-vec-end vec)) + (incf (comp-vec-end vec)) elt) (defsubst comp-vec-prepend (vec elt) @@ -492,7 +492,7 @@ non local exit (ends with an `unreachable' insn).")) "Return a sequential number generator." (let ((n -1)) (lambda () - (cl-incf n)))) + (incf n)))) (cl-defstruct (comp-func (:copier nil)) "LIMPLE representation of a function." @@ -1302,7 +1302,7 @@ and the annotation emission." ;; ,(concat "LAP op " op-name))) ;; Emit the stack adjustment if present. ,(when (and sp-delta (not (eq 0 sp-delta))) - `(cl-incf (comp--sp) ,sp-delta)) + `(incf (comp--sp) ,sp-delta)) ,@(comp--body-eff body op-name sp-delta)) else collect `(',op (signal 'native-ice @@ -1336,7 +1336,7 @@ and the annotation emission." (make--comp-mvar :constant arg) (comp--slot+1)))) (byte-call - (cl-incf (comp--sp) (- arg)) + (incf (comp--sp) (- arg)) (comp--emit-set-call (comp--callref 'funcall (1+ arg) (comp--sp)))) (byte-unbind (comp--emit (comp--call 'helper_unbind_n @@ -1491,19 +1491,19 @@ and the annotation emission." (byte-numberp auto) (byte-integerp auto) (byte-listN - (cl-incf (comp--sp) (- 1 arg)) + (incf (comp--sp) (- 1 arg)) (comp--emit-set-call (comp--callref 'list arg (comp--sp)))) (byte-concatN - (cl-incf (comp--sp) (- 1 arg)) + (incf (comp--sp) (- 1 arg)) (comp--emit-set-call (comp--callref 'concat arg (comp--sp)))) (byte-insertN - (cl-incf (comp--sp) (- 1 arg)) + (incf (comp--sp) (- 1 arg)) (comp--emit-set-call (comp--callref 'insert arg (comp--sp)))) (byte-stack-set (comp--copy-slot (1+ (comp--sp)) (- (comp--sp) arg -1))) (byte-stack-set2 (cl-assert nil)) ;; TODO (byte-discardN - (cl-incf (comp--sp) (- arg))) + (incf (comp--sp) (- arg))) (byte-switch ;; Assume to follow the emission of a setimm. ;; This is checked into comp--emit-switch. @@ -1513,7 +1513,7 @@ and the annotation emission." (byte-constant (comp--emit-setimm arg)) (byte-discardN-preserve-tos - (cl-incf (comp--sp) (- arg)) + (incf (comp--sp) (- arg)) (comp--copy-slot (+ arg (comp--sp))))))) (defun comp--emit-narg-prologue (minarg nonrest rest) @@ -1722,7 +1722,7 @@ into the C code forwarding the compilation unit." for inst = (car inst-cell) for next-inst = (car-safe (cdr inst-cell)) do (comp--limplify-lap-inst inst) - (cl-incf (comp-limplify-pc comp-pass)) + (incf (comp-limplify-pc comp-pass)) when (comp--lap-fall-through-p inst) do (pcase next-inst (`(TAG ,_label . ,label-sp) @@ -1755,7 +1755,7 @@ into the C code forwarding the compilation unit." (let ((args (comp-func-l-args func))) (if (comp-args-p args) (cl-loop for i below (comp-args-max args) - do (cl-incf (comp--sp)) + do (incf (comp--sp)) (comp--emit `(set-par-to-local ,(comp--slot) ,i))) (comp--emit-narg-prologue (comp-args-base-min args) (comp-nargs-nonrest args) @@ -1898,10 +1898,10 @@ The assume is emitted at the beginning of the block BB." (defun comp--maybe-add-vmvar (op cmp-res insns-seq) "If CMP-RES is clobbering OP emit a new constrained mvar and return it. Return OP otherwise." - (if-let ((match (eql (comp-mvar-slot op) (comp-mvar-slot cmp-res))) - (new-mvar (make--comp-mvar - :slot - (- (cl-incf (comp-func-vframe-size comp-func)))))) + (if-let* ((match (eql (comp-mvar-slot op) (comp-mvar-slot cmp-res))) + (new-mvar (make--comp-mvar + :slot + (- (incf (comp-func-vframe-size comp-func)))))) (progn (push `(assume ,new-mvar ,op) (cdr insns-seq)) new-mvar) @@ -2768,7 +2768,7 @@ Return t if something was changed." (comp--copy-insn insn)) do (comp--fwprop-insn insn) - (cl-incf i) + (incf i) when (and (null modified) (not (equal insn orig-insn))) do (setf modified t)) when (> i comp--fwprop-max-insns-scan) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 8ade4cddc81..3033e8378f5 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -4594,8 +4594,8 @@ With prefix argument, make it a temporary breakpoint." (let ((s 1)) (while (memq (nth 1 (backtrace-frame i 'called-interactively-p)) '(edebug-enter edebug-default-enter)) - (cl-incf s) - (cl-incf i)) + (incf s) + (incf i)) s))) ;; Finally, hook edebug into the rest of Emacs. diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index c965048a83d..26049844447 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -872,7 +872,7 @@ the docstrings eventually produced, using interactive)) (make-callback (method origin) - (let ((pos (prog1 howmany (cl-incf howmany)))) + (let ((pos (prog1 howmany (incf howmany)))) (cl-ecase method (:enthusiast (lambda (string &rest plist) @@ -889,7 +889,7 @@ the docstrings eventually produced, using nil #'display-doc)) t)) (:patient - (cl-incf want) + (incf want) (lambda (string &rest plist) (register-doc pos string plist origin) (when (zerop (decf want)) (display-doc)) diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index bb99bef55cc..784baf55c7b 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el @@ -395,11 +395,11 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]." ;; we are recording times (let (enter-time) ;; increment the call-counter - (cl-incf (aref info 0)) + (incf (aref info 0)) (setq enter-time (current-time) result (apply func args)) ;; calculate total time in function - (cl-incf (aref info 1) (elp-elapsed-time enter-time nil)) + (incf (aref info 1) (elp-elapsed-time enter-time nil)) )) ;; turn off recording if this is the master function (if (and elp-master diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index f3bc7d0bede..3a58749b3b1 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -140,7 +140,7 @@ BODY." (maphash (lambda (buffer _dummy) (when (or (not (buffer-live-p buffer)) (kill-buffer buffer)) - (cl-incf count))) + (incf count))) ert--test-buffers) (message "%s out of %s test buffers killed" count (hash-table-count ert--test-buffers))) diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index fb4dd82381c..5825807595a 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1152,21 +1152,21 @@ Also changes the counters in STATS to match." (aref results pos)) (cl-etypecase (aref results pos) (ert-test-passed - (cl-incf (ert--stats-passed-expected stats) d)) + (incf (ert--stats-passed-expected stats) d)) (ert-test-failed - (cl-incf (ert--stats-failed-expected stats) d)) + (incf (ert--stats-failed-expected stats) d)) (ert-test-skipped - (cl-incf (ert--stats-skipped stats) d)) + (incf (ert--stats-skipped stats) d)) (null) (ert-test-aborted-with-non-local-exit) (ert-test-quit)) (cl-etypecase (aref results pos) (ert-test-passed - (cl-incf (ert--stats-passed-unexpected stats) d)) + (incf (ert--stats-passed-unexpected stats) d)) (ert-test-failed - (cl-incf (ert--stats-failed-unexpected stats) d)) + (incf (ert--stats-failed-unexpected stats) d)) (ert-test-skipped - (cl-incf (ert--stats-skipped stats) d)) + (incf (ert--stats-skipped stats) d)) (null) (ert-test-aborted-with-non-local-exit) (ert-test-quit))))) @@ -1677,8 +1677,8 @@ test packages depend on each other, it might be helpful.") (insert " \n" " \n" " \n") - (cl-incf errors 1) - (cl-incf id 1))) + (incf errors 1) + (incf id 1))) (insert-file-contents-literally test-report) (when (looking-at-p @@ -1686,15 +1686,15 @@ test packages depend on each other, it might be helpful.") (delete-region (point) (line-beginning-position 2))) (when (looking-at "") - (cl-incf tests (string-to-number (match-string 1))) - (cl-incf errors (string-to-number (match-string 2))) - (cl-incf failures (string-to-number (match-string 3))) - (cl-incf skipped (string-to-number (match-string 4))) - (cl-incf time (string-to-number (match-string 5))) + (incf tests (string-to-number (match-string 1))) + (incf errors (string-to-number (match-string 2))) + (incf failures (string-to-number (match-string 3))) + (incf skipped (string-to-number (match-string 4))) + (incf time (string-to-number (match-string 5))) (delete-region (point) (line-beginning-position 2))) (when (looking-at " ") diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el index 5b9a590c7de..8ca7c0e5f0a 100644 --- a/lisp/emacs-lisp/memory-report.el +++ b/lisp/emacs-lisp/memory-report.el @@ -168,7 +168,7 @@ by counted more than once." (total 0)) (mapatoms (lambda (symbol) - (cl-incf total (memory-report--object-size + (incf total (memory-report--object-size counted (symbol-plist symbol)))) obarray) (list @@ -217,16 +217,16 @@ by counted more than once." (let ((total 0) (size (memory-report--size 'cons))) (while value - (cl-incf total size) + (incf total size) (setf (gethash value counted) t) (when (car value) - (cl-incf total (memory-report--object-size counted (car value)))) + (incf total (memory-report--object-size counted (car value)))) (let ((next (cdr value))) (setq value (when next (if (consp next) (unless (gethash next counted) (cdr value)) - (cl-incf total (memory-report--object-size + (incf total (memory-report--object-size counted next)) nil))))) total)) @@ -235,7 +235,7 @@ by counted more than once." (let ((total (+ (memory-report--size 'vector) (* (memory-report--size 'object) (length value))))) (cl-loop for elem across value - do (cl-incf total (memory-report--object-size counted elem))) + do (incf total (memory-report--object-size counted elem))) total)) (cl-defmethod memory-report--object-size-1 (counted (value hash-table)) @@ -243,8 +243,8 @@ by counted more than once." (* (memory-report--size 'object) (hash-table-size value))))) (maphash (lambda (key elem) - (cl-incf total (memory-report--object-size counted key)) - (cl-incf total (memory-report--object-size counted elem))) + (incf total (memory-report--object-size counted key)) + (incf total (memory-report--object-size counted elem))) value) total)) diff --git a/lisp/emacs-lisp/oclosure.el b/lisp/emacs-lisp/oclosure.el index 57cfcbfe2e1..06d98e6f05a 100644 --- a/lisp/emacs-lisp/oclosure.el +++ b/lisp/emacs-lisp/oclosure.el @@ -125,7 +125,7 @@ (it (make-hash-table :test #'eq))) (dolist (desc slotdescs) (let* ((slot (cl--slot-descriptor-name desc))) - (cl-incf i) + (incf i) (when (gethash slot it) (error "Duplicate slot name: %S" slot)) (setf (gethash slot it) i))) @@ -305,7 +305,7 @@ list of slot properties. The currently known properties are the following: ;; Always use a double hyphen: if users wants to ;; make it public, they can do so with an alias. (aname (intern (format "%S--%S" name slot)))) - (cl-incf i) + (incf i) (if (not mutable) `(defalias ',aname ;; We use `oclosure--copy' instead of diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index e0c2d567b47..111d413cc42 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -176,7 +176,7 @@ ;; don't hide real conflicts. (puthash key (gethash key override) table) (display-warning 'smie (format "Conflict: %s %s/%s %s" x old val y)) - (cl-incf smie-warning-count)) + (incf smie-warning-count)) (puthash key val table)))) (defun smie-precs->prec2 (precs) @@ -585,13 +585,13 @@ PREC2 is a table as returned by `smie-precs->prec2' or (unless (caar cst) (setcar (car cst) i) ;; (smie-check-grammar table prec2 'step1) - (cl-incf i)) + (incf i)) (setq csts (delq cst csts)))) (unless progress (error "Can't resolve the precedence cycle: %s" (smie-debug--describe-cycle table (smie-debug--prec2-cycle csts))))) - (cl-incf i 10)) + (incf i 10)) ;; Propagate equality constraints back to their sources. (dolist (eq (nreverse eqs)) (when (null (cadr eq)) @@ -602,7 +602,7 @@ PREC2 is a table as returned by `smie-precs->prec2' or ;; So set it here rather than below since doing it below ;; makes it more difficult to obey the equality constraints. (setcar (cdr eq) i) - (cl-incf i)) + (incf i)) (cl-assert (or (null (caar eq)) (eq (caar eq) (cadr eq)))) (setcar (car eq) (cadr eq)) ;; (smie-check-grammar table prec2 'step2) @@ -612,10 +612,10 @@ PREC2 is a table as returned by `smie-precs->prec2' or (dolist (x table) (unless (nth 1 x) (setf (nth 1 x) i) - (cl-incf i)) ;See other (cl-incf i) above. + (incf i)) ;See other (incf i) above. (unless (nth 2 x) (setf (nth 2 x) i) - (cl-incf i)))) ;See other (cl-incf i) above. + (incf i)))) ;See other (incf i) above. ;; Mark closers and openers. (dolist (x (gethash :smie-open/close-alist prec2)) (let* ((token (car x)) @@ -2157,7 +2157,7 @@ position corresponding to each rule." (trace (mapcar #'cdr (cdr itrace))) (cur (current-indentation))) (when (numberp nindent) ;Skip `noindent' and friends. - (cl-incf (gethash (cons (- cur nindent) trace) otraces 0))))) + (incf (gethash (cons (- cur nindent) trace) otraces 0))))) (forward-line 1))) (progress-reporter-done pr) @@ -2193,14 +2193,14 @@ position corresponding to each rule." (let ((data (list 0 nil nil))) (puthash sig data sigs) data)))) - (cl-incf (nth 0 sig-data) count) + (incf (nth 0 sig-data) count) (push (cons count otrace) (nth 2 sig-data)) (let ((sig-off-data (or (assq offset (nth 1 sig-data)) (let ((off-data (cons offset 0))) (push off-data (nth 1 sig-data)) off-data)))) - (cl-incf (cdr sig-off-data) count)))))))) + (incf (cdr sig-off-data) count)))))))) otraces) ;; Finally, guess the indentation rules. @@ -2241,7 +2241,7 @@ position corresponding to each rule." off-data)))) (cl-assert (>= (cdr ooff-data) count)) (decf (cdr ooff-data) count) - (cl-incf (cdr noff-data) count)))))))))) + (incf (cdr noff-data) count)))))))))) rules)) (defun smie-config-guess () diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index f092dcc4166..f2c56f3180c 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el @@ -276,7 +276,7 @@ all RULES in total." ;; If there's more than 1 rule, and the rule want to apply ;; highlight to match 0, create an extra group to be able to ;; tell when *this* match 0 has succeeded. - (cl-incf offset) + (incf offset) (setq re (concat "\\(" re "\\)"))) (setq re (syntax-propertize--shift-groups-and-backrefs re offset)) (let ((code '()) @@ -358,7 +358,7 @@ all RULES in total." code)))) (push (cons condition (nreverse code)) branches)) - (cl-incf offset (regexp-opt-depth orig-re)) + (incf offset (regexp-opt-depth orig-re)) re)) rules "\\|"))) @@ -588,8 +588,8 @@ The rest is only useful if you're interested in tweaking the algorithm.") syntax-ppss-stats)) (defun syntax-ppss--update-stats (i old new) (let ((pair (aref syntax-ppss-stats i))) - (cl-incf (car pair)) - (cl-incf (cdr pair) (- new old)))) + (incf (car pair)) + (incf (cdr pair) (- new old)))) (defun syntax-ppss--data () (if (eq (point-min) 1) diff --git a/lisp/emacs-lisp/track-changes.el b/lisp/emacs-lisp/track-changes.el index 125314fa814..1ac7feb3b77 100644 --- a/lisp/emacs-lisp/track-changes.el +++ b/lisp/emacs-lisp/track-changes.el @@ -594,14 +594,14 @@ Details logged to `track-changes--error-log'") (track-changes--trace) (cl-assert track-changes--state) (let ((offset (- (- end beg) len))) - (cl-incf track-changes--buffer-size offset) + (incf track-changes--buffer-size offset) (if (and (eq track-changes--before-clean 'unset) (not track-changes--before-no)) ;; This can be a sign that a `before-change-functions' went missing, ;; or that we called `track-changes--clean-state' between ;; a `before-change-functions' and `after-change-functions'. (track-changes--before beg end) - (cl-incf track-changes--before-end offset)) + (incf track-changes--before-end offset)) (setq track-changes--before-clean nil) (if (not (or track-changes--before-no (save-restriction