From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view Date: Wed, 02 Oct 2024 16:53:33 +0200 Message-ID: <87ttdu1rpu.fsf@gnu.org> References: <8734ljg6f5.fsf@gmail.com> <86msjr6ayu.fsf@gnu.org> <874j5ziudn.fsf@gnu.org> <87y13bel5m.fsf@gmail.com> <-wirQcNBR0cpaXo0jL0sp8CxUkFsFX_iWUm_BoGq4ChYLccOyN7QJN53eHf0Q-AncT65owrhqfPWYnnQO3gRHw==@protonmail.internalid> <87setjhcm6.fsf@gnu.org> <87zfnrzjl7.fsf@mail.jao.io> <87h69zh9nw.fsf@gnu.org> <87v7yfzhfz.fsf@mail.jao.io> <87h69yh7zp.fsf@gnu.org> <87ttdyedga.fsf@gmail.com> <87y13ae8it.fsf@gnu.org> <87plome7oc.fsf@gmail.com> <87ikuddp8q.fsf@gmail.com> <875xqb2efq.fsf@gnu.org> <87y136dihg.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20143"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.6; emacs 31.0.50 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 02 16:56:18 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sw0m1-0004xI-Gc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Oct 2024 16:56:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sw0lp-0005Kb-37; Wed, 02 Oct 2024 10:56:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sw0lm-0005KM-9j for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 10:56:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sw0lm-0002Jg-1T for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 10:56:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=MM9MOxKLTsx5A0PQHqlhPMNN8rHWOuFW/O+LqRJUsQU=; b=SBd+l7LDo87EvrVDeYFN96jC4IXoHzUtTxZiY+owAIhtbfFyVz6lEpQy4PktECB5CIpUU96DXELeiXDtRg3CrqPumB1iMna1U/xlYJYpAa6LpP3biBC1FC/UxDf2YKHUXXypDNvAKdcx3WHesywzIqXNzUwRk2u/R0Lc2A8CN2+RjefMp20eRDqBtUv0ta2iUuWoRB38s0NjZ/Xa+pt+SOqJptIf1tZVtTtuC62pA4MXeA8ni7WhEa+61wSxI5HBfVYIvvP2kWbYsrkx5S9I+D9Jh+cCmpvlYCbTP4ivYfG2jZxzja0chtNjg/C91Ezv3o41gCGKTCc9kqKExAOPSw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sw0lm-0005fb-Hu for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 10:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Oct 2024 14:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73530-submit@debbugs.gnu.org id=B73530.172788095521780 (code B ref 73530); Wed, 02 Oct 2024 14:56:02 +0000 Original-Received: (at 73530) by debbugs.gnu.org; 2 Oct 2024 14:55:55 +0000 Original-Received: from localhost ([127.0.0.1]:58968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sw0le-0005fE-Vr for submit@debbugs.gnu.org; Wed, 02 Oct 2024 10:55:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sw0ld-0005f1-Jo for 73530@debbugs.gnu.org; Wed, 02 Oct 2024 10:55:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sw0jR-0001zA-KC; Wed, 02 Oct 2024 10:53:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=MM9MOxKLTsx5A0PQHqlhPMNN8rHWOuFW/O+LqRJUsQU=; b=sLRabLUhLAurLIA2X0AP ACFoHMum0f1Sxj/oHbcuBXzqQ6mb0rczpxCmwSzGsLZ/phD2iI0Ge/QZQektCha3NQ8hBsog2w0wf xhaZAxSuFKtxEFK538GMa6go7QDfni2O3X3J26/pYUhQ+f+UDFYQxOezLA8YFTyzyhS3nvBOcB5P1 pPnYUfHInQ3iRi046oI1e5nQtnHv0HABFXtuoNCyuUacAQyYrWO2+zTef/sfxXVIqGcJPSWB4Vkij uPlMOkx8qQJqE6xI/Q2ogDY2PB0J/UeKAz2TrWYuOEnbGJYMPXtkgXcEyTeY8dg3bkaqne6rqS+JM uEIF2oE/5lF++A==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduledgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgesthdtredttdertden ucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenuc ggtffrrghtthgvrhhnpeeluddvgeefuddvjeekfeetleegtefgveehhfeuffeuffeghefg ueefgfdvffegtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieej feekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilh drfhhmpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthho peejfeehfedtseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghlihiise hgnhhurdhorhhgpdhrtghpthhtohepjhgrohesghhnuhdrohhrghdprhgtphhtthhopehv ihhsuhifvghshhhmse X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail In-Reply-To: <87y136dihg.fsf@gmail.com> (Visuwesh's message of "Wed, 02 Oct 2024 13:49:55 +0530") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292844 Archived-At: Visuwesh writes: >> Unfortunately, I didn't find a PDF nor DjVu document on my computer >> where an index can be built. I have the relevant tools installed but >> get the message that no index can be built for that document and >> doc-view--outline becomes 'unavailable. >> >> I've tried various PDFs generated by LaTeX with many section, >> subsections, etc. > > 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. >> 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. > 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 outline" feature. >> 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. Thanks, Tassilo