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.
This commit is contained in:
Stefan Kangas 2025-02-26 01:48:48 +01:00
parent 1f891898d4
commit e60103f130
4 changed files with 19 additions and 19 deletions

View file

@ -926,7 +926,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 ()
@ -1431,17 +1431,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
@ -2692,9 +2692,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)

View 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

View 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)

View file

@ -2824,7 +2824,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
@ -3808,7 +3808,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)