]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer incf to cl-incf in vc/*.el
authorStefan Kangas <stefankangas@gmail.com>
Wed, 26 Feb 2025 00:48:48 +0000 (01:48 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 26 Feb 2025 09:39:38 +0000 (10:39 +0100)
* lisp/vc/diff-mode.el (diff-count-matches):
(diff-fixup-modifs, diff-add-log-current-defuns):
* lisp/vc/vc-hg.el (vc-hg--glob-to-pcre):
* lisp/vc/vc-hooks.el (vc-insert-file):
* lisp/vc/vc.el (vc-print-log-setup-buttons, vc-prepare-patch):
Prefer incf to cl-incf.

(cherry picked from commit e60103f130916a4632a108352360cb620c02e9f0)

lisp/vc/diff-mode.el
lisp/vc/vc-hg.el
lisp/vc/vc-hooks.el
lisp/vc/vc.el

index 2906f2973daf85c2de9faeec9359db049f69563a..6d176b46f75f712efd198abf22c3a59759901b03 100644 (file)
@@ -925,7 +925,7 @@ data such as \"Index: ...\" and such."
   (save-excursion
     (let ((n 0))
       (goto-char start)
-      (while (re-search-forward re end t) (cl-incf n))
+      (while (re-search-forward re end t) (incf n))
       n)))
 
 (defun diff-splittable-p ()
@@ -1430,17 +1430,17 @@ else cover the whole buffer."
                            "\\|[-*][-*][-*] [0-9,]+ [-*][-*][-*][-*]$"
                            "\\|--- .+\n\\+\\+\\+ ")))
              (pcase (char-after)
-               (?\s (cl-incf space))
-               (?+ (cl-incf plus))
+                (?\s (incf space))
+                (?+ (incf plus))
                (?- (unless ;; In git format-patch "^-- $" signifies
                             ;; the end of the patch.
                        (and (eq diff-buffer-type 'git)
                             (looking-at "^-- $"))
-                     (cl-incf minus)))
-               (?! (cl-incf bang))
+                      (incf minus)))
+                (?! (incf bang))
                ((or ?\\ ?#) nil)
                (?\n (if diff-valid-unified-empty-line
-                        (cl-incf space)
+                         (incf space)
                       (setq space 0 plus 0 minus 0 bang 0)))
                (_  (setq space 0 plus 0 minus 0 bang 0)))
            (cond
@@ -2654,9 +2654,9 @@ are relative to the root directory of the VC repository."
                             (< (point) hunk-end))
                 (let ((patch-char (char-after)))
                   (pcase patch-char
-                    (?+ (cl-incf +lines))
-                    (?- (cl-incf -lines))
-                    (?\s (cl-incf =lines)))
+                    (?+ (incf +lines))
+                    (?- (incf -lines))
+                    (?\s (incf =lines)))
                   (save-current-buffer
                     (funcall =ck-eodefun)
                     (funcall +ck-eodefun)
index afc31be8ef1762a4b4736794dbbd830ff6245af8..b4d7844013a691873cbe62586ee0283ae67936d2 100644 (file)
@@ -811,14 +811,14 @@ if we don't understand a construct, we signal
     (cl-macrolet ((peek () '(and (< i n) (aref glob i))))
       (while (< i n)
         (setf c (aref glob i))
-        (cl-incf i)
+        (incf i)
         (cond ((not (memq c '(?* ?? ?\[ ?\{ ?\} ?, ?\\)))
                (push (vc-hg--escape-for-pcre c) parts))
               ((eq c ?*)
                (cond ((eq (peek) ?*)
-                      (cl-incf i)
+                      (incf i)
                       (cond ((eq (peek) ?/)
-                             (cl-incf i)
+                             (incf i)
                              (push "(?:.*/)?" parts))
                             (t
                              (push ".*" parts))))
@@ -828,9 +828,9 @@ if we don't understand a construct, we signal
               ((eq c ?\[)
                (let ((j i))
                  (when (and (< j n) (memq (aref glob j) '(?! ?\])))
-                   (cl-incf j))
+                   (incf j))
                  (while (and (< j n) (not (eq (aref glob j) ?\])))
-                   (cl-incf j))
+                   (incf j))
                  (cond ((>= j n)
                         (push "\\[" parts))
                        (t
@@ -846,7 +846,7 @@ if we don't understand a construct, we signal
                           (push x parts)
                           (push ?\] parts))))))
               ((eq c ?\{)
-               (cl-incf group)
+               (incf group)
                (push "(?:" parts))
               ((eq c ?\})
                (push ?\) parts)
@@ -856,7 +856,7 @@ if we don't understand a construct, we signal
               ((eq c ?\\)
                (if (eq i n)
                    (push "\\\\" parts)
-                 (cl-incf i)
+                 (incf i)
                  (push ?\\ parts)
                  (push c parts)))
               (t
index e1513eed33a6a147c88d1feff81b7aa053d2af46..7fd15bb1331db257a063e81ee6607fd4c025a782 100644 (file)
@@ -295,7 +295,7 @@ non-nil if FILE exists and its contents were successfully inserted."
       (let ((filepos 0))
         (while
            (and (< 0 (cadr (insert-file-contents
-                            file nil filepos (cl-incf filepos blocksize))))
+                             file nil filepos (incf filepos blocksize))))
                 (progn (beginning-of-line)
                         (let ((pos (re-search-forward limit nil 'move)))
                           (when pos (delete-region (match-beginning 0)
index c5a630749a27f08bba94b1e2c386d45c251ea7a5..a2bd24a20427a64b324f83667990e6cd5ac87f98 100644 (file)
@@ -2822,7 +2822,7 @@ or if PL-RETURN is `limit-unsupported'."
     (let ((entries 0))
       (goto-char (point-min))
       (while (re-search-forward log-view-message-re nil t)
-        (cl-incf entries))
+        (incf entries))
       (if (or (stringp limit)
               (< entries limit))
           ;; The log has been printed in full.  Perhaps it started
@@ -3806,7 +3806,7 @@ marked revisions, use those."
                  "text/x-patch"
                  patch-subject
                  "attachment"
-                 (format "%04d-%s" (cl-incf i) filename))))))
+                 (format "%04d-%s" (incf i) filename))))))
         (open-line 2)))))
 
 (defun vc-default-responsible-p (_backend _file)