* riece-addon.el (riece-addon-list-mode): Call font-lock-set-defaults.
[riece] / lisp / riece-highlight.el
index eb23ff5..b1746ef 100644 (file)
   "Highlight IRC buffers")
 
 (defun riece-highlight-setup-dialogue ()
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(riece-dialogue-font-lock-keywords t))
+  (if (featurep 'xemacs)
+      ;; In XEmacs, auto-initialization of font-lock is not affective
+      ;; when buffer-file-name is not set.
+      (font-lock-set-defaults)
+    (make-local-variable 'font-lock-defaults)
+    (setq font-lock-defaults '(riece-dialogue-font-lock-keywords t)))
   (make-local-hook 'after-change-functions)
   (add-hook 'after-change-functions
            'riece-highlight-hide-prefix nil 'local))
 
 (defun riece-highlight-setup-channel-list ()
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(riece-channel-list-font-lock-keywords t)))
+  (if (featurep 'xemacs)
+      ;; In XEmacs, auto-initialization of font-lock is not affective
+      ;; when buffer-file-name is not set.
+      (font-lock-set-defaults)
+    (make-local-variable 'font-lock-defaults)
+    (setq font-lock-defaults '(riece-channel-list-font-lock-keywords t))))
 
 (defun riece-highlight-hide-prefix (start end length)
   (save-excursion