From b28b19676b15ac675b97122a4f64fa2a4e1b9625 Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 16 Aug 2004 04:16:03 +0000 Subject: [PATCH] * riece-highlight.el (riece-highlight-server-match): New match function for font-lock-keywords to highlight "(from XXX)" only if 'riece-server-name property is set. (riece-dialogue-font-lock-keywords): Use it. --- lisp/ChangeLog | 7 +++++++ lisp/riece-highlight.el | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e61d41b..b1738d9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-08-16 Daiki Ueno + + * riece-highlight.el (riece-highlight-server-match): New match + function for font-lock-keywords to highlight "(from XXX)" only if + 'riece-server-name property is set. + (riece-dialogue-font-lock-keywords): Use it. + 2004-08-15 Daiki Ueno * riece-handle.el (riece-handle-nick-message): Remove nil from diff --git a/lisp/riece-highlight.el b/lisp/riece-highlight.el index 4aebc5f..b9dd902 100644 --- a/lisp/riece-highlight.el +++ b/lisp/riece-highlight.el @@ -150,7 +150,7 @@ ".*\\)$") (list 1 (intern (format "riece-dialogue-%s-face" line)) t t))) '(change notice wallops error info)) - (list (list "(from [^)]+)$" 0 riece-dialogue-server-face t))) + '((riece-highlight-server-match 0 riece-dialogue-server-face t))) "Default expressions to highlight in riece-dialogue-mode." :type '(repeat (list string)) :group 'riece-highlight) @@ -202,6 +202,13 @@ (defconst riece-highlight-description "Highlight IRC buffers") +(defun riece-highlight-server-match (limit) + (let ((match-data (match-data))) + (if (re-search-forward "(from [^)]+)$" limit t) + (if (get-text-property (match-beginning 0) 'riece-server-name) + t + (store-match-data match-data))))) + (defun riece-highlight-setup-dialogue () (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(riece-dialogue-font-lock-keywords t)) -- 1.7.10.4