From efad2a45ca7c0540e28406de1da7f6bd8b54639b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 26 Feb 2025 01:48:48 +0100 Subject: [PATCH] Prefer incf to cl-incf in vc/*.el * 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 | 18 +++++++++--------- lisp/vc/vc-hg.el | 14 +++++++------- lisp/vc/vc-hooks.el | 2 +- lisp/vc/vc.el | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 2906f2973da..6d176b46f75 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -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) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index afc31be8ef1..b4d7844013a 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -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 diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index e1513eed33a..7fd15bb1331 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -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) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index c5a630749a2..a2bd24a2042 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -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) -- 2.39.5