[Lazarus] lHelp improvements

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list
Hi, guys.

I am trying to do the lHelp more convenient. And after I have combined a chm indexes on start, I think about next step. What I see...
1. Exist a contradiction of behavior for contex searching through hh.exe (windows) an lHelp (this is for first start of help subsystem):
- When I press F1 for hh.exe enabled for context searching, then Lazarus send only one command - open chm file and seek TOC index position.
- When I press F1 for the lHelp enabled for context searching, then Lazarus send group of command as

    got BeginUpdate
    got BeginUpdate
    got rturl, filename M:\lazarus\docs\chm\fcl.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\fclres.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\fpdoc.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\ideintf.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\lazutils.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\lcl.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\prog.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\ref.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\rtl.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\toc.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\user.chm, url /index.html
    got EndUpdate
    got rturl, filename M:\lazarus\docs\chm\ref.chm, url /ref/refse92.html#keyword_function
    got EndUpdate
    got rtmisc/mrShow
   
    Lazarus sends commands for opening all chm files and the last command is for performing contex search. As result hh.exe always does it more faster then lHelp. I think behavior have to be same, only a perform of context seaching. On second request lHelp can open next file and index and so on.
   
2. I think that the lHelp (or user) should make a decision myself, open all indexes on first start or none (for contex search primarily). It should have own preferences for that. But the lHelp don`t have any information about searchpath where is chm files. I can add a new command for sending searchpath or add new option to Lazarus (open all indexes on first start - see paragraph  1).

3. lHelp got a start command with the option "--hide" at start. Then lHelp gets many commands on openning of indexes. I think that I have the right to show lHelp or splash screen on getting first command. Without this, the user gets a hanging program (1-3 sec) and does not understand what happens. This is for the case when I open all the indexes.

What is your opinion about it?
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list
On Sun, 27 Dec 2020 17:15:23 +0300
Соболь Андрей Евгеньевич via lazarus <[hidden email]>
wrote:

> Hi, guys.
>
> I am trying to do the lHelp more convenient.

Great!

> And after I have
> combined a chm indexes on start, I think about next step. What I
> see...

> 1. Exist a contradiction of behavior for contex searching
> through hh.exe (windows) an lHelp (this is for first start of help
> subsystem):
> - When I press F1 for hh.exe enabled for context searching, then
> Lazarus send only one command - open chm file and seek TOC index
> position.

What package opens hh.exe in Lazarus?


> - When I press F1 for the lHelp enabled for context searching, then
> Lazarus send group of command as
>
>     got BeginUpdate
>     got BeginUpdate
>     got rturl, filename M:\lazarus\docs\chm\fcl.chm, url /index.html
>     got rturl, filename M:\lazarus\docs\chm\fclres.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\fpdoc.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\ideintf.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\lazutils.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\lcl.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\prog.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\ref.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\rtl.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\toc.chm,
> url /index.html got rturl, filename M:\lazarus\docs\chm\user.chm,
> url /index.html got EndUpdate
>     got rturl, filename M:\lazarus\docs\chm\ref.chm,
> url /ref/refse92.html#keyword_function got EndUpdate
>     got rtmisc/mrShow
>    
>     Lazarus sends commands for opening all chm files and the last
> command is for performing contex search. As result hh.exe always does
> it more faster then lHelp. I think behavior have to be same, only a
> perform of context seaching. On second request lHelp can open next
> file and index and so on.

Do you mean when user press F1 on an identifier, then lhelp can open
only the target file directly and open the other files on idle?


> 2. I think that the lHelp (or user) should
> make a decision myself,

Do you mean "myself" or "by itself"?

> open all indexes on first start or none (for
> contex search primarily). It should have own preferences for that.
> But the lHelp don`t have any information about searchpath where is
> chm files. I can add a new command for sending searchpath or add new
> option to Lazarus (open all indexes on first start - see paragraph
> 1).

A searchpath command sounds good.

 
> 3. lHelp got a start command with the option "--hide" at start. Then
> lHelp gets many commands on openning of indexes. I think that I have
> the right to show lHelp or splash screen on getting first command.
> Without this, the user gets a hanging program (1-3 sec) and does not
> understand what happens. This is for the case when I open all the
> indexes.
>
> What is your opinion about it?

Yes, this needs improvement and any help is welcome.

Mattias
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list
> On Sun, 27 Dec 2020 17:15:23 +0300
> Соболь Андрей Евгеньевич via lazarus <[hidden email]>
> wrote:
>
>> Hi, guys.
>>
>> I am trying to do the lHelp more convenient.
>
> Great!
>
>> And after I have
>> combined a chm indexes on start, I think about next step. What I
>> see...
>
>> 1. Exist a contradiction of behavior for contex searching
>> through hh.exe (windows) an lHelp (this is for first start of help
>> subsystem):
>> - When I press F1 for hh.exe enabled for context searching, then
>> Lazarus send only one command - open chm file and seek TOC index
>> position.
>
> What package opens hh.exe in Lazarus?
>
You can read here about this
https://wiki.lazarus.freepascal.org/Installing_Help_in_the_IDE

>
>> - When I press F1 for the lHelp enabled for context searching, then
>> Lazarus send group of command as
>>
>>      got BeginUpdate
>>      got BeginUpdate
>>      got rturl, filename M:\lazarus\docs\chm\fcl.chm, url /index.html
>>      got rturl, filename M:\lazarus\docs\chm\fclres.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\fpdoc.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\ideintf.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\lazutils.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\lcl.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\prog.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\ref.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\rtl.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\toc.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\user.chm,
>> url /index.html got EndUpdate
>>      got rturl, filename M:\lazarus\docs\chm\ref.chm,
>> url /ref/refse92.html#keyword_function got EndUpdate
>>      got rtmisc/mrShow
>>      
>>      Lazarus sends commands for opening all chm files and the last
>> command is for performing contex search. As result hh.exe always does
>> it more faster then lHelp. I think behavior have to be same, only a
>> perform of context seaching. On second request lHelp can open next
>> file and index and so on.
>
> Do you mean when user press F1 on an identifier, then lhelp can open
> only the target file directly and open the other files on idle?
>
Yes, but now I have strict commands to open files before. For to do such
as you said I have to get one command to do search and to know where to
get another files.
>
>> 2. I think that the lHelp (or user) should
>> make a decision myself,
>
> Do you mean "myself" or "by itself"?
Yes, it is my mistake.
>
>> open all indexes on first start or none (for
>> contex search primarily). It should have own preferences for that.
>> But the lHelp don`t have any information about searchpath where is
>> chm files. I can add a new command for sending searchpath or add new
>> option to Lazarus (open all indexes on first start - see paragraph
>> 1).
>
> A searchpath command sounds good.

I think should be a preference in the lHelp to open all files on start
or not. Then we can change which files to open on start.

>  
>> 3. lHelp got a start command with the option "--hide" at start. Then
>> lHelp gets many commands on openning of indexes. I think that I have
>> the right to show lHelp or splash screen on getting first command.
>> Without this, the user gets a hanging program (1-3 sec) and does not
>> understand what happens. This is for the case when I open all the
>> indexes.
>>
>> What is your opinion about it?
>
> Yes, this needs improvement and any help is welcome.
>
> Mattias
>
Andrey
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Am 28.12.2020 um 02:03 schrieb Mattias Gaertner via lazarus:
> What package opens hh.exe in Lazarus?
No special package needed. As I described in
https://wiki.freepascal.org/Installing_Help_in_the_IDE#Installing_CHM_help_.28Lazarus_1.0_and_later.29,
hh.exe (the Windows help viewer) can be made to display the chm files
instead of lhelp.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list

Op 12/28/2020 om 2:03 AM schreef Mattias Gaertner via lazarus:

>
>> - When I press F1 for the lHelp enabled for context searching, then
>> Lazarus send group of command as
>>
>>      got BeginUpdate
>>      got BeginUpdate
>>      got rturl, filename M:\lazarus\docs\chm\fcl.chm, url /index.html
>>      got rturl, filename M:\lazarus\docs\chm\fclres.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\fpdoc.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\ideintf.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\lazutils.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\lcl.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\prog.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\ref.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\rtl.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\toc.chm,
>> url /index.html got rturl, filename M:\lazarus\docs\chm\user.chm,
>> url /index.html got EndUpdate
>>      got rturl, filename M:\lazarus\docs\chm\ref.chm,
>> url /ref/refse92.html#keyword_function got EndUpdate
>>      got rtmisc/mrShow
>>      
>>      Lazarus sends commands for opening all chm files and the last
>> command is for performing contex search. As result hh.exe always does
>> it more faster then lHelp. I think behavior have to be same, only a
>> perform of context seaching. On second request lHelp can open next
>> file and index and so on.

Afaik most of the binary indexes (index, FTS) can be mergesorted
together rather cheaply and then stored on disk. Using these rather than
converting everything to text and then parse that again would make it
very fast. This is what HH does.

Even faster is caching the result of the merge on disk (which HH also
does, but only in case of "merged" chm files, which doesn't work with
FPC generated CHM files yet), these are then stored as CHW.

But to invalidate the cache, it should be stored which CHMs were used to
generate it. So that the cache can be invalided.

I'll look into the various fpdoc and chm stuff from tomorrow, when I get
home again

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list



> Afaik most of the binary indexes (index, FTS) can be mergesorted
> together rather cheaply and then stored on disk. Using these rather than
> converting everything to text and then parse that again would make it
> very fast. This is what HH does.
>
> Even faster is caching the result of the merge on disk (which HH also
> does, but only in case of "merged" chm files, which doesn't work with
> FPC generated CHM files yet), these are then stored as CHW.
>
> But to invalidate the cache, it should be stored which CHMs were used to
> generate it. So that the cache can be invalided.
>
> I'll look into the various fpdoc and chm stuff from tomorrow, when I get
> home again
>
I agree with you that need to do a storing on disk or to produce CHW.
And I will do this later.
Creating a new chm package additions also requires a lot of time.
But now I  have not any documentation on chm format,  I have found only
dribs and drabs.
The situation is such that the documentation seems an existing, but it
is very difficult to use for many reasons.
Actual version of lHelp has to work rightly and then I can do next
version. First start 1.5-2 sec I think it is well for loading entire
packet of chms and indexes.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list

Op 12/28/2020 om 4:03 PM schreef Andrey Sobol via lazarus:

>
>
>> Afaik most of the binary indexes (index, FTS) can be mergesorted
>> together rather cheaply and then stored on disk. Using these rather
>> than converting everything to text and then parse that again would
>> make it very fast. This is what HH does.
>>
>> Even faster is caching the result of the merge on disk (which HH also
>> does, but only in case of "merged" chm files, which doesn't work with
>> FPC generated CHM files yet), these are then stored as CHW.
>>
>> But to invalidate the cache, it should be stored which CHMs were used
>> to generate it. So that the cache can be invalided.
>>
>> I'll look into the various fpdoc and chm stuff from tomorrow, when I
>> get home again
>>
> I agree with you that need to do a storing on disk or to produce CHW.
> And I will do this later.

It is wise to bring this up early, because it might require changes to
the general Lazarus  help system, since lhelp needs to get a list of
registered help files at once (so it can manage the combined index
together) rather than individually.

This is also the reason the CHM package does not support it yet, because it


> Creating a new chm package additions also requires a lot of time.

True, but sometimes new is simply needed to not program yourself into
the corner


> But now I  have not any documentation on chm format,  I have found
> only dribs and drabs.

Search for "CHMSPEC", but there as many holes as bits that are
documented. Specially the process of folding the input data into the
datastructure is badly described. Actually the most complete bit is the
sources of the chm package and chmls/chmcmd.

> The situation is such that the documentation seems an existing, but it
> is very difficult to use for many reasons.
> Actual version of lHelp has to work rightly and then I can do next
> version. First start 1.5-2 sec I think it is well for loading entire
> packet of chms and indexes.

As for the CHW bit, I would not try to make the saved index in CHW, just
in some own format.   Increasing CHM compatibility is hard and difficult
work. The main missing problem is that for some unknown reason, hh.exe
doesn't FPC generated "merged" chms. Neither slave nor master chm.

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
chm indexes opens and reads in milliseconds. But filling Index TreeView in LHelp takes seconds of time. Place BeginUpdate / EndUpdate around TreeView filling, and delay will gone.

hh.exe can use external combined Index and Search for multiple chm's.

On Sun, Dec 27, 2020, 17:15 Соболь Андрей Евгеньевич via lazarus <[hidden email]> wrote:
Hi, guys.

I am trying to do the lHelp more convenient. And after I have combined a chm indexes on start, I think about next step. What I see...
1. Exist a contradiction of behavior for contex searching through hh.exe (windows) an lHelp (this is for first start of help subsystem):
- When I press F1 for hh.exe enabled for context searching, then Lazarus send only one command - open chm file and seek TOC index position.
- When I press F1 for the lHelp enabled for context searching, then Lazarus send group of command as

    got BeginUpdate
    got BeginUpdate
    got rturl, filename M:\lazarus\docs\chm\fcl.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\fclres.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\fpdoc.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\ideintf.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\lazutils.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\lcl.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\prog.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\ref.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\rtl.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\toc.chm, url /index.html
    got rturl, filename M:\lazarus\docs\chm\user.chm, url /index.html
    got EndUpdate
    got rturl, filename M:\lazarus\docs\chm\ref.chm, url /ref/refse92.html#keyword_function
    got EndUpdate
    got rtmisc/mrShow

    Lazarus sends commands for opening all chm files and the last command is for performing contex search. As result hh.exe always does it more faster then lHelp. I think behavior have to be same, only a perform of context seaching. On second request lHelp can open next file and index and so on.

2. I think that the lHelp (or user) should make a decision myself, open all indexes on first start or none (for contex search primarily). It should have own preferences for that. But the lHelp don`t have any information about searchpath where is chm files. I can add a new command for sending searchpath or add new option to Lazarus (open all indexes on first start - see paragraph  1).

3. lHelp got a start command with the option "--hide" at start. Then lHelp gets many commands on openning of indexes. I think that I have the right to show lHelp or splash screen on getting first command. Without this, the user gets a hanging program (1-3 sec) and does not understand what happens. This is for the case when I open all the indexes.

What is your opinion about it?
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Mon, 28 Dec 2020 21:05:00 +0100
Marco van de Voort via lazarus <[hidden email]> wrote:

>[...]
> It is wise to bring this up early, because it might require changes
> to the general Lazarus  help system, since lhelp needs to get a list
> of registered help files at once (so it can manage the combined index
> together) rather than individually.

Querying all registered help databases is easy:

lcl unit lazhelpintf
for i:=0 to HelpDatabases.Count-1 do
  HelpDatabases[i]...

For example the IDE registers fpdoc help for RTL, FCL and LCL to
open the lazarus-ccr web pages.

The chmhelppkg replaces them with its own and opens chm files instead.
So, if you are only interested in chm files, see the chmhelppkg package.

 
> This is also the reason the CHM package does not support it yet,
> because it
>
>
> > Creating a new chm package additions also requires a lot of time.  

If you are talking about creating a chm file from the fpdoc files of a
package:
It would be nice if the chmhelppkg could add a button to the package
editor to create or update a chm file.


>[...]

Mattias
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list

> Querying all registered help databases is easy:
>
> lcl unit lazhelpintf
> for i:=0 to HelpDatabases.Count-1 do
>    HelpDatabases[i]...
>
> For example the IDE registers fpdoc help for RTL, FCL and LCL to
> open the lazarus-ccr web pages.
>
> The chmhelppkg replaces them with its own and opens chm files instead.
> So, if you are only interested in chm files, see the chmhelppkg package.
>
I know about it. But the main problem is that the Lhelp is another
application. Need to transfer preference data (search pathes and
registered database files info) to lHelp. Without this I can`t do
nothing better. Now the lHelp recieves strict commands to open files.

I want to get a opinion from maintainers how is better to do that?


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] lHelp improvements

Free Pascal - Lazarus mailing list
On Wed, 30 Dec 2020 21:44:21 +0300
Andrey Sobol via lazarus <[hidden email]> wrote:

>[...]
> I know about it. But the main problem is that the Lhelp is another
> application. Need to transfer preference data (search pathes and
> registered database files info) to lHelp. Without this I can`t do
> nothing better. Now the lHelp recieves strict commands to open files.
>
> I want to get a opinion from maintainers how is better to do that?

Of course the IDE can pass more flags and, or environment variables to
lhelp.


Mattias
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus