lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev USE_PSRC internals


From: Vlad Harchev
Subject: Re: lynx-dev USE_PSRC internals
Date: Thu, 20 May 1999 21:41:34 +0500 (SAMST)

On Fri, 29 Jan 1999, Leonid Pauzner wrote:

> >      * From: Vlad Harchev <address@hidden>
> > On Fri, 21 May 1999, Leonid Pauzner wrote:
> 
> >> >  While lynx is in psrc mode, SGML.c converts html it recieves to another 
> >> > ht
> > ml.
> >>
> >> Looking into mainloop I found out the following line:
> >>
> >> #ifdef USE_PSRC
> >>                 psrc_first_tag = TRUE;
> >> #endif
> >>
> >> It present in large `force_reload' cycle and *not* in HTreparse_document()
> >> cycle. Does it necessary at all? (seems no psrc problems found specific for
> >> SOURCE_CACHE!=NONE).
> >>
> 
> >  This is needed. Variable  psrc_first_tag indicates that the current mode is
> > psrc mode. There are 2 sets of functions that aid conversion HTML->source - 
> > in
> > HTML.c and in SGML.c.
> >   If user requests source of any page that is generated bypassing
> > SGML.c (like dired), the code in SGML.c won't be able to dump a source of 
> > html
> > (since no html is passed through it).
> >  If user invokes source view on any file that physically exists somewhere,
> > that file is passed through SGML.c that emits appropriate formatting for
> > source. So, when the SGML_new is called, and psrc_view==TRUE, code in
> > SGML_new sets psrc_first_tag to FALSE - this tells code in HTML.c that it
> > shouldn't do source dumping.
> >    If source view was invoked on any internal html
> > page, that was generated by directly calling HTML_put_character (like dired
> > pages), no calls to SGML_put_character are performed - so the code in HTML.c
> > now does conversion to source. It decides whether to do this by inspecting 
> > the
> > value of  psrc_first_tag - if it's TRUE, then SGML_new wasn't called -> so
> > HTML.c should do conversion itself.
> 
> OK, so we should add a comment like this into mainloop:
> 
> #ifdef USE_PSRC
> /* this flag is need for special pages (e.g. directory listing)
> implemented directly via HTML_new() and not via SGML_new().
> Initialize here; normally reset by SGML_new().
> */
>                 psrc_first_tag = TRUE;
> #endif
>[...]

 Sorry, I was slightly  incorrect in the description of psrc_first_tag. The
variable
 sgml_in_psrc_was_initialized 
is used for detection of whether SGML engine was initialized. The variable 
   psrc_first_tag
is also used in HTML_start_element. If page bypasses SGML.c (ie all conversion
HTML->source is performed in HTML_start_element), this variable tells whether 
HTML_start_element was called for current page in psrc_view. If it wasn't
called, then some initialization is performed (like emitting styles for 
normal text, etc).
  But this variable is required also.
  BTW, all those vars are described in LYPrettySrc.h, so IMO there is no need
to duplicate description.

 Best regards,
  -Vlad


reply via email to

[Prev in Thread] Current Thread [Next in Thread]