From: "Tassilo Horn" <tsdh@gnu.org>
To: Visuwesh <visuweshm@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, "Jose A. Ortega Ruiz" <jao@gnu.org>,
73530@debbugs.gnu.org
Subject: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view
Date: Thu, 03 Oct 2024 14:11:32 +0200 [thread overview]
Message-ID: <ba4ea660-6b08-42e2-b432-709407c23137@betaapp.fastmail.com> (raw)
In-Reply-To: <87plohcuhm.fsf@gmail.com>
Hi again,
of course we should do the nameddest thing in another patch. No reason to put this one on hold.
Thanks,
Tassilo
Am Do, 3. Okt 2024, um 13:10, schrieb Visuwesh:
> [வியாழன் அக்டோபர் 03, 2024] Tassilo Horn wrote:
>
>> Tassilo Horn <tsdh@gnu.org> writes:
>>
>> Hi again,
>>
>>>> The PDF generated by LaTeX can have a wildly different outline than
>>>> matched by doc-view's regexp:
>>>>
>>>> % mutool show test.pdf outline
>>>> | "Text" #nameddest=section.1
>>>> | "Annotations" #nameddest=section.2
>>>>
>>>> Compare it with:
>>>>
>>>> % mutool show atkins_physical_chemistry.pdf outline
>>>> | "Cover" #page=1&view=Fit
>>>> | "PREFACE" #page=7&view=Fit
>>>> | "USING THE BOOK" #page=8&view=Fit
>>>
>>> Ok, I see. All my LaTeX PDFs have #nameddest=section.x values instead
>>> of #page=X values, so that's the reason they don't work. It would be
>>> good if we could mention that it won't work because there are no page
>>> references in the outline in the error message.
>>
>> Would you mind doing that in a new version of the patch?
>>
>> And I wonder if it mutool could spit out page references in addition to
>> the nameddest references. Do you know if there's a technical limitation
>> or if it's just not implemented?
>
> Unfortunately, I have no idea. I actually don't use doc-view for PDF
> files, only for docx and DjVu.
>
>> Sadly, their communication platform seems to be Discord where I didn't
>> want to register an account to ask. They seem to use the ghostscript
>> bugzilla, so one could create a ticket there... If nobody else here in
>> the discussion already has an account there, I wouldn't mind creating
>> ony myself and asking.
>
> If I cannot find anything in the man page, I can ask in their Discord.
> I do have an account lying around, I can at least put it to good use.
>
> Can this be done in another patch later on? I am not sure if I will get
> the time soon to follow up on this part of the problem. It would be
> cleaner if we open another bug report to track this too.
>
>>>>> For DjVu, my sample size is 1, and that's a presentation, so at least
>>>>> here I'm not sure if there should be an index available...
>>>>
>>>> I will send the link to the DjVu file that I wrote the feature for
>>>> off-list. I will send a link to a PDF file too.
>>>
>>> Thanks, will try with those two files.
>>
>> I did so now and it is blazingly fast for those 80+mb PDF/DjVu files
>> even on my almost 10 years old laptop, so I'd say your simpler approach
>> is the right choice.
>>
>>>> On this note, should we use doc-view-pdfdraw-program in place of
>>>> mutool in doc-view--pdf-outline?
>>>
>>> Yes, but only if the older names pdfdraw and mudraw already had the
>>> "show <file> outline" feature.
>>
>> I revert the "but only if" part. If mupdf is old and comes with, e.g.,
>> the pdfdraw executable, chances are almost zero that mutool is
>> installed, too. And if it is, then we should prefer it anywhere. So I
>> think the way to go is to (executable-find "mutool") in
>> doc-view-pdfdraw-program first so that it takes precedence and use
>> doc-view-pdfdraw-program in doc-view--pdf-outline.
>
> OK, I will post a patch if you're okay with opening another bug report
> for the nameddest PDF thingy.
>
>>>>> Well, I actually have no strong opinion here. Technically, I like
>>>>> your approach better because of its simplicity. I would like to test
>>>>> with some larger documents to see how long index building takes,
>>>>> though.
>>>>
>>>> I tried the function with a large PDF file:
>>>
>>> Will try with the large two you've linked later.
>>
>> As said above, it's more than fast enough, so let's take your approach.
>
> Great, thank you for taking the time to test the patch.
next prev parent reply other threads:[~2024-10-03 12:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-28 15:10 bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view Visuwesh
2024-09-28 15:42 ` Eli Zaretskii
2024-09-28 17:02 ` Tassilo Horn
2024-09-28 17:35 ` Visuwesh
2024-09-28 17:53 ` Eli Zaretskii
2024-09-28 18:11 ` Tassilo Horn
2024-09-28 19:03 ` jao
2024-09-28 19:15 ` Tassilo Horn
2024-09-28 19:50 ` Jose A. Ortega Ruiz
2024-09-29 14:03 ` Tassilo Horn
2024-09-29 14:34 ` Visuwesh
2024-09-29 16:20 ` Tassilo Horn
2024-09-29 16:38 ` Visuwesh
2024-09-29 17:15 ` Tassilo Horn
2024-09-30 17:29 ` Visuwesh
2024-10-02 6:42 ` Tassilo Horn
2024-10-02 8:19 ` Visuwesh
2024-10-02 14:53 ` Tassilo Horn
2024-10-03 8:03 ` Tassilo Horn
2024-10-03 11:10 ` Visuwesh
2024-10-03 12:11 ` Tassilo Horn [this message]
2024-10-03 14:51 ` Visuwesh
2024-10-04 5:31 ` Tassilo Horn
2024-10-04 7:31 ` Visuwesh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba4ea660-6b08-42e2-b432-709407c23137@betaapp.fastmail.com \
--to=tsdh@gnu.org \
--cc=73530@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=jao@gnu.org \
--cc=visuweshm@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.