|
From: lawrence m. <we...@gm...> - 2003-10-16 18:09:39
|
Teemu Hukkanen wrote:
> I was pretty impressed with erc when I tried it recently, I've been
> hooked ever since. After I started ReadingTheWiki, that is. The utter
> lack of documentation was the only obstacle with erc. Sure, the source
> is documented, but I just wanted to use the program. There is a lot of
> information in the wiki, but it doesn't come with the program.
Help appreciated :).
> After some experimentation with charsets all was good, until someone
> used mIRC escape codes on a channel I was on. The result of that is this
> small patch.
This patch seems to be incorrect in some places, e.g. you do
((setq prop-list (cons (list hl-start j fg bg bold ul inv)
prop-list))
Which isn't valid elisp.
Also, your test for erc-interpret-mirc-color means that the
control chars don't get stripped out of the string, which is
annoying. Does the following patch achieve similar
functionality to what you'd envisaged?
Alex, the original change was only a few lines, so papers aren't
needed, are they?
Index: erc.el
===================================================================
RCS file: /cvsroot/erc/erc/erc.el,v
retrieving revision 1.574
diff -u -r1.574 erc.el
--- erc.el 15 Oct 2003 17:15:31 -0000 1.574
+++ erc.el 16 Oct 2003 18:03:37 -0000
@@ -327,6 +327,11 @@
channels, or in an emergency (message flood) it can be turned off to
save processing time.")
+(defcustom erc-interpret-mirc-color nil
+ "*If non-nil, erc will interpret mIRC color codes."
+ :group 'erc
+ :type 'boolean)
+
(defcustom erc-use-info-buffers nil
"*If non-nil, erc will open INFO buffers.
INFO buffers contain information about channels members."
@@ -3370,9 +3375,10 @@
;; bg nil
)
(let ((ccode (substring (car parts) 1)))
- (if (string-match
- "^\\([0-9]\\([0-9]\\)?\\(,[0-9]\\([0-9]\\)?\\)?\\)"
- ccode)
+ (if (and erc-interpret-mirc-color
+ (string-match
+ "^\\([0-9]\\([0-9]\\)?\\(,[0-9]\\([0-9]\\)?\\)?\\)"
+ ccode))
(let ((cspec (match-string 1 ccode)))
(cond ((string-match "^\\([0-9]+\\),\\([0-9]+\\)" cspec)
(setq fg (string-to-number
--
lawrence mitchell <we...@gm...>
|