- (let ((status (stgit-patch-status patch))
- (start (point))
- (name (stgit-patch-name patch)))
- (case name
- (:index (insert " "
- (propertize "Index"
- 'face 'stgit-index-work-tree-title-face)))
- (:work (insert " "
- (propertize "Work tree"
- 'face 'stgit-index-work-tree-title-face)))
- (t (insert (case status
- ('applied "+")
- ('top ">")
- ('unapplied "-"))
- (if (memq name stgit-marked-patches)
- "*" " ")
- (propertize (format "%-30s"
- (symbol-name name))
- 'face (case status
- ('applied 'stgit-applied-patch-face)
- ('top 'stgit-top-patch-face)
- ('unapplied 'stgit-unapplied-patch-face)
- ('index nil)
- ('work nil)))
- " "
- (if (stgit-patch-empty patch) "(empty) " "")
- (propertize (or (stgit-patch-desc patch) "")
- 'face 'stgit-description-face))))
+ (let* ((status (stgit-patch-status patch))
+ (start (point))
+ (name (stgit-patch-name patch))
+ (face (cdr (assq status stgit-patch-status-face-alist))))
+ (insert (case status
+ ('applied "+")
+ ('top ">")
+ ('unapplied "-")
+ (t " "))
+ (if (memq name stgit-marked-patches)
+ "*" " "))
+ (if (memq status '(index work))
+ (insert (propertize (if (eq status 'index) "Index" "Work tree")
+ 'face face))
+ (insert (format "%-30s"
+ (propertize (symbol-name name) 'face face))
+ " "
+ (if (stgit-patch-empty patch) "(empty) " "")
+ (propertize (or (stgit-patch-desc patch) "")
+ 'face 'stgit-description-face)))