- (if riece-keywords
- (let ((regexp (regexp-opt riece-keywords))
- (index 0))
- (while (string-match regexp (riece-message-text message) index)
- (if (memq 'riece-highlight riece-addons)
- (put-text-property (match-beginning 0) (match-end 0)
- 'riece-keyword t
- (riece-message-text message)))
- (save-match-data
+ (if (and riece-keywords
+ ;; Ignore messages which belongs to myself.
+ (not (riece-message-own-p message)))
+ (let* (keywords
+ (alist
+ (nconc
+ (delq nil (mapcar
+ (lambda (matcher)
+ (if (stringp matcher)
+ (ignore
+ (setq keywords (cons matcher keywords)))
+ matcher))
+ riece-keywords))
+ (list (cons (regexp-opt keywords) 0))))
+ index)
+ (while alist
+ (setq index 0)
+ (while (string-match (car (car alist))
+ (riece-message-text message) index)
+ (if (memq 'riece-highlight riece-addons)
+ (put-text-property (match-beginning (cdr (car alist)))
+ (match-end (cdr (car alist)))
+ 'riece-keyword t
+ (riece-message-text message)))