From c1457a93d00892e4edf7b4c1d6cf3f5522f39dde Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 4 May 2004 05:55:31 +0000 Subject: [PATCH] * riece-ctlseq.el (riece-ctlseq-hide-controls): New user option. * riece-keyword.el (riece-keyword): Fixed the parent custom group. * riece-url.el (riece-url): Fixed the parent custom group. --- lisp/ChangeLog | 7 +++++++ lisp/riece-ctlseq.el | 33 ++++++++++++++++++++++++--------- lisp/riece-keyword.el | 2 +- lisp/riece-url.el | 2 +- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35ef5be..053df5f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2004-05-04 Daiki Ueno + * riece-ctlseq.el (riece-ctlseq-hide-controls): New user option. + + * riece-keyword.el (riece-keyword): Fixed the parent custom group. + * riece-url.el (riece-url): Fixed the parent custom group. + +2004-05-04 Daiki Ueno + * riece-ctlseq.el: New add-on. * COMPILE (riece-modules): Add riece-ctlseq. * Makefile.am (EXTRA_DIST): Add riece-ctlseq.el. diff --git a/lisp/riece-ctlseq.el b/lisp/riece-ctlseq.el index 87729d5..1254011 100644 --- a/lisp/riece-ctlseq.el +++ b/lisp/riece-ctlseq.el @@ -29,15 +29,31 @@ ;;; Code: -(require 'riece-highlight) +(require 'riece-options) -(defvar riece-ctlseq-colors +(defgroup 'riece-ctlseq nil + "Highlight control sequences in IRC buffer." + :group 'riece) + +(defcustom riece-ctlseq-colors '("white" "black" "red" "orange" "yellow" "LightGreen" "DarkOliveGreen" "cyan4" "turquoise" "blue" "black" "black" "black" "black" "black" - "DarkBlue" "purple1" "purple2" "purple3" "magenta")) + "DarkBlue" "purple1" "purple2" "purple3" "magenta") + "List of colors can be used with ^C,." + :group 'riece-ctlseq + :type '(repeat (string :tag "Color"))) + +(defcustom riece-ctlseq-hide-controls t + "If non-nil, control characters are hidden." + :group 'riece-ctlseq + :type 'boolean) + +(defcustom riece-ctlseq-face-cache-size 128 + "Maximum length of the internal face cache." + :group 'riece-ctlseq + :type 'integer) (defvar riece-ctlseq-face-cache nil) -(defvar riece-ctlseq-face-cache-size 128) (defvar riece-ctlseq-face-counter 0) (defun riece-ctlseq-compatible-attributes-p (this other) @@ -140,8 +156,10 @@ (while (string-match "[\x2\xF\x16\x1F]\\|\x3\\([0-9]+\\)?\\(,[0-9]+\\)?" (riece-message-text message) start) - (put-text-property (match-beginning 0) (match-end 0) - 'invisible 'riece-ctlseq (riece-message-text message)) + (if riece-ctlseq-hide-controls + (put-text-property (match-beginning 0) (match-end 0) + 'invisible 'riece-ctlseq + (riece-message-text message))) (if attrs (put-text-property start (match-beginning 0) 'riece-ctlseq-attributes (copy-sequence attrs) @@ -166,9 +184,6 @@ (get-text-property start 'riece-ctlseq-attributes)))))) -(defun riece-ctlseq-requires () - '(riece-highlight)) - (defun riece-ctlseq-insinuate () (add-hook 'riece-message-filter-functions 'riece-ctlseq-message-filter) (add-hook 'riece-after-insert-functions 'riece-ctlseq-scan-region)) diff --git a/lisp/riece-keyword.el b/lisp/riece-keyword.el index 37056e2..b07fa5e 100644 --- a/lisp/riece-keyword.el +++ b/lisp/riece-keyword.el @@ -33,7 +33,7 @@ (defgroup riece-keyword nil "Highlight keyword in IRC buffer." - :group 'riece-vars) + :group 'riece) (defcustom riece-keywords nil "Keywords to be highlightened." diff --git a/lisp/riece-url.el b/lisp/riece-url.el index e57b752..f7155bc 100644 --- a/lisp/riece-url.el +++ b/lisp/riece-url.el @@ -37,7 +37,7 @@ (defgroup riece-url nil "URL Browsing in IRC buffer." - :group 'riece-vars) + :group 'riece) (defcustom riece-url-regexp "\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]" "Regular expression that matches URLs." -- 1.7.10.4