- (goto-char start)
- (while (< (point) end)
- (cond ((looking-at "Branch: \\(.*\\)")
- (put-text-property (match-beginning 1) (match-end 1) 'face 'bold))
- ((looking-at "\\([>+-]\\) \\([^ ]+\\) *| \\(.*\\)")
- (let ((state (match-string 1)))
- (put-text-property
- (match-beginning 2) (match-end 2)
- 'face (cond ((string= state ">") 'stgit-top-patch-face)
- ((string= state "+") 'stgit-applied-patch-face)
- ((string= state "-") 'stgit-unapplied-patch-face)))
- (put-text-property (match-beginning 3) (match-end 3)
- 'face 'stgit-description-face))))
- (forward-line 1))))
+ (let ((marked ()))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (cond ((looking-at "Branch: \\(.*\\)")
+ (put-text-property (match-beginning 1) (match-end 1)
+ 'face 'bold))
+ ((looking-at "\\([>+-]\\)\\( \\)\\([^ ]+\\) *| \\(.*\\)")
+ (let ((state (match-string 1))
+ (patchsym (intern (match-string 3))))
+ (put-text-property
+ (match-beginning 3) (match-end 3) 'face
+ (cond ((string= state ">") 'stgit-top-patch-face)
+ ((string= state "+") 'stgit-applied-patch-face)
+ ((string= state "-") 'stgit-unapplied-patch-face)))
+ (put-text-property (match-beginning 4) (match-end 4)
+ 'face 'stgit-description-face)
+ (when (memq patchsym stgit-marked-patches)
+ (replace-match "*" nil nil nil 2)
+ (setq marked (cons patchsym marked))))))
+ (forward-line 1))
+ (setq stgit-marked-patches (nreverse marked)))))