GNU bug report logs - #73638
31.0.50; doc-view: imenu index cannot be made for LaTeX PDFs

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Sat, 5 Oct 2024 11:07:02 UTC

Severity: normal

Found in version 31.0.50

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Tassilo Horn <tsdh <at> gnu.org>
Cc: 73638 <at> debbugs.gnu.org
Subject: bug#73638: 31.0.50; doc-view: imenu index cannot be made for LaTeX PDFs
Date: Sun, 06 Oct 2024 12:09:01 +0530
Just realised what you meant by the former: no there's no equivalent of "sh -c".  You need to give the interpreter a script.

On 6 October 2024 11:12:01 GMT+05:30, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Tassilo Horn <tsdh <at> gnu.org>
>> Cc: 73638 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
>> Date: Sat, 05 Oct 2024 21:56:24 +0200
>> 
>> Eli, the executive summary is this.  We already can read a PDFs outline
>> mutool and use that for quick access to chapters and sections through
>> imenu.  However, it turned out that it depends on the PDF at hand if the
>> outline is usable for our purpose where "usable" means we get page
>> references.  And it seems that many PDFs (e.g., those produced by LaTeX)
>> have no page references but named references which won't do the trick
>> for doc-view.
>> 
>> Visuwesh figured out that one can run a JS script using "mutool run
>> <script> foo.pdf" for accessing the PDFs internal structure using the JS
>> mupdf API and wrote the below simple script which spits out the outline
>> with page references as sexp structure.
>> 
>> Would it be ok to distribute the below JS helper script with Emacs so
>> that doc-view can use it?  If so, how?  Maybe the simplest way would be
>> to just put it in some doc-view--mutool-outline-script variable and copy
>> it to doc-view-cache-directory when invoking imenu on a PDF file the
>> first time?
>
>Can't we invoke the JS interpreter with this script as the command, or
>invoke it as async subprocess and pipe the script to it via standard
>input?




This bug report was last modified 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.