Skip to content

Commit fd42e85

Browse files
MorganJamesSmithjpgrayson
authored andcommitted
stgit.el: Pass patch into `stgit-process-files'
This is to prepare for lexical-binding and to make the code clearer.
1 parent a9fd1cb commit fd42e85

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/stgit.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ If NO-QUOTES is non-nil, do not enclose the result in double quotes."
10071007
(insert ":0 0 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 " file-flag "\0")
10081008
(forward-char name-len)))))
10091009

1010-
(defun stgit-process-files (callback)
1010+
(defun stgit-process-files (patch callback)
10111011
(goto-char (point-min))
10121012
(when (looking-at "[0-9A-Fa-f]\\{40\\}\0")
10131013
(goto-char (match-end 0)))
@@ -1018,7 +1018,6 @@ If NO-QUOTES is non-nil, do not enclose the result in double quotes."
10181018
(let ((file
10191019
(cond ((looking-at
10201020
"\\([CR]\\)\\([0-9]*\\)\0\\([^\0]*\\)\0\\([^\0]*\\)\0")
1021-
;; TODO: Where does `patch' come from?
10221021
(let* ((patch-status (stgit-patch->status patch))
10231022
(file-subexp (if (eq patch-status 'unapplied)
10241023
3
@@ -1082,7 +1081,7 @@ at point."
10821081
(sort-regexp-fields nil ":[^\0]*\0\\([^\0]*\\)\0" "\\1"
10831082
(point-min) (point-max)))
10841083

1085-
(stgit-process-files (lambda (file) (ewoc-enter-last ewoc file)))
1084+
(stgit-process-files patch (lambda (file) (ewoc-enter-last ewoc file)))
10861085

10871086
(unless (ewoc-nth ewoc 0)
10881087
(ewoc-set-hf ewoc ""
@@ -1192,7 +1191,8 @@ See also `stgit-expand'."
11921191
"--no-empty-directory" "--"
11931192
filename)
11941193
"X")
1195-
(stgit-process-files (lambda (f)
1194+
(stgit-process-files patch
1195+
(lambda (f)
11961196
(setq node (ewoc-enter-after ewoc node f))))))
11971197

11981198
(move-to-column (stgit-goal-column))

0 commit comments

Comments
 (0)