Re: [PATCH] Help Viewer - mouse issues



On Wed, 2007-01-03 at 22:43, Grigory Trenin wrote:
> Pavel Tsekov wrote:
> 
> >How about fixing help_follow_link() instead ? IMO, this
> >would be a proper fix if we agree that the leading '\n'
> >is not desired.
> >  
> >
> Good point!
> Certainly, this would be better.
> 
> > The help format documentation says:
> >
> >  "The hypertext file is a file that may have one or more nodes.
> >   Each node ends with a ^D character and starts with a bracket,
> >   then the name of the node and then a closing bracket."
> >
> >I don't see anything about the newline being part of the
> >node header and that it needs to be stripped. However,
> >as you noted above if the keyboard is used to follow a link
> >the newline is stripped. So, IMO, either the documentation
> >is buggy and we have to fix it and fix help_follow_link()
> >too or the key handling code is wrong to assume that it 
> >has to move beyond the newline. Any thoughts ?
> >  
> >
> It is man2hlp.c who always puts newline after the node header:
>         fprintf (f_out, "\004[Contents]\n");
> ...
>         fprintf (f_out, "%c[%s]", CHAR_NODE_END, buffer);
>         col++;
>         newline ();

Yep.

> Besides, newlines are also present in the "template" - xnc.hlp file.
> 
> It is interesting, however, that move_backward2(), which
> is called when the <up> key is pressed, assumes '\n' as a part
> of the node header, but move_to_top(), which is called when
> the <home> key is pressed - doesn't.
> 
> As for me, I don't like that leading '\n', but it is probably
> a matter of taste. IMHO it is better to fix help_follow_link(),
> move_to_top(), and documentation...

I don't like it either :) But I'd like to hear from the other
people on this list, if possible, before doing anything.

> But I remember (it was 2 months ago, I guess) you suggested
> to rip line wrapping code out of man2hlp and to put it in the
> Help Viewer... If you still plan to do it, may be it would be better
> to patch man2hlp.c also not to insert '\n' after the node header...

Hmm. I don't really understand why the '\n' is necessary - and
since the code is quite old perhaps noone remebers anymore. I'll 
play with the code a bit and see if I be able to determine whether
the newline is of any importance. I'll see if the changelogs will
be of any help too.





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