:prefix "riece-highlight-"
:group 'riece-highlight)
-(defcustom riece-change-face 'riece-change-face
+(defcustom riece-dialogue-change-face 'riece-dialogue-change-face
"Face used for displaying \"*** Change:\" line."
:type 'face
:group 'riece-highlight-faces)
-(defcustom riece-notice-face 'riece-notice-face
+(defcustom riece-dialogue-notice-face 'riece-dialogue-notice-face
"Face used for displaying \"*** Notice:\" line."
:type 'face
:group 'riece-highlight-faces)
-(defcustom riece-wallops-face 'riece-wallops-face
+(defcustom riece-dialogue-wallops-face 'riece-dialogue-wallops-face
"Face used for displaying \"*** Wallops:\" line."
:type 'face
:group 'riece-highlight-faces)
-(defcustom riece-error-face 'riece-error-face
+(defcustom riece-dialogue-error-face 'riece-dialogue-error-face
"Face used for displaying \"*** Error:\" line."
:type 'face
:group 'riece-highlight-faces)
-(defcustom riece-info-face 'riece-info-face
+(defcustom riece-dialogue-info-face 'riece-dialogue-info-face
"Face used for displaying \"*** Info:\" line."
:type 'face
:group 'riece-highlight-faces)
-(defcustom riece-server-face 'riece-server-face
+(defcustom riece-dialogue-server-face 'riece-dialogue-server-face
"Face used for displaying \"(from server)\" extent."
:type 'face
:group 'riece-highlight-faces)
-(defcustom riece-prefix-face 'riece-prefix-face
+(defcustom riece-dialogue-prefix-face 'riece-dialogue-prefix-face
"Face used for displaying \"<nick>\" extent."
:type 'face
:group 'riece-highlight-faces)
-(defface riece-change-face
+(defface riece-dialogue-change-face
'((((class color)
(background dark))
(:foreground "cyan" :bold t))
"Face used for displaying \"*** Change:\" line"
:group 'riece-highlight-faces)
-(defface riece-notice-face
+(defface riece-dialogue-notice-face
'((((class color)
(background dark))
(:foreground "green2" :bold t))
"Face used for displaying \"*** Notice:\" line"
:group 'riece-highlight-faces)
-(defface riece-wallops-face
+(defface riece-dialogue-wallops-face
'((((class color)
(background dark))
(:foreground "yellow" :bold t))
"Face used for displaying \"*** Wallops:\" line"
:group 'riece-highlight-faces)
-(defface riece-error-face
+(defface riece-dialogue-error-face
'((((class color)
(background dark))
(:foreground "cornflower blue" :bold t))
"Face used for displaying \"*** Error:\" line"
:group 'riece-highlight-faces)
-(defface riece-info-face
+(defface riece-dialogue-info-face
'((((class color)
(background dark))
(:foreground "PaleTurquoise" :bold t))
"Face used for displaying \"*** Info:\" line"
:group 'riece-highlight-faces)
-(defface riece-server-face
+(defface riece-dialogue-server-face
'((((class color)
(background dark))
(:foreground "Gray70"))
"Face used for displaying \"(from server)\" extent."
:group 'riece-highlight-faces)
-(defface riece-prefix-face
+(defface riece-dialogue-prefix-face
'((((class color)
(background dark))
(:foreground "moccasin"))
"Face used for displaying \"<nick>\" extent"
:group 'riece-highlight-faces)
-(defcustom riece-highlight-font-lock-keywords
+(defcustom riece-dialogue-font-lock-keywords
(append
(list (list (concat "^" riece-time-prefix-regexp
"\\(<[^>]+>\\|>[^<]+<\\|([^)]+)\\|{[^}]+}\\|=[^=]+=\\)")
- '(1 riece-prefix-face append t)))
+ '(1 riece-dialogue-prefix-face append t)))
;; set property to the whole line
(mapcar
(lambda (line)
(regexp-quote
(symbol-value (intern (format "riece-%s-prefix" line))))
".*\\)$")
- (list 1 (intern (format "riece-%s-face" line)) t t)))
+ (list 1 (intern (format "riece-dialogue-%s-face" line)) t t)))
'(change notice wallops error info))
- (list (list "(from [^)]+)$" 0 riece-server-face t)))
- "Normal and deformed faces for IRC normal line."
+ (list (list "(from [^)]+)$" 0 riece-dialogue-server-face t)))
+ "Default expressions to highlight in riece-dialogue-mode."
:type '(repeat (list string))
:group 'riece-highlight)
-(defun riece-highlight-schedule-turn-on-font-lock ()
+(defcustom riece-channel-list-current-face 'riece-channel-list-current-face
+ "Face used for displaying the current channel."
+ :type 'face
+ :group 'riece-highlight-faces)
+
+(defface riece-channel-list-current-face
+ '((((class color)
+ (background dark))
+ (:foreground "PaleGreen" :underline t))
+ (((class color)
+ (background light))
+ (:foreground "DarkGreen" :underline t))
+ (t
+ (:underline t)))
+ "Face used for displaying the current channel."
+ :group 'riece-highlight-faces)
+
+(defcustom riece-channel-list-mark-face-alist
+ '((?* . riece-channel-list-current-face))
+ "An alist mapping marks on riece-channel-list-buffer to faces."
+ :type 'list
+ :group 'riece-highlight)
+
+(defcustom riece-channel-list-font-lock-keywords
+ '(("^[ 0-9][0-9]:\\(.\\)\\(.*\\)"
+ (2 (or (cdr (assq (aref (match-string 1) 0)
+ riece-channel-list-mark-face-alist))
+ 'default))))
+ "Default expressions to highlight in riece-channel-list-mode."
+ :type '(repeat (list string))
+ :group 'riece-highlight)
+
+(defun riece-dialogue-schedule-turn-on-font-lock ()
(add-hook 'riece-channel-mode-hook
- 'riece-highlight-turn-on-font-lock)
+ 'riece-dialogue-turn-on-font-lock)
(add-hook 'riece-others-mode-hook
- 'riece-highlight-turn-on-font-lock)
+ 'riece-dialogue-turn-on-font-lock)
(add-hook 'riece-dialogue-mode-hook
- 'riece-highlight-turn-on-font-lock))
+ 'riece-dialogue-turn-on-font-lock))
+
+(defun riece-channel-list-schedule-turn-on-font-lock ()
+ (add-hook 'riece-channel-list-mode-hook
+ 'riece-channel-list-turn-on-font-lock))
(defvar font-lock-support-mode)
-(defun riece-highlight-turn-on-font-lock ()
+(defun riece-dialogue-turn-on-font-lock ()
(make-local-variable 'font-lock-defaults)
- (setq font-lock-defaults '(riece-highlight-font-lock-keywords t))
+ (setq font-lock-defaults '(riece-dialogue-font-lock-keywords t))
(make-local-variable 'font-lock-verbose)
(setq font-lock-verbose nil)
(when (boundp 'font-lock-support-mode)
(turn-on-font-lock)
(make-local-hook 'after-change-functions)
(add-hook 'after-change-functions
- 'riece-highlight-hide-prefix nil 'local))
+ 'riece-dialogue-hide-prefix nil 'local))
-(defun riece-highlight-hide-prefix (start end length)
+(defun riece-dialogue-hide-prefix (start end length)
(save-excursion
(goto-char start)
(if (looking-at riece-prefix-regexp)
(put-text-property (match-beginning 1) (match-end 1) 'invisible t))))
+(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))
+ (make-local-variable 'font-lock-verbose)
+ (setq font-lock-verbose nil)
+ (when (boundp 'font-lock-support-mode)
+ (make-local-variable 'font-lock-support-mode)
+ (setq font-lock-support-mode nil))
+ (make-local-hook 'font-lock-mode-hook)
+ (setq font-lock-mode-hook nil)
+ (turn-on-font-lock))
+
(defun riece-highlight-insinuate ()
(put 'riece-channel-mode 'font-lock-defaults
- '(riece-highlight-font-lock-keywords t))
+ '(riece-dialogue-font-lock-keywords t))
(put 'riece-others-mode 'font-lock-defaults
- '(riece-highlight-font-lock-keywords t))
+ '(riece-dialogue-font-lock-keywords t))
(put 'riece-dialogue-mode 'font-lock-defaults
- '(riece-highlight-font-lock-keywords t))
+ '(riece-dialogue-font-lock-keywords t))
+ (add-hook 'riece-after-load-startup-hook
+ 'riece-dialogue-schedule-turn-on-font-lock)
+ (put 'riece-channel-list-mode 'font-lock-defaults
+ '(riece-channel-list-font-lock-keywords t))
(add-hook 'riece-after-load-startup-hook
- 'riece-highlight-schedule-turn-on-font-lock))
+ 'riece-channel-list-schedule-turn-on-font-lock))
(provide 'riece-highlight)