Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-12

lHelp improvements

11 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Соболь Андрей Евгеньевич

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?

Reply by email

Mattias Gaertner
to Соболь Андрей Евгеньевич

On Sun, 27 Dec 2020 17:15:23 +0300
Соболь Андрей Евгеньевич via lazarus

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

Great!

Show quoted text 10 lines
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?

Show quoted text 26 lines
- 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"?

Show quoted text 6 lines
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.

Show quoted text 8 lines
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

Reply by email

Andrey Sobol
to Mattias Gaertner
Show quoted text 23 lines
On Sun, 27 Dec 2020 17:15:23 +0300 Соболь Андрей Евгеньевич via lazarus 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

Show quoted text 31 lines
> - 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.

Show quoted text 5 lines
> 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.

Show quoted text 9 lines
> 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.

Show quoted text 14 lines
> 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

Reply by email

Marco van de Voort
to Mattias Gaertner: On Sun, 27 Dec 2020 17:15:23 +0300 Соболь Андрей Евгеньевич via…

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

Show quoted text 27 lines
> - 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

Reply by email

Andrey Sobol
to Marco van de Voort
Show quoted text 15 lines
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.

Reply by email

Marco van de Voort
to Andrey Sobol

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

Show quoted text 19 lines
> 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.

Show quoted text 5 lines
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.

Reply by email

Sergey Bodrov
to Соболь Андрей Евгеньевич: Hi, guys. I am trying to do the lHelp more convenient. And after I have combined a chm…

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 <

Show quoted text 58 lines
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 https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20201228/f120cf02/attachment.html>

Reply by email

Mattias Gaertner
to Marco van de Voort: Op 12/28/2020 om 4:03 PM schreef Andrey Sobol via lazarus: It is wise to bring this up…
Show quoted text 5 lines
[...] 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.

Show quoted text 5 lines
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

Reply by email

Andrey Sobol
to Mattias Gaertner
Show quoted text 12 lines
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?

Reply by email

Mattias Gaertner
to Andrey Sobol
Show quoted text 7 lines
[...] 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

Reply by email