Search                        Top                                  Index
HELP VED_SS                                       Aaron Sloman Oct 1994

LIB VED_SS

         CONTENTS - (Use <ENTER> g to access required sections)

 -- Introduction
 -- Naming conventions
 -- Trailing spaces
 -- Autoloading
 -- The new commands
 -- . ENTER ss <string>
 -- . ENTER ww <string>
 -- . ENTER bss <string>
 -- . ENTER bww <string>
 -- . ENTER ssr <string>
 -- . ENTER wwr <string>
 -- . ENTER bssr <string>
 -- . ENTER bwwr <string>
 -- . ENTER ssp <string>
 -- . ENTER wwp <string>
 -- . ENTER bssp <string>
 -- . ENTER bwwp <string>

-- Introduction -------------------------------------------------------
This library provides an alternative to the system caseless search
libraries provided in Poplog V14.5.

If put in $poplocal/local/auto it will shadow the system version. If
put in $poplocal/local/lib it will have to be explicitly loaded, e.g.
by
    uses ved_ss
or
    lib ved_ss


The existing libraries, ved_ss and ved_ww are modified here, and there
are several extensions.

There are three main changes:

1. Backward caseless search procedures are provided.

2. Backward searching does not wrap as the new default backward
searching does.

3. There is a new state variable associated with these routines,
        vedss_searchstring

If any of the procedures described below is run with an empty argument
string they use the current value of vedss_searchstring. This means
that the last string searched for in caseless mode can be different
from the last one searched for normally. This makes it easy to alternate
between searching for two strings.

4. In addition there are new options dealing with different types
of forward or backwards caseless search in different search regions,

-- Naming conventions -------------------------------------------------

The procedures defined below are:

    ved_ss          ved_ww
    ved_bss         ved_bww
    ved_ssr         ved_wwr
    ved_bssr        ved_bwwr
    ved_ssp         ved_wwp
    ved_bssp        ved_bwwp

The commands containing 'ss' involve embedded caseless search, while
those with 'ww' search for non-embedded strings (e.g. complete pop-11
words).

Those starting with 'b' search backwards.

Those ending with 'r' search in the current marked range.
Those ending with 'p' search in the current procedure.

If neither 'r' nor 'p' is present, the whole file is searched.

Thus to search backwards for the previous occurrence of "lvars"
in the current procedure do

    ENTER bwwp lvars

Note: none of the backward searches will "wrap" to the bottom of the
file or range or procedure if an instance is not found before the
start location.


-- Trailing spaces ----------------------------------------------------

The main problem with these procedures is that you cannot use a closing
delimiter. This means you can't find trailing spaces by giving a
delimeter. However you can use "\s" to represent trailing spaces, e.g.
    ENTER ss define\s

See HELP ASCII for other codes.

-- Autoloading -------------------------------------------------------

The main library file is LIB * VED_SS, which defines all the procedures.
Other files are linked to this, but in case not everything has been
linked you can make sure that all the procedures described here are
available for use by doing

    uses ved_ss


-- The new commands ---------------------------------------------------

-- . ENTER ss <string>

    Searches for string.  If string is missing, uses last string
    searched for.

-- . ENTER ww <string>

    Like ved_ss, but checks for word boundaries at both ends of found
    string. This is partly like <ENTER> "<string>" but caseless.

-- . ENTER bss <string>

    Like ss but searches backward. Does not wrap.

-- . ENTER bww <string>

    Like ww but searches backward. Does not wrap.

-- . ENTER ssr <string>
    Search only in range. Does not wrap

-- . ENTER wwr <string>
    Search for non-embedded string only in range. Does not wrap

-- . ENTER bssr <string>
    Search backward in range. Does not wrap

-- . ENTER bwwr <string>
    Search backward for non-embedded string only in range. Does not wrap

-- . ENTER ssp <string>
    Search only in current procedure. Does not wrap

-- . ENTER wwp <string>
    Search for non-embedded string only in current procedure. Does not wrap

-- . ENTER bssp <string>
    Search backward in current procedure. Does not wrap

-- . ENTER bwwp <string>
    Search backward for non-embedded string only in current procedure.
    Does not wrap

The above commands can be turned into procedures with given
strings by applying veddo to appropriate strings.

E.g.
    define ved_bv();
        ;;; ENTER bv
        ;;;     search backward for "lvars" in current procedure
        veddo('bwwp lvars')
    enddefine;

*/

--- $poplocal/local/help/ved_ss
--- Copyright University of Birmingham 1997. All rights reserved. ------