]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer incf to cl-incf in progmodes/*.el
authorStefan Kangas <stefankangas@gmail.com>
Tue, 25 Feb 2025 07:28:30 +0000 (08:28 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 26 Feb 2025 09:38:05 +0000 (10:38 +0100)
* lisp/progmodes/bug-reference.el (bug-reference--overlay-bounds):
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset):
* lisp/progmodes/compile.el (compilation--note-type):
* lisp/progmodes/ebrowse.el (ebrowse-files-table)
(ebrowse-fill-member-table, ebrowse-find-pattern)
(ebrowse-draw-member-short-fn, ebrowse-gather-statistics):
* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--electric-pair-string-delimiter):
* lisp/progmodes/gdb-mi.el (gdb-thread-list-handler-custom):
* lisp/progmodes/grep.el (grep-filter):
* lisp/progmodes/hideif.el (hif-backward-comment, hif-__COUNTER__)
(hif-token-concatenation, hif-find-define):
* lisp/progmodes/js.el (js--pstate-is-toplevel-defun)
(js-beginning-of-defun, js-end-of-defun, js--pitems-to-imenu)
(js--imenu-to-flat, js-ts--syntax-propertize):
* lisp/progmodes/tcl.el (tcl--syntax-of-quote):
* lisp/progmodes/typescript-ts-mode.el
(tsx-ts--syntax-propertize-captures): Prefer incf to cl-incf.

(cherry picked from commit d1d85e0f35d4cb22f2cdfda0672ca33f5bb87b21)

lisp/progmodes/bug-reference.el
lisp/progmodes/c-ts-common.el
lisp/progmodes/compile.el
lisp/progmodes/elixir-ts-mode.el
lisp/progmodes/gdb-mi.el
lisp/progmodes/grep.el
lisp/progmodes/hideif.el
lisp/progmodes/js.el
lisp/progmodes/tcl.el
lisp/progmodes/typescript-ts-mode.el

index 874fa012512098280a4687b5108c05e250090523..fa8701460645166fa25c9cf2ed8892009954dd31 100644 (file)
@@ -138,7 +138,7 @@ to the highlighted and clickable region."
                               (or (< (match-beginning i) m-b1)
                                   (> (match-end i) m-e1)))
                      (throw 'within-bounds nil))
-                   (cl-incf i))
+                   (incf i))
                  t)))
         ;; All groups 2..10 are within bounds.
         (cons m-b1 m-e1)
index b557397f07589c7d41dcf7a13d624032a24dfc1f..3c36382666417aa2e53855cca5795aad5e9c3e11 100644 (file)
@@ -503,7 +503,7 @@ characters on the current line."
       (let ((parent (treesit-node-parent node)))
         ;; Increment level for every bracket (with exception).
         (when (c-ts-common--node-is node 'block)
-          (cl-incf level)
+          (incf level)
           (save-excursion
             (goto-char (treesit-node-start node))
             ;; Add an extra level if the opening bracket is on its own
@@ -515,12 +515,12 @@ characters on the current line."
                   ;; Add a level.
                   ((looking-back (rx bol (* whitespace))
                                  (line-beginning-position))
-                   (cl-incf level)))))
+                   (incf level)))))
         ;; Fix bracketless statements.
         (when (and (c-ts-common--node-is parent
                        'if 'do 'while 'for)
                    (not (c-ts-common--node-is node 'block)))
-          (cl-incf level))
+          (incf level))
         ;; Flatten "else if" statements.
         (when (and (c-ts-common--node-is node 'else)
                    (c-ts-common--node-is node 'if)
index ec66ef5c41e87d6af8ab682f6a868d6c70421894..abe53655fad3bbb13fa5675c86ed3607d26e61b8 100644 (file)
@@ -1664,9 +1664,9 @@ RULE is the name (symbol) of the rule used or nil if anonymous.
   "Note that a new message with severity TYPE was seen.
 This updates the appropriate variable used by the mode-line."
   (cl-case type
-    (0 (cl-incf compilation-num-infos-found))
-    (1 (cl-incf compilation-num-warnings-found))
-    (2 (cl-incf compilation-num-errors-found))))
+    (0 (incf compilation-num-infos-found))
+    (1 (incf compilation-num-warnings-found))
+    (2 (incf compilation-num-errors-found))))
 
 (defun compilation-parse-errors (start end &rest rules)
   "Parse errors between START and END.
index a0d503632d9959125b9e6119f59a46b806bd5e43..d50692d87c025c090eba1383fa7e7ed1d984a233 100644 (file)
@@ -658,7 +658,7 @@ Return nil if NODE is not a defun node or doesn't have a name."
              (eq last-command-event ?\")
              (let ((count 0))
                (while (eq (char-before (- (point) count)) last-command-event)
-                 (cl-incf count))
+                 (incf count))
                (= count 3))
              (eq (char-after) last-command-event))
     (save-excursion
index 53e60255ed06e9fb5f9ca7d21ec601c21dfae501..6e0620b1ffa9a9f3cbad195006f85c3deedc0617 100644 (file)
@@ -3545,9 +3545,9 @@ corresponding to the mode line clicked."
         (add-to-list 'gdb-threads-list
                      (cons (gdb-mi--field thread 'id)
                            thread))
-        (cl-incf (if running
-                     gdb-running-threads-count
-                   gdb-stopped-threads-count))
+        (incf (if running
+                  gdb-running-threads-count
+                gdb-stopped-threads-count))
 
         (gdb-table-add-row
          table
index 68b90822f8d79c46152b9f69f7f29c393436577b..207f5da0ed9ce475b3931ffcaebea686cfa41eea 100644 (file)
@@ -648,7 +648,7 @@ This function is called from `compilation-filter-hook'."
           (replace-match (propertize (match-string 1)
                                      'face nil 'font-lock-face grep-match-face)
                          t t)
-          (cl-incf grep-num-matches-found))
+          (incf grep-num-matches-found))
         ;; Delete all remaining escape sequences
         (goto-char beg)
         (while (re-search-forward "\033\\[[0-9;]*[mK]" end 1)
index afabe663aead2ce75ab2495a2fa2add28fbd2b23..b84240370ae3bffc8c5dd7e995d949fe55b3ae14 100644 (file)
@@ -881,7 +881,7 @@ Assuming we've just performed a `hif-token-regexp' lookup."
                 ;; merge whites immediately ahead
                 (setq ce (if (and we (= (1- p) we)) ws p))
                 ;; scan for end of line
-                (while (and (< (cl-incf p) end)
+                (while (and (< (incf p) end)
                             (not (char-equal ?\n (char-after p)))
                             (not (char-equal ?\r (char-after p)))))
                 ;; Merge with previous comment if immediately followed
@@ -906,7 +906,7 @@ Assuming we've just performed a `hif-token-regexp' lookup."
                 (while (< (1+ p) end)
                   (if (not (and (char-equal ?* (char-after p))
                                 (char-equal ?/ (char-after (1+ p)))))
-                      (cl-incf p)
+                      (incf p)
                     ;; found `*/', mark end pos
                     (push (cons cmt (1+ (setq p (1+ p)))) cmtlist)
                     (throw 'break nil)))
@@ -920,7 +920,7 @@ Assuming we've just performed a `hif-token-regexp' lookup."
                     we p))
           (setq ws nil
                 we nil)))
-      (cl-incf p))
+      (incf p))
     ;; Goto beginning of the last comment, if we're within
     (setq cmt (car cmtlist)) ;; last cmt
     (setq cmt (if (and cmt
@@ -1524,7 +1524,7 @@ and `+='...)."
 
 (defvar hif-__COUNTER__ 0)
 (defun hif-__COUNTER__ ()
-  (prog1 hif-__COUNTER__ (cl-incf hif-__COUNTER__)))
+  (prog1 hif-__COUNTER__ (incf hif-__COUNTER__)))
 
 (defun hif-__cplusplus ()
   (and (string-match
@@ -1597,7 +1597,7 @@ and `+='...)."
               (push tk items) ; first item, in reverse order
               (setq tk 'hif-token-concat))
             (while (eq tk 'hif-token-concat)
-              (cl-incf count)
+              (incf count)
               ;; 2+ item
               (setq l (cdr l)
                     tk (car l))
@@ -2470,7 +2470,7 @@ first arg will be `hif-etc'."
                          (tokens
                           (and name
                                (prog1 t
-                                 (cl-incf hif-verbose-define-count)
+                                 (incf hif-verbose-define-count)
                                  ;; only show 1/50 to not slow down to much
                                  (if (and hide-ifdef-verbose
                                           (= (% hif-verbose-define-count 50) 1))
index 076b197730ba381d39a52059f54e4ec4680c1bae..27ec5200eeb93b5ac81fee92a6f06bd2fdb2b6c4 100644 (file)
@@ -982,7 +982,7 @@ top-most pitem.  Otherwise, return nil."
            with func-depth = 0
            with func-pitem
            if (eq 'function (js--pitem-type pitem))
-           do (cl-incf func-depth)
+           do (incf func-depth)
            and do (setq func-pitem pitem)
            finally return (if (eq func-depth 1) func-pitem)))
 
@@ -1017,7 +1017,7 @@ Return the pitem of the function we went to the beginning of."
   (setq arg (or arg 1))
   (let ((found))
     (while (and (not (eobp)) (< arg 0))
-      (cl-incf arg)
+      (incf arg)
       (when (and (not js-flat-functions)
                  (or (eq (js-syntactic-context) 'function)
                      (js--function-prologue-beginning)))
@@ -1360,7 +1360,7 @@ LIMIT defaults to point."
   "Value of `end-of-defun-function' for `js-mode'."
   (setq arg (or arg 1))
   (while (and (not (bobp)) (< arg 0))
-    (cl-incf arg)
+    (incf arg)
     (js-beginning-of-defun)
     (js-beginning-of-defun)
     (unless (bobp)
@@ -3180,7 +3180,7 @@ the broken-down class name of the item to insert."
       (setq pitem-name (js--pitem-strname pitem))
       (when (eq pitem-name t)
         (setq pitem-name (format "[unknown %s]"
-                                 (cl-incf (car unknown-ctr)))))
+                                 (incf (car unknown-ctr)))))
 
       (cond
        ((memq pitem-type '(function macro))
@@ -3255,7 +3255,7 @@ the broken-down class name of the item to insert."
                      (ctr 0))
 
                 (while (gethash name2 symbols)
-                  (setq name2 (format "%s<%d>" name (cl-incf ctr))))
+                  (setq name2 (format "%s<%d>" name (incf ctr))))
 
                 (puthash name2 (cdr item) symbols))))
 
@@ -4032,7 +4032,7 @@ See `treesit-thing-settings' for more information.")
              (syntax (pcase-exhaustive name
                        ('regexp
                         (decf ns)
-                        (cl-incf ne)
+                        (incf ne)
                         (string-to-syntax "\"/"))
                        ('jsx
                         (string-to-syntax "|")))))
index c4b40f4a170841a869af50f8162318d8cdbee3be..e1efade517d0e87387b64a1478b153fa3e71df84 100644 (file)
@@ -432,9 +432,9 @@ This variable is generally set from `tcl-proc-regexp',
             (pcase (char-after (match-beginning 0))
               (?\\ (forward-char 1))
               (?\" (setq type 'matched))
-              (?\{ (cl-incf depth))
+              (?\{ (incf depth))
               (?\} (if (zerop depth) (setq type 'unmatched)
-                     (cl-incf depth)))))
+                     (incf depth)))))
           (when (> (line-beginning-position) pos)
             ;; The quote is not on the same line as the deciding
             ;; factor, so make sure we revisit this choice later.
index 0d31649dcf3efde7837dfc1a7c13f1e8ee17f7bf..0a3b91d12c14d1d95c5013a95fe3597362cedb02 100644 (file)
@@ -678,7 +678,7 @@ at least 3 (which is the default value)."
         ('regexp
          (let ((syntax (string-to-syntax "\"/")))
            (decf ns)
-           (cl-incf ne)
+           (incf ne)
            (put-text-property ns (1+ ns) 'syntax-table syntax)
            (put-text-property (1- ne) ne 'syntax-table syntax)))
         ;; We put punctuation syntax on all the balanced pair