Recent

Author Topic: LHelp strange behavior  (Read 9810 times)

Sergios

  • New Member
  • *
  • Posts: 10
LHelp strange behavior
« on: September 23, 2014, 08:56:35 am »
After installing Lazarus and fpc (lazarus-1.2.4-fpc-2.6.4-win32.exe) on Windows 8.1 x64 Pro, I found that LHelp works correctly only if F1 key press. When I am trying to run help from IDE (Help->Help) then observed LHelp disfunction.
For details see captured video: http://youtu.be/UYdFGIfG6tc

Performed steps to solve problem:
1. Reinstalling Lazarus
2. Recompiling and reinstalling chmhelppkg.lpk
3. Trying apply suggestions from Installing Help in the IDE

Any suggestions?
Thanks in advance.

UPD: Oops,  I've posted a topic erroneously here.
Moderators, move a topic in appropriate section.
« Last Edit: September 23, 2014, 09:31:52 am by Sergios »
Windows 8.1 Pro, Lazarus 1.2.4, FPC 2.6.4

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LHelp strange behavior
« Reply #1 on: September 23, 2014, 10:01:32 am »
Welcome to the forum!

What you saw is a known problem.

Help/help does not show any contents in Laz 1.2.4
This is fixed in the current development version and will be in Laz 1.4 when it is released. See http://wiki.lazarus.freepascal.org/Lazarus_1.4.0_release_notes#IDE_Changes

There are some more issues with help (searching doesn't return all records etc) which I'm working on; please see the bug tracker with items tagged lhelp such as

Help finds only Topics that Starts with the search word
http://bugs.freepascal.org/view.php?id=22345

F1 (context sensitive help) gives chooser with duplicate entries
http://bugs.freepascal.org/view.php?id=26681

Lhelp: Search can't find GetPart while it is in Index
http://bugs.freepascal.org/view.php?id=22763

Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Sergios

  • New Member
  • *
  • Posts: 10
Re: LHelp strange behavior
« Reply #2 on: September 23, 2014, 10:40:14 am »
There are some more issues with help (searching doesn't return all records etc) which I'm working on; please see the bug tracker with items tagged lhelp such as
...
Thanks for reply. It was useful.
Windows 8.1 Pro, Lazarus 1.2.4, FPC 2.6.4

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11444
  • FPC developer.
Re: LHelp strange behavior
« Reply #3 on: September 23, 2014, 10:43:00 am »
How is "search" defined in lhelp?   Does it trawl through its own indexes, or does it use the fulltextsearch of CHM?

That latter part hasn't really been put through the test afaik.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LHelp strange behavior
« Reply #4 on: September 23, 2014, 11:00:25 am »
C:\Development\lazarus\components\chmhelp\lhelp\chmcontentprovider.pas
seems to indicate it uses the CHM search (or index????)

TChmContentProvider.SearchButtonClick
Code: [Select]
        FIftiMainStream := fchms.Chm[i].GetObject('/$FIftiMain');
..
        SearchReader := TChmSearchReader.Create(FIftiMainStream, True); //frees the stream when done
        fChms.Chm[i].SearchReader := SearchReader;
...
      TopicResults := SearchReader.LookupWord(SearchWords[j], TitleResults);

and
($fpcdir)\packages\chm\src\chmreader.pas
Code: [Select]
property SearchReader: TChmSearchReader read FSearchReader write FSearchReader;
... I would assume that that uses the CHM data?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11444
  • FPC developer.
Re: LHelp strange behavior
« Reply #5 on: September 23, 2014, 11:34:07 am »
It uses CHM search, which is the fulltextsearch facility. This is the same as the search tab in CHMs in Windows. But that is not equal to searching the index.

TOC, Index and fulltextsearch are different things.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LHelp strange behavior
« Reply #6 on: September 23, 2014, 11:41:07 am »
Thanks. I understand these are different things - but I wasn't sure which one it used.

Is there any FPC utility that exercises the fulltextsearch CHM code?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11444
  • FPC developer.
Re: LHelp strange behavior
« Reply #7 on: September 23, 2014, 11:50:55 am »
It's one of the things I haven't investigated yet, afaik only Andrew knows it. Maybe it should also index titles.  The gettempdir to tempdir might be difficult, that requires understanding (hyphenation patterns etc), but maybe we can add a kind of hints to fulltext search in the fpdoc sources for such cases.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11444
  • FPC developer.
Re: LHelp strange behavior
« Reply #8 on: September 24, 2014, 11:41:47 am »
I updated yesterday, and lhelp didn't work (release CHMs from my site, fpc and lazarus both trunk).

Somehow lhelp would start, but stay hidden. Manually running lhelp and browsing for chm etc worked.

I do notice however I don't see duplicate entries for tform in the search and index tabs. So the question is how the codepath of a context sensitive lookup functions(on the lhelp side). Can you give me some pointers?
« Last Edit: September 24, 2014, 11:45:15 am by marcov »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LHelp strange behavior
« Reply #9 on: September 24, 2014, 12:41:40 pm »
As I said, it goes through the toc, not the index or full text search.

AFAIR code is in ide\idehelpmanager.pas... sorry, have lost all details on what gets called where...

I updated yesterday, and lhelp didn't work (release CHMs from my site, fpc and lazarus both trunk).

Somehow lhelp would start, but stay hidden. Manually running lhelp and browsing for chm etc worked.
You can enable debugging for lhelp (using an environement variable) which shows the messages received through simpleipc. one of them should be the show message (IIRC, by heart, coded as rtMisc).
If you would, please post a log so I can have a look at it (probably will take a while though)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LHelp strange behavior
« Reply #10 on: September 24, 2014, 05:29:51 pm »
FYI setting lhelp_debuglog environment variable then starting Laz, press f1 on TForm, then F1 on begin gives for me:
Code: [Select]
got rturl, filename D:\Docs\Pascal\LazarusHelp\fcl.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\fcl-res.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\fpdoc.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\fpspreadsheet.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\lazutils.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\lcl.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\prog.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\ref.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\rtl.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\toc.chm, url /index.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\user.chm, url /index.html
Just sent TLHelpResponse code: 3
got rtmisc/mrShow
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\lcl.chm, url /forms/tform.html
Just sent TLHelpResponse code: 3
got rturl, filename D:\Docs\Pascal\LazarusHelp\ref.chm, url /ref/refsu49.html#keyword_begin
Just sent TLHelpResponse code: 3
rtmisc/mrShow is the instruction to show lhelp

Will have a look at the F1 duplicate entry/chooser bug tomorrow...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11444
  • FPC developer.
Re: LHelp strange behavior
« Reply #11 on: September 24, 2014, 05:50:49 pm »
So it gets it data from parsing index.html, which is neither TOC nor index, but in fpdoc generated CHMs, index is probably pretty close to toc.

Code: [Select]
chmls printsystem lcl.chm
chmls, a CHM utility. (c) 2010 Free Pascal core.

 --- #SYSTEM---
(10) Timestamp (32-bit?)           :63352688
(9)  CHM compiler version          :HHA Version 4.74.8702
(4)
 LCID from HHP file                : 1033
 One if DBCS in use                : 0
 one if fullttext search is on     : 1
 Non zero if there are KLinks      : 1
 Non zero if there are ALinks      : 0
 Timestamp                         : 0:0
 0/1 except in dsmsdn.chi has 1    : 0
 0 (unknown)                       : 0
(2)  Default topic from [options]  :index.html
(3)  Title from [options]          :lcl
(0)  Contents file from [options]  :Default.hhc
(1)  Index file from [options]     :Default.hhk
(7)  DWord when Binary Index is on :0(= entry in #urltbl has same first dword
(11)  DWord when Binary TOC is on   :0(= entry in #urltbl has same first dword

Entries 0 and 1 are the names of the (XML) textual toc and index.

Both toc and index can also be in binary form. IIRC index is by default binary, and toc not. The above output (7,11) is incorrect in this regard.

The binary forms are stored as B+trees.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LHelp strange behavior
« Reply #12 on: September 24, 2014, 07:17:20 pm »
So it gets it data from parsing index.html,
If you get that purely from the log output above I'm wondering how you can draw that conclusion?!? We're talking about lhelp output; any handling/parsing of chm files by the IDE is (obviously) not included there.

The first entries like
Code: [Select]
got rturl, filename D:\Docs\Pascal\LazarusHelp\fcl.chm, url /index.html
reflect the IDE iterating through all chms in the docs there and just telling lhelp to open that file with /index.html in order to load the file.

Of course, if you looked at the code in the IDE, that's another matter...

Anyway, will get back on this probably tomorrow.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11444
  • FPC developer.
Re: LHelp strange behavior
« Reply #13 on: September 24, 2014, 08:18:50 pm »
The first entries like
Code: [Select]
got rturl, filename D:\Docs\Pascal\LazarusHelp\fcl.chm, url /index.html
reflect the IDE iterating through all chms in the docs there and just telling lhelp to open that file with /index.html in order to load the file.

Ok. I assumed this was all ide-lhelp conversation, hence it had to be that :-)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LHelp strange behavior
« Reply #14 on: September 25, 2014, 02:33:41 pm »
Quote
tried dumping the index out of the LCL.chm from the bug report.

Found duplicates
Code: [Select]
        <LI> <OBJECT type="text/sitemap">
                <param name="Keyword" value="TForm">
                <param name="Name"" value="TForm">
                <param name="Local" value="forms/tform.activecontrol.html">
             </OBJECT>
on line 709,3025,3859 (stopped looking -  and no idea if this is actually how keyword and name are interpreted)...

Huh? Tried again this morning and couldn't find the duplicates?! May have made a mistake yesterday or today... Sorry.
« Last Edit: September 26, 2014, 08:51:09 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018