Angus Leeming wrote:
>> Is is possible to search for a text pattern only in a particular
>> (Scrap) paragraph type? - or to find if a search has succeded?
> 
> No. Search for the pattern and then use "server-get-layout".

To answer the second part of the question, "or to find if a search has 
succeded?", I see that "word-find-forward:<text pattern>" does not 
result in any message being passed back to the out pipe. However, the 
cursor is moved and the word is highlighted.

It appears that there is no way currently to pass the selected text 
back to the out pipe, but "server-set-xy:<x> <y>" and "server-get-xy" 
appear to be your friends here. Some convoluted nastiness such as:

server-get-xy
        INFO:monitor:server-get-xy:223 766
word-find-forward:depending

To ascertain whether the word was found or not:
server-get-xy
        INFO:monitor:server-get-xy:104 9212

If the word did not exist, then this will be the end of the document:
buffer-end
server-get-xy
        INFO:monitor:server-get-xy:454 9452

If the cursor is at the end of document then
        The search failed.
        Return to the place from which the search was initiated:
        server-set-xy:223 766
else
        The search succeeded.
        Return the cursor to the word:
        server-set-xy:104 9212

HTH,

-- 
Angus

Reply via email to