X-Git-Url: https://cgit.sxemacs.org/?p=riece;a=blobdiff_plain;f=lisp%2Friece-highlight.el;h=6b3dbb53b58552c86883fd3130b75c44a43a5e24;hp=b5afa46a326fcd63513447c0430235c4eda49fec;hb=2b559fc272a39d2dd115a59357eaeafc58374441;hpb=7dc3769d16aa275005c9c8b10fb1006017f9ef16 diff --git a/lisp/riece-highlight.el b/lisp/riece-highlight.el index b5afa46..6b3dbb5 100644 --- a/lisp/riece-highlight.el +++ b/lisp/riece-highlight.el @@ -27,6 +27,7 @@ (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) @@ -149,7 +150,7 @@ ".*\\)$") (list 1 (intern (format "riece-dialogue-%s-face" line)) t t))) '(change notice wallops error info)) - (list (list "(from [^)]+)$" 0 riece-dialogue-server-face t))) + '((riece-highlight-server-match 0 riece-dialogue-server-face t))) "Default expressions to highlight in riece-dialogue-mode." :type '(repeat (list string)) :group 'riece-highlight) @@ -188,11 +189,23 @@ :type '(repeat (list string)) :group 'riece-highlight) +(unless (riece-facep '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 "Highlight IRC buffers") +(defun riece-highlight-server-match (limit) + (and (re-search-forward "(from [^)]+)$" limit t) + (get-text-property (match-beginning 0) 'riece-server-name))) + (defun riece-highlight-setup-dialogue () (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(riece-dialogue-font-lock-keywords t)) @@ -242,7 +255,7 @@ 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