From: ueno Date: Mon, 10 May 2004 01:50:21 +0000 (+0000) Subject: * riece-ctlseq.el (riece-ctlseq-scan-region): Abolish. X-Git-Tag: riece-1_0_0~56 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=615e5e541af3a819f9c1298334089bfe016028b0;p=elisp%2Friece.git * riece-ctlseq.el (riece-ctlseq-scan-region): Abolish. (riece-ctlseq-requires): New function. (riece-ctlseq-message-filter): Assume the existence of riece-put-overlay-faces, add 'riece-overlay-face property. * riece-keyword.el (riece-keyword-scan-region): Abolish. (riece-keyword-message-filter): Assume the existence of riece-put-overlay-faces, add 'riece-overlay-face property. * riece-highlight.el (riece-put-overlay-faces): New function. (riece-highlight-insinuate): Add riece-put-overlay-faces to riece-after-insert-functions. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a6ccf2..7b9b03b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2004-05-10 Daiki Ueno + + * riece-ctlseq.el (riece-ctlseq-scan-region): Abolish. + (riece-ctlseq-requires): New function. + (riece-ctlseq-message-filter): Assume the existence of + riece-put-overlay-faces, add 'riece-overlay-face property. + + * riece-keyword.el (riece-keyword-scan-region): Abolish. + (riece-keyword-message-filter): Assume the existence of + riece-put-overlay-faces, add 'riece-overlay-face property. + + * riece-highlight.el (riece-put-overlay-faces): New function. + (riece-highlight-insinuate): Add riece-put-overlay-faces to + riece-after-insert-functions. + 2004-05-05 Daiki Ueno * riece-misc.el (riece-split-parameters): Don't remove a trailing diff --git a/lisp/riece-ctlseq.el b/lisp/riece-ctlseq.el index 54af682..70dc797 100644 --- a/lisp/riece-ctlseq.el +++ b/lisp/riece-ctlseq.el @@ -170,24 +170,16 @@ (match-string 0 (riece-message-text message)) attrs))) (if (and (< start end) attrs) (put-text-property start end - 'riece-ctlseq-attributes (copy-sequence attrs) + 'riece-overlay-face + (riece-ctlseq-face-from-cache attrs) (riece-message-text message)))) message) -(defun riece-ctlseq-scan-region (start end) - (riece-scan-property-region - 'riece-ctlseq-attributes - start end - (lambda (start end) - (riece-overlay-put (riece-make-overlay start end) - 'face - (riece-ctlseq-face-from-cache - (get-text-property start - 'riece-ctlseq-attributes)))))) +(defun riece-ctlseq-requires () + '(riece-highlight)) (defun riece-ctlseq-insinuate () - (add-hook 'riece-message-filter-functions 'riece-ctlseq-message-filter) - (add-hook 'riece-after-insert-functions 'riece-ctlseq-scan-region)) + (add-hook 'riece-message-filter-functions 'riece-ctlseq-message-filter)) (provide 'riece-ctlseq) diff --git a/lisp/riece-highlight.el b/lisp/riece-highlight.el index b5c5b1f..b7f3a38 100644 --- a/lisp/riece-highlight.el +++ b/lisp/riece-highlight.el @@ -221,6 +221,15 @@ (if (looking-at riece-prefix-regexp) (put-text-property (match-beginning 1) (match-end 1) 'invisible t)))) +(defun riece-put-overlay-faces (start end) + (riece-scan-property-region + 'riece-overlay-face + start end + (lambda (start end) + (riece-overlay-put (riece-make-overlay start end) + 'face + (get-text-property start 'riece-overlay-face))))) + (defun riece-channel-list-turn-on-font-lock () (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(riece-channel-list-font-lock-keywords t)) @@ -260,7 +269,8 @@ (add-hook 'riece-after-load-startup-hook 'riece-channel-list-schedule-turn-on-font-lock) (add-hook 'riece-format-identity-for-channel-list-indicator-functions - 'riece-highlight-format-identity-for-channel-list-indicator)) + 'riece-highlight-format-identity-for-channel-list-indicator) + (add-hook 'riece-after-insert-functions 'riece-put-overlay-faces)) (provide 'riece-highlight) diff --git a/lisp/riece-keyword.el b/lisp/riece-keyword.el index b07fa5e..44262e2 100644 --- a/lisp/riece-keyword.el +++ b/lisp/riece-keyword.el @@ -88,11 +88,10 @@ and the matched message object." (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))) + (put-text-property (match-beginning (cdr (car alist))) + (match-end (cdr (car alist))) + 'riece-overlay-face riece-keyword-face + (riece-message-text message)) (run-hook-with-args 'riece-notify-keyword-functions (match-string (cdr (car alist)) (riece-message-text message))) @@ -103,21 +102,12 @@ and the matched message object." (setq alist (cdr alist))))) message) -(defun riece-keyword-scan-region (start end) - (riece-scan-property-region - 'riece-keyword - start end - (lambda (start end) - (riece-overlay-put (riece-make-overlay start end) - 'face riece-keyword-face)))) - (defun riece-keyword-requires () (if (memq 'riece-highlight riece-addons) '(riece-highlight))) (defun riece-keyword-insinuate () - (add-hook 'riece-message-filter-functions 'riece-keyword-message-filter) - (add-hook 'riece-after-insert-functions 'riece-keyword-scan-region)) + (add-hook 'riece-message-filter-functions 'riece-keyword-message-filter)) (provide 'riece-keyword)