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: Sat, 28 Sep 2024 19:02:44 +0200 Message-ID: <874j5ziudn.fsf@gnu.org> References: <8734ljg6f5.fsf@gmail.com> <86msjr6ayu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33257"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.6; emacs 31.0.50 Cc: 73530@debbugs.gnu.org, Visuwesh To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 28 19:03:53 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 1suarI-0008V5-Io for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Sep 2024 19:03:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suar1-0003VY-4m; Sat, 28 Sep 2024 13:03:35 -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 1suaqy-0003VI-TC for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2024 13:03:33 -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 1suaqy-0002Ap-K7 for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2024 13:03:32 -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=siqeC53D75CqGbfnw4Ai5bDGFUt236oZDx2UI8BESAg=; b=v5O7bcIP9DaAtqq4XRLkb4I/QAEtDHQ62hMJYwc0IaMv9/tviREygPOllzfdmfIocw8+MoED/h8wLVXWjBVStjRNaw++onWjE4hrQ8CPgW/msame51BwKWJV1DUxD6T8/oAYStoA8tGq6VbH71GkD3+8taZHRwIBty8WirUoVNrt3jpHpIjfYVqWycUftCAm8D0vCqy+zwdqSZNKZYKSDfuxf4Ih/G+fGnOYKhX7utWwF4jXk5fobaoMQysj29rZALLZw/UGP60h03Ehj8WzP3zJ105lcYBb1hx/8BRC9Vt47DL2HE2GtDLLjls7ScVjA6CIW51Suull7IVD+phWJw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1suarR-0005Kl-Po for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2024 13:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Sep 2024 17:04:01 +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.172754300720450 (code B ref 73530); Sat, 28 Sep 2024 17:04:01 +0000 Original-Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 17:03:27 +0000 Original-Received: from localhost ([127.0.0.1]:38579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suaqt-0005Jm-5F for submit@debbugs.gnu.org; Sat, 28 Sep 2024 13:03:27 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suaqq-0005JW-Ic for 73530@debbugs.gnu.org; Sat, 28 Sep 2024 13:03:25 -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 1suaqH-00025q-3C; Sat, 28 Sep 2024 13:02:49 -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=siqeC53D75CqGbfnw4Ai5bDGFUt236oZDx2UI8BESAg=; b=Wayv4855AHdenOz7TrA/ IVt13C0Bs6GyQmFuA0RNHmmZcfSjHt/l3ZsnaV8Ck2MWxTboQqJ5SxEoC3e8uVf9lKrQ4E/8xPTQt rIhRF9lAzFbCamoKz6/bUSpIwiQLsSjMd+g4m3GraHtKWO5gjxFtw/MDX9mYU3zybtdKrjBcpBgV7 hfXviH0/LSBOJXN17RJms7C/vhgDC0VYGEkIKzWtcY8ozHbs4dsrS1A2hmv1UUCuNmksDvlHhrdpq cXZ7vi7jlb6YQO9p08u/R1SqiT1Ah9wD+8KFKT/r1uFzvoBOcoFz6PN651M7yAc/GJISg3nzM+pd0 8CL6gS/6AdzPAQ==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduuddgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgesthdtredttdertden ucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenuc ggtffrrghtthgvrhhnpeeluddvgeefuddvjeekfeetleegtefgveehhfeuffeuffeghefg ueefgfdvffegtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieej feekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilh drfhhmpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthho peejfeehfedtseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvhhishhufi gvshhhmhesghhmrghilhdrtghomhdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail In-Reply-To: <86msjr6ayu.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Sep 2024 18:42:49 +0300") 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:292591 Archived-At: Eli Zaretskii writes: >> Attached patch adds a function to create imenu index for Djvu files >> using djvused. If you do not have a Djvu file available, I can point >> to a file from libgen that can be used as a test file. > > Thanks, but can we please not hard-code names of programs, and instead > use variables that can be adjusted by users? I know that "mutool" was > hard-coded, but adding more hard-coded programs sounds too much. That would be good, yes. > Adding Tassilo to the discussion. > >> + When the @command{mutool} or the @command{djvused} 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 the required program 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}. > > This is misleading, I think: it leaves the impression that the two > tools are interchangeable, where in reality each one supports > different format of files. The text should say explicitly that one is > for PDF, the other for Djvu. Indeed. And while we are here: doesn anyone know why we have an option to disable imenu support? I see that we have that since Jose contributed the initial imenu support but why? I can't see any harm done if it was always enabled and would give a user-error like "For imenu support for XXX files, program YYY has to be installed" or something when invoking imenu. And why someone might want to disable it even if the required program is available is beyond my imagination. I mean, if you don't want to use imenu, then just don't invoke it... >> -(defcustom doc-view-imenu-enabled (and (executable-find "mutool") t) >> - "Whether to generate an imenu outline when \"mutool\" is available." >> +(defcustom doc-view-imenu-enabled (and (or (executable-find "mutool") >> + (executable-find "djvused")) >> + t) >> + "Whether to generate an imenu outline when available. > > "When available" sounds awkward. "When possible", perhaps? > > Also, "generate imenu outline" is too general. Don't forget that the > first line of a doc string is shown by apropos commands, and so should > speak for itself. I would say > > Whether to generate imenu outline for PDF and DJVU files. > > The "when available" part is unnecessary, because Emacs checks for > availability, and the user can override that. Well, if we must keep this defcustom, then it should probably allow enabling/disabling the feature for each file type separately, i.e., its value should be a set (pdf djvu). Bye, Tassilo