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 08:42:49 +0200 Message-ID: <875xqb2efq.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34911"; 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 08:44: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 1svt5u-0008vw-Bz for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Oct 2024 08:44:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svt5n-0004iB-TO; Wed, 02 Oct 2024 02:44:12 -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 1svt5e-0004hd-MJ for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 02:44:03 -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 1svt5e-0002KV-DV for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 02:44: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=p+ZDYWlx+a1nw4AhgOTWWVPjdjBNZOLidVh6hQXhCOA=; b=JcIiXgZcT2U1FmQZP0d5qRsXkkutCXPP2z9tL0UKVGw+6rL2kY2Q+9uYXHMoQBvQnB0EyilZpHGeYFYefq5tHdrJ/F9b8tWtq/0gV2Ned9bubQc0YgaGUV89da+FWevJUK8BblMIQVR4HWO/V7k7yA1y3hFz4I3FU8woU5KLZxvznTgjiuofrSpNiaz/JvlHy6Ox3+iN4ugET/2sL2WVUnnUcOfmA5ln37vnt9YB4pYIG/iGWTfZB4Q/2iB0f2W/ev/Z5GC+fQRLnaG6YvHyxYm3Ow0mDpLMuOXS1MjKkuJSAkgPOmz8aCYRaTwOT0bo/y5ifXUPbIzacZYmhnizTg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svt5e-0003ak-Dm for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 02:44: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 06:44: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.172785138313711 (code B ref 73530); Wed, 02 Oct 2024 06:44:02 +0000 Original-Received: (at 73530) by debbugs.gnu.org; 2 Oct 2024 06:43:03 +0000 Original-Received: from localhost ([127.0.0.1]:56398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svt4h-0003Z4-0S for submit@debbugs.gnu.org; Wed, 02 Oct 2024 02:43:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svt4e-0003YQ-IS for 73530@debbugs.gnu.org; Wed, 02 Oct 2024 02:43:01 -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 1svt4Y-0002I3-P6; Wed, 02 Oct 2024 02:42:55 -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=p+ZDYWlx+a1nw4AhgOTWWVPjdjBNZOLidVh6hQXhCOA=; b=ABsGiF9YtNY0s8nxzXZo QmyRbT774oMTJdpNmwj/1O5RHj6enqZagoIoslb726XyZXeR2nGwFoh4SOdWl96TSaP9lj866PdKw IoWIU01/P31cxJYiYuatK+lT2dGjlfFfzSjEHEmGYWqBSCE2hRXoB64ONwogSiNLv7zbRVltd7x3g qbM8f2FkGOkRt6VJfQWf+eYa71KFFiBkWAuCEPokAYSIK7MSC8AAalBm95sllAwjeh+JCTNNhvCyL V5M8lwV4ZsYO6fKyMTIE2R6+RXyGJQ8XvlSKPfY7yquYuInKL68SE/L5QWR4IPQ5v5GI7NCkfy6qX 6CMaYqUmI04j6g==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddukedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhgffffkgggtsehttdertddtredt necuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqne cuggftrfgrthhtvghrnhepleduvdegfeduvdejkeefteelgeetgfevhefhueffueffgeeh gfeufefgvdffgedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeei jeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrih hlrdhfmhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepjeefheeftdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvlhhiii esghhnuhdrohhrghdprhgtphhtthhopehjrghosehgnhhurdhorhhgpdhrtghpthhtohep vhhishhufigvshhhmh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail In-Reply-To: <87ikuddp8q.fsf@gmail.com> (Visuwesh's message of "Mon, 30 Sep 2024 22:59:25 +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:292820 Archived-At: Visuwesh writes: Hi Visuwesh, [Sorry if this message appears twice but it seems to have bounced yesterday.] > Please review the attached. First of all, the patch doesn't apply on master's NEWS and misc.texi here. If I exclude those, the changes to doc-view.el can be applied. 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. 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... That said, I haven't used the imenu feature before so I can't say if it ever worked for me... > diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi > index e19e554fb26..332d5b1468f 100644 > --- a/doc/emacs/misc.texi > +++ b/doc/emacs/misc.texi > @@ -581,17 +581,14 @@ DocView Navigation > default size for DocView, customize the variable > @code{doc-view-resolution}. > > -@vindex doc-view-imenu-enabled > @vindex doc-view-imenu-flatten > @vindex doc-view-imenu-format > - When the @command{mutool} program is available, DocView will use it > -to generate entries for an outline menu, making it accessible via the > -@code{imenu} facility (@pxref{Imenu}). To disable this functionality > -even when @command{mutool} can be found on your system, customize the > -variable @code{doc-view-imenu-enabled} to the @code{nil} value. You > -can further customize how @code{imenu} items are formatted and > -displayed using the variables @code{doc-view-imenu-format} and > -@code{doc-view-imenu-flatten}. > + DocView can generate an outline menu for PDF and Djvu documents using Didn't Eli say the official spelling was DjVu? That's at least the spelling that the djvused man pages also uses and they should know. > +the @command{mutool} and the @command{djvused} programs respectively > +when they are available. This is made accessible via the > @code{imenu} +facility (@pxref{Imenu}). You can customize how > @code{imenu} items are +formatted and displayed using the variables > @code{doc-view-imenu-format} +and @code{doc-view-imenu-flatten}. I guess you should mention the new defcustom doc-view-djvused-program here, too. > +(defcustom doc-view-imenu-enabled (and (or (executable-find "mutool") > + (executable-find "djvused")) > + t) > + "Whether to generate imenu outline for PDF and Djvu files. > +This uses \"mutool\" for PDF files and \"djvused\" for Djvu files." > :type 'boolean > - :version "29.1") > + :version "31.1") > +(make-obsolete-variable 'doc-view-imenu-enabled > + "Imenu index is generated unconditionally, when available" > + "31.1") Ah, I thought our last agreement was that we keep that variable (as suggested by Jose) as it is used right now but make it possible to have a value that tells to index only PDF or DjVu documents. 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. Anyhow, please write a complete sentence in the deprecation, so a dot at the end. And remove the comma. Bye, Tassilo