Simple X-Chat Custom Regexp Patch
Overview
This small patch is meant for X-Chat Irc client,
version 1.8.8 (or older to 1.4.2). Some modifications might be required if installed into
other X-Chat version. In any case, you will need X-Chat source code
from X-Chat homepage and compile the program with this patch applied
to the source code.
Background
In X-Chat, the user can specify words which mark the line to be
highlighted. In addition, any row including the current nickname of
the user is also highlighted.
If a row is highlighted, it also means that non-active tab is marked
differently from those with non-highlighted new output.
However, there is some problems in the current behaviour of X-Chat:
- Your nickname might be part of the word, like 'rpr' in enterprise.
This was fixed in some version of the X-Chat so that it is only
interested in separated nick. However, this also means that rows like
'rprhoney' are not highlighted, althought this might be desired
effect.
- In most of the channels I am on, people usually reference to
others like 'r, does this sound ok to you?'. How can I highlight this,
as I cannot simple highlight all rows with 'r'.
So, to help comes rpr's Simple X-Chat Custom Rexexp Patch, to allow
highlighting in the most common situations (according to my personal
needs and many of my friends). It is not a complete regexp, because I
think that is a bit too complicated for this use.
So why do not I just use perl or python script? That is because then
the tab would not be highlighted when it is not active.
How it works?
After you have installed the patch and remade xchat binaries, you may
notice that Settings/Setup/Highlighting is now changed a bit. Instead
of 'comma separated words' it now uses limited custom regexp, with
following rules:
- Multiple entries are separated with pipe
'|'
- Alternative characters are put into square bracelets
'[]'
- Exclusive characters are put into square bracelets
'[]'
and started with caret '^'
- Start of the line is marked with caret
'^'
- Any non-alphanumeric character (or start or end of the line) is
marked with backlash
'\'
All comprasions are case-sensitive.
So, for my basic need, I might use highlite row like this:
^[Rr][,:]|\[Rr][Pp][Rr][^eiaEIA]
..or, expanded (ignoring upper case)...
^r,|^r:|\rpr[^eia]
This will highlight all lines starting with 'r,'
or
'r:'
and all lines including text 'rpr'
somewhere, with no preceding alphanumeric character and not followed
by character e, i or a.
The patch itself is made with diff -ur
.
xchat-lregex-patch-1.8.8 (3611
bytes)
(1.4.2: xchat-lregex-patch.diff)
Bugs & Comments
Please report any bugs encountered to marjola ät iki.fi
. Feel
free to comment the patch, and any simple modifications might be
easily added.
Last Words
Use '\t' in print-commands for that tab-line
Set command handler for empty string to capture standard output
Thanks for Bass for finding these out. For X-Chat documentation: shame on you!