* riece-ctlseq.el (riece-ctlseq-scan-region): Abolish.
authorueno <ueno>
Mon, 10 May 2004 01:50:21 +0000 (01:50 +0000)
committerueno <ueno>
Mon, 10 May 2004 01:50:21 +0000 (01:50 +0000)
(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.

lisp/ChangeLog
lisp/riece-ctlseq.el
lisp/riece-highlight.el
lisp/riece-keyword.el

index 9a6ccf2..7b9b03b 100644 (file)
@@ -1,3 +1,18 @@
+2004-05-10  Daiki Ueno  <ueno@unixuser.org>
+
+       * 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  <ueno@unixuser.org>
 
        * riece-misc.el (riece-split-parameters): Don't remove a trailing
index 54af682..70dc797 100644 (file)
                   (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)
 
index b5c5b1f..b7f3a38 100644 (file)
     (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))
   (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)
 
index b07fa5e..44262e2 100644 (file)
@@ -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)