[climacs-devel] Regexs in climacs

Lawrence Mitchell wencel at gmail.com
Mon Jan 24 12:24:19 UTC 2005


Hi there,

after my rather abortive attempts to try and define a
delete-other-windows the other day, I thought I'd look at maybe
supporting some kind of regex search in climacs.

The obvious candidate for the matching is Edi Weitz's CL-PPCRE, after
all, we don't want to do more work than we have to.  The question then
becomes, how do we match things?  AFAICT, cl-ppcre matches on strings,
so the naive way of hooking it into climacs is to return the buffer as
a string, match against that, extract the offsets and then move POINT
to the relevant place.

This, however, doesn't seem particularly clean, will not be
particularly efficient for large buffers, and completely ignores the
fact that climacs buffers can contain general objects, rather than
just characters.

So, any suggestions?  I suppose one could construct strings to match
against "lazily", say, construct a string containing the current
line's contents, try and match against that, if it doesn't match,
trying matching on the current line and the next line as well.

Alternately, find a nice way of hooking the cl-ppcre way of doing
things into climacs' mode of operation.

Lawrence
-- 
Lawrence Mitchell



More information about the climacs-devel mailing list