[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev patch - search in partial mode (part1)
From: |
Leonid Pauzner |
Subject: |
Re: lynx-dev patch - search in partial mode (part1) |
Date: |
Wed, 17 Nov 1999 22:56:41 +0300 (MSK) |
17-Nov-99 12:11 Klaus Weide wrote:
> On Sun, 7 Nov 1999, Leonid Pauzner wrote:
>> * reorganize the code: 'search_target' now became global, so display_page()
>> and highlight() could be called from any place easily. This was a mainloop
>> local variable (name changed from 'prev_target' to avoid conflict
>> elsewhere), the value currently changed in mainloop(), handle_LYK_WHEREIS()
>> and textsearch().
> I don't like omitting the 'target' parameter from all the calls, for reasons
> of modularity. 'target' is an important input to display_page() and
> highlight() etc. Omitting the parameter makes the dependency less obvious,
> it hides it. Making more and more parameters global variables isn't
> generally a good direction.
This is not a 'general' case. We have www_search_result global
which is more obscuring than the prev_target.
We could leave a 'target' argument in both display_page() and
highlight() but made prev_target (well, search_target) PUBLIC
if you think that would be better.
> You also lose flexibility - there *might* be reason why sometimes
> display_page() or highlight() should be called without highlighting.
I am sceptical on the need of changing this argument in display_page()
outside the mainloop. Things like "" below was wrong IMHO:
diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c Thu Nov 4 16:55:46 1999
+++ ./gridtext.c Sun Nov 7 00:24:40 1999
@@ -6772,25 +6771,25 @@
PUBLIC void HText_scrollTop ARGS1(
HText *, text)
{
- display_page(text, 0, "");
+ display_page(text, 0);
}
> Could you look at this again? I think you should be able to basically
> keep 'prev_target' PRIVATE to LYMainLoop.c [but defined outside of
> mainloop()]. Everything that needs to know it should call functions
> in LYMainLoop.c or be called from there.
Currently HText_pageDisplay() called from other places in partial mode
so we need to keep prev_target somethere if we want search in partial
mode. We could made HText_pageDisplay2() without a search target in
LYMainLoop.c as an externall call of HText_pageDisplay() but whether
that would be an improvement?
>> * Add user search in partial mode (while loading of the document is in
>> progress). Scrolling to the string in question is not working properly
>> yet if you repeat 'n' next time. More work required.
>>
>> It is interesting enough that handle_LYK_WHEREIS() and textsearch() work
>> more or less properly while they call '&curdoc' but we load 'newdoc' in
>> fact. Therefor new line /link position is not saved as it should.
> Hmm, so it works only more or less by accident...
a sort of.
That is because global variable 'www_search_result' is used for new line
position from textsearch() and HTFindPoundSelector() - the latter is
responsible for #fragment position.
Besides that textsearch() also change curdoc.line/curdoc.link
Than all that went into Newline changes in mainloop() - that is a mess.
None of them set inside HText_pageDisplay() currently.
I am thinking on a kind of unification but have not succeed yet.
>> Some more play around handle_LYK_WHEREIS/www_search_result/Newline/etc.
>> is required, but that would be a light weighted fine turning patch (or a
>> couple).
> Sounds like this will take a while to sort out. (I have not tried it
> yet.)
But things never get worse due to the changes at least.
> Klaus