- (when tags
- (insert (propertize (format format-string
- (mapconcat #'identity tags ", "))
- 'face face))))))))
+ (setq formatted-field
+ (propertize (format format-string
+ (mapconcat #'identity tags ", "))
+ 'face face)))))
+ formatted-field))
+
+(defun notmuch-pick-format-field-list (field-list msg)
+ "Format fields of MSG according to FIELD-LIST and return string"
+ (let (result-string)
+ (dolist (spec field-list result-string)
+ (let ((field-string (notmuch-pick-format-field (car spec) (cdr spec) msg)))
+ (setq result-string (concat result-string field-string))))))