(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))
(setq font-lock-mode-hook nil)
(turn-on-font-lock))
+(defun riece-highlight-format-identity-for-channel-list-indicator (index
+ identity)
+ (if (riece-identity-equal identity riece-current-channel)
+ (let ((string (riece-format-identity identity))
+ (start 0))
+ ;; Escape % -> %%.
+ (while (string-match "%" string start)
+ (setq start (1+ (match-end 0))
+ string (replace-match "%%" nil nil string)))
+ (list (format "%d:" index)
+ (riece-propertize-modeline-string
+ string 'face 'riece-channel-list-current-face)))))
+
(defun riece-highlight-insinuate ()
(put 'riece-channel-mode 'font-lock-defaults
'(riece-dialogue-font-lock-keywords t))
(put 'riece-channel-list-mode '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))
+ '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)
+ (add-hook 'riece-after-insert-functions 'riece-put-overlay-faces))
(provide 'riece-highlight)