[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing marked regions in ZMACS



    Date: Tue, 20 Jun 89 09:55 CDT
    From: ACKLEY@GUINEVERE.tamu.edu (Keith Ackley)


    I have a command in ZMACS where the user marks a region of text,
    and then types a single keystroke to invoke the command. The
    problem is how do I access that section of text in my command.
    Is there some easy way to open a stream on that interval?

    I have found the function OPEN-INTERVAL-STREAM which appears to
    be what I want. But how do you specify the region that has
    been marked by the user.

			      Keith Ackley

Given you call WINDOW-REGION-P so you know you have an active region, you
can use the macro DEFINITION-REGION or DEFINITION-REGION-BPS (depending on
if you want to expand into a REGION or REGION-BPS call; neither can cross
hard secion boundaries, however.  (I've never needed to for functions I've
written...) MAP-OVER-HARD-SECTIONS looks like it takes a start and end bp
and maps a body over each section; you may need to do that if the region may
extend over >1 section in your buffer.... for further research, look in
sys:zwei;macros.lisp

Hope this helps,