accessing the current search regex string

Scott Woodford woodford at crystal.cirrus.com
Fri Oct 20 17:39:12 CEST 2006


Is there a variable or function for accessing the current search 
expression (ie, the one that find_again() implicitly uses)?

Background:  I'm trying to implement a "smart search" macro which does 
the following:

1. If we are in a rangeset range:
    select the next range in that rangeset.

2. Else if there is a selection and it matches the current search 
expression:
    select the next match of the current search expression (which may be 
a regex).

3. Else if there is a selection but it does not match the current search 
expression (which may be ""):
    select the next match of the selection (like ^H).

4. Else (if there is no selection):
    select the next rangeset range.

I'm stuck on how to check for condition 2.  Is it possible?

Thanks,
Scott




More information about the Discuss mailing list