(require 'riece-globals)
(require 'riece-options) ;riece-channel-list-buffer-mode
(require 'riece-identity) ;riece-format-identity
+(require 'riece-misc)
(require 'font-lock)
+(require 'derived)
(defgroup riece-highlight nil
"Highlight IRC buffers"
:type '(repeat (list string))
:group 'riece-highlight)
+(unless (find-face 'riece-modeline-current-face)
+ (make-face 'riece-modeline-current-face
+ "Face used for displaying the current channel in modeline.")
+ (if (featurep 'xemacs)
+ (set-face-parent 'riece-modeline-current-face 'modeline))
+ (set-face-foreground 'riece-modeline-current-face
+ (face-foreground 'riece-channel-list-current-face)))
+
(defvar riece-highlight-enabled nil)
(defconst riece-highlight-description
(defun riece-highlight-setup-dialogue ()
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(riece-dialogue-font-lock-keywords t))
+ ;; In XEmacs, auto-initialization of font-lock is not affective
+ ;; when buffer-file-name is not set.
+ (font-lock-set-defaults)
(make-local-hook 'after-change-functions)
(add-hook 'after-change-functions
- 'riece-highlight-hide-prefix nil 'local))
+ 'riece-highlight-hide-prefix nil 'local)
+ (if riece-highlight-enabled
+ (font-lock-mode 1)))
(defun riece-highlight-setup-channel-list ()
(make-local-variable 'font-lock-defaults)
- (setq font-lock-defaults '(riece-channel-list-font-lock-keywords t)))
+ (setq font-lock-defaults '(riece-channel-list-font-lock-keywords t))
+ ;; In XEmacs, auto-initialization of font-lock is not affective
+ ;; when buffer-file-name is not set.
+ (font-lock-set-defaults)
+ (if riece-highlight-enabled
+ (font-lock-mode 1)))
(defun riece-highlight-hide-prefix (start end length)
(save-excursion
string (replace-match "%%" nil nil string)))
(list (format "%d:" index)
(riece-propertize-modeline-string
- string 'face 'riece-channel-list-current-face)))))
+ string 'face 'riece-modeline-current-face)))))
(defun riece-highlight-insinuate ()
(put 'riece-channel-mode 'font-lock-defaults
major-mode))
'(riece-dialogue-mode riece-channel-list-mode))
(with-current-buffer (car buffers)
- (font-lock-mode -1)))
+ (font-lock-mode 0)))
(setq buffers (cdr buffers))))
(setq riece-highlight-enabled nil))