From unknown Tue Jun 17 20:20:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#73530 <73530@debbugs.gnu.org> To: bug#73530 <73530@debbugs.gnu.org> Subject: Status: [PATCH] Add imenu index function for Djvu files in doc-view Reply-To: bug#73530 <73530@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:20:22 +0000 retitle 73530 [PATCH] Add imenu index function for Djvu files in doc-view reassign 73530 emacs submitter 73530 Visuwesh severity 73530 wishlist tag 73530 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 11:11:36 2024 Received: (at submit) by debbugs.gnu.org; 28 Sep 2024 15:11:36 +0000 Received: from localhost ([127.0.0.1]:35587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suZ6e-0006CX-2Q for submit@debbugs.gnu.org; Sat, 28 Sep 2024 11:11:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:42280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suZ6b-0006CO-M7 for submit@debbugs.gnu.org; Sat, 28 Sep 2024 11:11:34 -0400 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 1suZ67-0001Ss-9M for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2024 11:11:03 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1suZ65-0006df-9A for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2024 11:11:02 -0400 Received: by mail-pl1-x644.google.com with SMTP id d9443c01a7336-20b64584fd4so2024465ad.1 for ; Sat, 28 Sep 2024 08:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727536259; x=1728141059; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=FJJu4ITbJHmlzA3c29BcOjRJRZGAXCGw2U6XcSVZ96A=; b=c66XKLzIgASKUp8Qm7B5UyI3v6leHN8OP17ZQCRjhjfUMXHDWbiDVFUtFMRiDPjA9B j5f3fAqEhk31yQG/9GM++6ffoBeS7+Q5/hdK+HlZ8CDA6le2gUHlTchDfSXcenB5PpRJ yxGcsN4xaRf8lWTZ9LUaLXU1+8WtfxVgBYOQci9mJC9LCbD4D6nRhN0Cgkr+3vqiQ2uh G5Br8Ae4o5wsralJwNMlGaglKK3Sigw3T1j75WP66oC2831MuYaa14224F7wz3vWXGl+ 0utjIL5Xnl5C/5HRQoSjTUHepP8toY31VjxkS9nO7LyEY628oMfs9/76brRhXgxDLvyu QXSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727536259; x=1728141059; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FJJu4ITbJHmlzA3c29BcOjRJRZGAXCGw2U6XcSVZ96A=; b=HIMHIpTAWkXordPvyqd0Qeu/l//RuS7vgQwf/yHtuM6/HAfTtBLIymvEmnJrBSvUFN BnIFmo0XCAWZpn0ONn7kwOtRYzKbL64HwPY93I7Hc2qciGnMZEP90PW1G2rKB2hJ46Hp xChMInLqt09eK8sxFdCAtkzIttxhCwCeufiEKKQy9pyxJ764sBE2PvkWafoRFErteIMB jkgeNPMI0L3MRTbCVRI5tJZqoEjBY5fcp+G/gSSmGh5UjLB3PS8CVS7Ub7pMkBLX1rQQ QVf2JOB+SUWejN+IgGAp1wlgYOhR5fFgH6Sti9BGquaPL2a20aW9sW7eMr3eVxJ01VS4 fJvw== X-Gm-Message-State: AOJu0YwQJdIQ3kPA1dH0VyllX4Viv7lwRBdJvs+BtTkC8HEkALFRFdxm Ic86S5BIfAlng3RLfJ2cZLhAFudpK76sXcdJD5ywairz8Y+nESbeKZLfN5RX X-Google-Smtp-Source: AGHT+IHGmpsZh3g9k4wZb+KT+G4dlCP8401xGTT83th8OdCLb+GCx99Yp3e3LWBoeJ2mYcwfOxwS8Q== X-Received: by 2002:a17:902:ce12:b0:207:1708:734c with SMTP id d9443c01a7336-20b367d7b35mr88538345ad.11.1727536258953; Sat, 28 Sep 2024 08:10:58 -0700 (PDT) Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e6d01esm27980355ad.308.2024.09.28.08.10.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 08:10:58 -0700 (PDT) From: Visuwesh To: bug-gnu-emacs@gnu.org Subject: [PATCH] Add imenu index function for Djvu files in doc-view Date: Sat, 28 Sep 2024 20:40:54 +0530 Message-ID: <8734ljg6f5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x644.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Tags: patch 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. In GNU Emacs 31.0.50 (build 7, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw scroll bars) of 2024-09-09 built on astatine Repository revision: 7d7aa65f63db78c5732f1580213fc3767b767a4a Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101011 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --with-sound=alsa --with-x-toolkit=lucid --without-xaw3d --without-gconf --without-libsystemd --with-cairo' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Add-imenu-index-function-for-Djvu-files-in-doc-view.patch >From 27174371d677f0e79f2291ce3f2849838a28ca0e Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Sat, 28 Sep 2024 20:37:50 +0530 Subject: [PATCH] Add imenu index function for Djvu files in doc-view * lisp/doc-view.el (doc-view-imenu-enabled): Tweak the default value to check for 'djvused'. (doc-view--djvu-outline, doc-view--parse-djvu-outline): Add new functions to return imenu index for a Djvu file. (doc-view--outline): Add new function to create the imenu index depending on the file type. (doc-view-imenu-index, doc-view-imenu-setup): Use new function instead. * doc/emacs/misc.texi (DocView Navigation): Mention index creation using 'djvused' too. * etc/NEWS: Announce the change. --- doc/emacs/misc.texi | 16 ++++++------ etc/NEWS | 5 ++++ lisp/doc-view.el | 60 +++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 68 insertions(+), 13 deletions(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index e19e554fb26..eee6f08ef3b 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -584,14 +584,14 @@ DocView Navigation @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}. + 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}. @findex doc-view-page-to-register @findex doc-view-jump-to-register diff --git a/etc/NEWS b/etc/NEWS index 607665a71bb..162af7b3e43 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -268,6 +268,11 @@ Docview can store current page to buffer local registers with the new command 'doc-view-page-to-register' (bound to 'm'), and later can be restored with 'doc-view-jump-to-register' (bound to '''). ++++ +*** Docview can generate imenu index for Djvu files. +When the 'djvused' program is available, Docview can now generate imenu +index for Djvu files from its outline. + ** Tramp +++ diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 395993e6263..d461b606ce6 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -216,10 +216,13 @@ doc-view-mupdf-use-svg :type 'boolean :version "30.1") -(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. +This uses \"mutool\" for PDF files and \"djvused\" for Djvu files." :type 'boolean - :version "29.1") + :version "31.1") (defcustom doc-view-imenu-title-format "%t (%p)" "Format spec for imenu's display of section titles from docview documents. @@ -2004,6 +2007,41 @@ doc-view--imenu-subtree (setq outline (cdr outline)))))) (cons (nreverse index) outline))) +(defun doc-view--djvu-outline (&optional file-name) + "Return a list describing the outline of FILE-NAME. +If FILE-NAME is nil, use the current file. + +For the format, see `doc-view--pdf-outline'." + (unless file-name (setq file-name (buffer-file-name))) + (with-temp-buffer + (call-process "djvused" nil (current-buffer) nil + "-e" "print-outline" file-name) + (goto-char (point-min)) + (when (eobp) + (imenu-unavailable-error "Unable to create imenu index using `djvused'")) + (nreverse (doc-view--parse-djvu-outline (read (current-buffer)))))) + +(defun doc-view--parse-djvu-outline (bookmark &optional level) + "Return a list describing the djvu outline from BOOKMARK. +Optional argument LEVEL is the current heading level. If nil, then 1 is +used." + (unless level (setq level 1)) + (let ((res)) + (unless (eq (car bookmark) 'bookmarks) + (user-error "Unknown outline type: %S" (car bookmark))) + (pcase-dolist (`(,title ,page . ,rest) (cdr bookmark)) + (push `((level . ,level) + (title . ,title) + (page . ,(string-to-number (string-remove-prefix "#" page)))) + res) + (when (and rest (listp (car rest))) + (setq res (append + (doc-view--parse-djvu-outline + (cons 'bookmarks rest) + (+ level 1)) + res)))) + res)) + (defun doc-view-imenu-index (&optional file-name goto-page-fn) "Create an imenu index using \"mutool\" to extract its outline. @@ -2012,16 +2050,28 @@ doc-view-imenu-index GOTO-PAGE-FN other than `doc-view-goto-page'." (let* ((goto (or goto-page-fn 'doc-view-goto-page)) (act (lambda (_name _pos page) (funcall goto page))) - (outline (or doc-view--outline (doc-view--pdf-outline file-name)))) + (outline (or doc-view--outline (doc-view--outline file-name)))) (car (doc-view--imenu-subtree outline act)))) +(defun doc-view--outline (&optional file-name) + "Return the outline for the file FILE-NAME. +If FILE-NAME is nil, use the current file instead." + (unless file-name (setq file-name (buffer-file-name))) + (pcase doc-view-doc-type + ('djvu + (when (executable-find "djvused") + (doc-view--djvu-outline file-name))) + (_ + (when (executable-find "mutool") + (doc-view--pdf-outline file-name))))) + (defun doc-view-imenu-setup () "Set up local state in the current buffer for imenu, if needed." (when doc-view-imenu-enabled (setq-local imenu-create-index-function #'doc-view-imenu-index imenu-submenus-on-top nil imenu-sort-function nil - doc-view--outline (doc-view--pdf-outline)) + doc-view--outline (doc-view--outline)) (when doc-view--outline (imenu-add-to-menubar "Outline")))) ;;;; User interface commands and the mode -- 2.45.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 12:10:14 2024 Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 16:10:14 +0000 Received: from localhost ([127.0.0.1]:37901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sua1O-0001tD-2X for submit@debbugs.gnu.org; Sat, 28 Sep 2024 12:10:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suZdb-0008La-S0 for 73530@debbugs.gnu.org; Sat, 28 Sep 2024 11:45:40 -0400 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 1suZaw-0001SG-Tm; Sat, 28 Sep 2024 11:42:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=6eQ0stYTqfqHZ7sVw8EI7AJIaBKYCsAlTGkKcXTzNJ0=; b=OknNtoL+CsxE Pusxbv4egCKZ+ZvoihHTXx2g5VPvDJl5fc0ctMW5/qnGW3Vg2pGKk9sZ/w1RWltuKQt9oVxWFQBKj EOrmg+uFAqGunYC9Jtb3bAi5D8x9ZuLhLObOXbwJGXsfTAbS+dSduehJFI3VPuHkUUNE7rH/EX+cL jckuO2UBxsflGjhDaGhyXvt/fLzV7LBwqptBS/+M3ZZOAZaRWVGtAjpjVkxCbiLryB5gSBXbSQs1b R6gen6TlMh+kOqLRq+zCDkYapjDTtjRCg/FWFJk2M2VkLz99mTlrTK4UqXtk7NJVKPAX16HiOurjG mWbKKcelrUeuFRxHRE/Krw==; Date: Sat, 28 Sep 2024 18:42:49 +0300 Message-Id: <86msjr6ayu.fsf@gnu.org> From: Eli Zaretskii To: Visuwesh , Tassilo Horn In-Reply-To: <8734ljg6f5.fsf@gmail.com> (message from Visuwesh on Sat, 28 Sep 2024 20:40:54 +0530) Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view References: <8734ljg6f5.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Visuwesh > Date: Sat, 28 Sep 2024 20:40:54 +0530 > > > 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. 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. > -(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. > +Optional argument LEVEL is the current heading level. If nil, then 1 is > +used." Optional argument LEVEL is the current heading level, which defaults to 1. > +(defun doc-view--outline (&optional file-name) > + "Return the outline for the file FILE-NAME. > +If FILE-NAME is nil, use the current file instead." Since FILE-NAME can be omitted, it is better to use our usual style: If FILE-NAME is nil or omitted, it defaults to the current buffer's file name. > + (unless file-name (setq file-name (buffer-file-name))) > + (pcase doc-view-doc-type > + ('djvu > + (when (executable-find "djvused") > + (doc-view--djvu-outline file-name))) > + (_ > + (when (executable-find "mutool") > + (doc-view--pdf-outline file-name))))) We already tested that the relevant tool is available, so why test that here again? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 13:03:27 2024 Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 17:03:27 +0000 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 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 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 From: Tassilo Horn To: Eli Zaretskii Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <86msjr6ayu.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Sep 2024 18:42:49 +0300") References: <8734ljg6f5.fsf@gmail.com> <86msjr6ayu.fsf@gnu.org> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Sat, 28 Sep 2024 19:02:44 +0200 Message-ID: <874j5ziudn.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: 73530@debbugs.gnu.org, Visuwesh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 13:37:16 2024 Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 17:37:16 +0000 Received: from localhost ([127.0.0.1]:38597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1subNc-0007FH-8f for submit@debbugs.gnu.org; Sat, 28 Sep 2024 13:37:16 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:61497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1subNa-0007Ew-1m for 73530@debbugs.gnu.org; Sat, 28 Sep 2024 13:37:14 -0400 Received: by mail-pf1-f196.google.com with SMTP id d2e1a72fcca58-7198de684a7so2219742b3a.2 for <73530@debbugs.gnu.org>; Sat, 28 Sep 2024 10:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727544938; x=1728149738; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hmeZoOp0TRPdWCiz2R3Lyvd2x8rewoh4lK9r5/NfnEM=; b=TEGL+v+d0JAhIC3aVv2ZKv+6xjz+RP5C0s4V/Jb3NapS64XFBljICf/E1djMScNHvh fuAk77+HhznpLVLtfK0Q268Zi3bYXcaqSAi4y3ihzMW7ERew1l0/HLxZzhfXeshit1ms 7YShFetVCsYrZZXw2jq2kXt0q9XLst0VlKA6f7FF7CW3+eutBzWk/Kmp3QsoTp8mLiA7 A+gf/YDE6Jdt3o2i8yeJ6hdCc+E84itMJm7KhCSnlKTkg525kLjg/RH7wuv1Tiv2li0L mPDRN6YrxsOkc0AiG4Vypkr7ESAr6E/retNQlxo6jbTbV+clqsQR33QvH/GB/Nnbn5lP gvuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727544938; x=1728149738; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hmeZoOp0TRPdWCiz2R3Lyvd2x8rewoh4lK9r5/NfnEM=; b=WvLK1oJ4x2V98rTIvpahXKmkaDASVd2bEN2bvdM60RQNltiyCgEmVwZx2+Co+iF7SF Gv/opO3sqssEaMMR9Xmz3Xrw3D/ZKisP01/u3hvn5IuYmlv4Ut6Qnfnxzm7w5QbdGxfo BWDvV39EHKDSY/aA4EFjtUd7zk2B23UvQHUFVgWaZA9vCswBfijsmX+P98CBhqtmbhQl lUsUvcXEJw3hhnToBkZIfHQYuZwuuMVu5RJQmeXrm6iIbTT7QsGvBDhynBj4mD/vZHCX XqGOXheXz99ZyAYgTlHZuJ7Y0cMXSS636Wd0WIHppVeXvSRc5p7rNJGE0uLGqmAyCXc8 Gntw== X-Forwarded-Encrypted: i=1; AJvYcCVxecIoITaHDcaKoQAEjXu/KkLCjx2oWU63TRuFZluBKR8ipeztSeveuyCQ36HNe1P4JdjKmw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzusAOQeA01k8+H92zrmTyr3oyyGEd5wTi6e5hU/Nzq4IpSqJiG EcZsL4VnT+BxhAiDGoE6/f2bSnw0+p63DtfiunpYujTZQfaOzogB X-Google-Smtp-Source: AGHT+IGYB+smmWyHy3nORD1JT0qUXQDE1ooTzWYep0xv4SQvMaBRhdG/zwTMYJ5pP6zxn12cZSEr5g== X-Received: by 2002:aa7:8882:0:b0:70e:a42e:3417 with SMTP id d2e1a72fcca58-71b25f3bef6mr11179255b3a.10.1727544937734; Sat, 28 Sep 2024 10:35:37 -0700 (PDT) Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71b2649c0bdsm3376508b3a.3.2024.09.28.10.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Sep 2024 10:35:37 -0700 (PDT) From: Visuwesh To: Tassilo Horn Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <874j5ziudn.fsf@gnu.org> (Tassilo Horn's message of "Sat, 28 Sep 2024 19:02:44 +0200") References: <8734ljg6f5.fsf@gmail.com> <86msjr6ayu.fsf@gnu.org> <874j5ziudn.fsf@gnu.org> Date: Sat, 28 Sep 2024 23:05:33 +0530 Message-ID: <87y13bel5m.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=9A=E0=AF=86=E0=AE=AA=E0=AF=8D=E0=AE=9F= =E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 28, 2024] Tassilo Horn wrote: > 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. Will do. >> 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. OK, will rewrite. > 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... I was wondering the same thing, especially since the cost of making the imenu index is not that high. =20 >>> -(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). That would make sense. I was wondering if we should create separate defcustom for each program but this is a better approach. [ BTW, is it "DJVU" or "Djvu"? The comments in doc-view.el uses the latter AFAICT. ] > Bye, > Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 13:54:33 2024 Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 17:54:34 +0000 Received: from localhost ([127.0.0.1]:38621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1subeL-0008IS-Ls for submit@debbugs.gnu.org; Sat, 28 Sep 2024 13:54:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1subeJ-0008I2-Ps for 73530@debbugs.gnu.org; Sat, 28 Sep 2024 13:54:32 -0400 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 1subdk-0001Rm-8j; Sat, 28 Sep 2024 13:53:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1L46bRVEbdMvbHE6n/gVcDzla7A7qQB9Yr0B4N4s9Os=; b=PzNmm8HGEJAl x731yXNjv+HCpbi/5cJ1wLw3y7weMrSrLlKfwTr0XOORUNWx1zpkrknj7XQxw/hrakWhqXxPowpDn 0s5BoKfa987DKjbCHdUatnhQWInXYw/V6DMPCe2ECMz5yrtMdwHGMX3KI6IwBiXQhBdyxgyFfWQzy b/3iOcLJXnQeQ6ZNWOvhZ2e4XVk3Kx42A0TupW/bUuQmNk63LwJXUntLlxLKckOMWuSz/usEgWouh sPW1/El/NnsEybj6pG/7XJxkSiiLBXCda6MpqM1iZKGLDae4MLIaeBBZsS7YwHh9uiAUir25bk8hM 1UFJ/6wopXhp7vOEfxSf7g==; Date: Sat, 28 Sep 2024 20:53:53 +0300 Message-Id: <86cykn64we.fsf@gnu.org> From: Eli Zaretskii To: Visuwesh In-Reply-To: <87y13bel5m.fsf@gmail.com> (message from Visuwesh on Sat, 28 Sep 2024 23:05:33 +0530) Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view References: <8734ljg6f5.fsf@gmail.com> <86msjr6ayu.fsf@gnu.org> <874j5ziudn.fsf@gnu.org> <87y13bel5m.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: 73530@debbugs.gnu.org, tsdh@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Visuwesh > Cc: Eli Zaretskii , 73530@debbugs.gnu.org > Date: Sat, 28 Sep 2024 23:05:33 +0530 > > [ BTW, is it "DJVU" or "Djvu"? The comments in doc-view.el uses the > latter AFAICT. ] I think it's actually DjVu. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 14:12:30 2024 Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 18:12:30 +0000 Received: from localhost ([127.0.0.1]:38640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1subvh-00014T-Op for submit@debbugs.gnu.org; Sat, 28 Sep 2024 14:12:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1subvf-00014B-4o for 73530@debbugs.gnu.org; Sat, 28 Sep 2024 14:12:27 -0400 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 1subv3-0003yv-Uq; Sat, 28 Sep 2024 14:11: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=qWkVmTDJ5n/foQnPPvUxizS9Fi0ObkceY0Rj/nMKq3Y=; b=prRJWC3vWPDFx7hVfy0q 1vLPhvDSKEbW1sZgfSCe8jG3OHfrZOvZMUkvHlsFxk641quAvN/q4CFoiGwYdtk9Zv/UsJnq47F6c 2bUb8VSHdqhWkHnyxFu3IEcTpk7rQq8o0ymlzH23HmA7GKQw+nu5+wJimSdsDqeLKOL7zGS3xBu+c 1XYd/AIDpW6U5EBugNqQLpaT07e287iqMcQnTYiBki7beg7U+OlYTpczBG/2Qbs8fNvMnNJuOiMiQ o6oOzHMO1y6KBlWqf5FlLJPa5WicTtYxmwL3G6fR57fX+4PPx/RcgDFIgy89P6Wk8S+6pCQNzt/du n1d4Zo0/buPIiw==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduuddgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgesthdtredttdertden ucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenuc ggtffrrghtthgvrhhnpeeluddvgeefuddvjeekfeetleegtefgveehhfeuffeuffeghefg ueefgfdvffegtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieej feekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilh drfhhmpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthho pehjrghosehgnhhurdhorhhgpdhrtghpthhtohepjeefheeftdesuggvsggsuhhgshdrgh hnuhdrohhrghdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehv ihhsuhifvghshhhmsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Visuwesh Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87y13bel5m.fsf@gmail.com> (Visuwesh's message of "Sat, 28 Sep 2024 23:05:33 +0530") References: <8734ljg6f5.fsf@gmail.com> <86msjr6ayu.fsf@gnu.org> <874j5ziudn.fsf@gnu.org> <87y13bel5m.fsf@gmail.com> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Sat, 28 Sep 2024 20:11:45 +0200 Message-ID: <87setjhcm6.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , 73530@debbugs.gnu.org, "Jose A. Ortega Ruiz" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Visuwesh writes: >>> doc-view-imenu-enabled >> >> 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... > > I was wondering the same thing, especially since the cost of making the > imenu index is not that high. So lets ask Jose (added to Cc). Bye, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 15:04:31 2024 Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 19:04:31 +0000 Received: from localhost ([127.0.0.1]:39756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suck3-0004sy-3b for submit@debbugs.gnu.org; Sat, 28 Sep 2024 15:04:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suck0-0004sM-JF for 73530@debbugs.gnu.org; Sat, 28 Sep 2024 15:04:29 -0400 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 1sucjQ-0000z8-8w; Sat, 28 Sep 2024 15:03:52 -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=b+AHIjQoUszTUzDIrIpsQhZUxXIwO7iQcx2AlzsdC9I=; b=XUs0C62wCyEsNvT6US/d sBFTBQcQSOxEsotX2n63a5evj1MjCLE4Wmubah9+yYr/ihtq8cpCfmXAlTate7GlA+MGj2SYHvW92 VfOgaeiLfdRSv18AVfWWUqA+qz93bxujZNGhvWwd2m4I1k5SAwzncKuBNZiNmTZVj2RTliCqgGC+l PXLi31rt2LFczTMZ9v4D7gT6yG8QJ4IW+YW/dvDEQsIYGdSe+fK2UN+8LSFGXHdK7MH6WQmfTWa36 8hWLbk5wl5w9UMQZrydgnvZutXTY2qzE0U5by40nKU4nz4ApUpvVdOlYx+/Babp52I7d79Z42xMVa BDHd1wFjHzTJ4A==; From: jao To: "Tassilo Horn" Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87setjhcm6.fsf@gnu.org> (Tassilo Horn's message of "Sat, 28 Sep 2024 20:11:45 +0200") 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> User-Agent: Gnus/5.13 (Gnus v5.13) X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: Date: Sat, 28 Sep 2024 20:03:48 +0100 Message-ID: <87zfnrzjl7.fsf@mail.jao.io> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , 73530@debbugs.gnu.org, Visuwesh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On Sat, Sep 28 2024, Tassilo Horn wrote: > Visuwesh writes: > >>>> doc-view-imenu-enabled >>> >>> 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... >> >> I was wondering the same thing, especially since the cost of making the >> imenu index is not that high. > > So lets ask Jose (added to Cc). If I recall correctly, that flag is there to save CPU cycles in case users of doc-view are not interested in imenu. The PDF's outline is scanned using mutool when doc-view-mode is activated if doc-view-imenu-enabled is true, and for big files that can take a second or two. I am not sure why I didn't delay creation of the index, but it's probably because there are menu entries to create and I didn't bother to investigate deeper. Also, because I didn't want to see a pause the first time imenu was invoked on a PDF. Admittedly, most of the time the pause is small enough to make all of the above moot. Cheers, jao -- Many people take no care of their money till they come nearly to the end of it, and others do just the same with their time. -Johann Wolfgang von Goethe (1749-1832) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 15:16:14 2024 Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 19:16:14 +0000 Received: from localhost ([127.0.0.1]:40479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sucvO-00061T-H0 for submit@debbugs.gnu.org; Sat, 28 Sep 2024 15:16:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sucvM-000615-Pe for 73530@debbugs.gnu.org; Sat, 28 Sep 2024 15:16:13 -0400 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 1sucum-0001wq-II; Sat, 28 Sep 2024 15:15:36 -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=TrH7fZXlVb7RnmyMLWDoTjeBuABSFdLWZVJlyD7ciKU=; b=b3CN0ulsK0TZuqn8UQYU C18ntaBkvNc+F0lK5vD6B/Z9VyzITjRuprVgZ/qoaJGb0sjaROIbH3+mdY8ByqeDis2PybdrsVahv oPGFzv4w7fx+rY1cXxOe++I8zL0Rz4d8Guq9TmAe6VOVEXWD/GM9TTZqAyym+WiHv3HoJu7LhaSog YS844ZHanMRakd0Md2OVRk1TfUv9i4m9hwhsC5oxqG4DCg0munAPx+1kNZlZ3nSmntodLoe+An/Pt dUhPrXkX13pn48Q8Yg7iaYInYdoxnXizH7spJ0PjYtrHiN+JEpbFwJsXN0TK4v+x5saZF+ugTlHeN IMiGkg/41AH30A==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduuddgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhgffffkgggtsehttdertddtredt necuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqne cuggftrfgrthhtvghrnhepleduvdegfeduvdejkeefteelgeetgfevhefhueffueffgeeh gfeufefgvdffgedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeei jeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrih hlrdhfmhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepjeefheeftdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvlhhiii esghhnuhdrohhrghdprhgtphhtthhopehvihhsuhifvghshhhmsehgmhgrihhlrdgtohhm pdhrtghpthhtohepjhgrohesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: jao Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87zfnrzjl7.fsf@mail.jao.io> (jao@gnu.org's message of "Sat, 28 Sep 2024 20:03:48 +0100") 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> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Sat, 28 Sep 2024 21:15:31 +0200 Message-ID: <87h69zh9nw.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , 73530@debbugs.gnu.org, Visuwesh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) jao writes: >>>>> doc-view-imenu-enabled > > If I recall correctly, that flag is there to save CPU cycles in case > users of doc-view are not interested in imenu. > > The PDF's outline is scanned using mutool when doc-view-mode is > activated if doc-view-imenu-enabled is true, and for big files that > can take a second or two. > > I am not sure why I didn't delay creation of the index, but it's > probably because there are menu entries to create and I didn't bother > to investigate deeper. Also, because I didn't want to see a pause the > first time imenu was invoked on a PDF. Thanks for explaining! > Admittedly, most of the time the pause is small enough to make all of > the above moot. I think I'd prefer to delay the creation of the index until imenu is invoked the first time and get rid of doc-view-imenu-enabled. If we really wanted to and the requirements are met, we could also run the index creation in an idle-timer. Probably not by default but maybe by adding and documenting a function one could add to doc-view-mode-hook for that purpose. Bye, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 15:50:51 2024 Received: (at 73530) by debbugs.gnu.org; 28 Sep 2024 19:50:51 +0000 Received: from localhost ([127.0.0.1]:42638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sudSt-0000Ld-Aj for submit@debbugs.gnu.org; Sat, 28 Sep 2024 15:50:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sudSr-0000Kz-Gz for 73530@debbugs.gnu.org; Sat, 28 Sep 2024 15:50:50 -0400 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 1sudSH-0006Mn-7X; Sat, 28 Sep 2024 15:50:13 -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=r475GTHdOxpX/ugGnbTSqd2+44TKeUy+ZrQs8DrRXj0=; b=ees+Hc6MVJYrQuVyILcW YC3jE6hQc/ebtP/LecSCgceitVT98dPicXYR7Xc7mGYTW0l+faUYv1d9lpb+9C0rqkA2KvalPC1Gm WvQo9Jy2pkapNiTzWW1PwuPOVZMRXU3jKgF1vjhU2bl4bxqTvBt2i/P9b/XvuzMytQ+j8m9QwhPnY Mz4fiC06KRVS7zMqpmE/PrDmmapCdL2MTJ1mkwrkL0AvLSHaTMjZqASC3aO45aHP0x/SEA7wejLmM ETuGVYxW4fDs5K7T791E2mB7tJmBKq+DDhLVVv74m5fpTCMMvl8kRNHG6ii8Fp9QqpHja9gChVZSL bxTbFxdkLNxzgQ==; From: "Jose A. Ortega Ruiz" To: "Tassilo Horn" Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87h69zh9nw.fsf@gnu.org> (Tassilo Horn's message of "Sat, 28 Sep 2024 21:15:31 +0200") 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> User-Agent: Gnus/5.13 (Gnus v5.13) X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: Date: Sat, 28 Sep 2024 20:50:08 +0100 Message-ID: <87v7yfzhfz.fsf@mail.jao.io> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , 73530@debbugs.gnu.org, Visuwesh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On Sat, Sep 28 2024, Tassilo Horn wrote: [...] > I think I'd prefer to delay the creation of the index until imenu is > invoked the first time and get rid of doc-view-imenu-enabled. If we > really wanted to and the requirements are met, we could also run the > index creation in an idle-timer. Probably not by default but maybe by > adding and documenting a function one could add to doc-view-mode-hook > for that purpose. FWIW, I'd keep doc-view-imenu-enabled, and use it to control the creation of the idle timer. The latter sounds like the right solution to avoid delays, and the former a much simpler strategy than asking users to configure hooks. I also very much like the idea of being able to tell emacs not to call executables in my path and create other processes behind my back. Personally, I find that ability reason enough to keep the flag, delays or not, and, now that i think of it, that was perhaps the main reason I introduced doc-view-imenu-enabled. Unconditionally spawning external processes doesn't feel right to me. Just my 2c, jao -- I took a speed reading course and read War and Peace in twenty minutes. It involves Russia. -Woody Allen From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 10:04:52 2024 Received: (at 73530) by debbugs.gnu.org; 29 Sep 2024 14:04:52 +0000 Received: from localhost ([127.0.0.1]:40351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suuXc-0000Bc-HO for submit@debbugs.gnu.org; Sun, 29 Sep 2024 10:04:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suuXY-0000BF-4z for 73530@debbugs.gnu.org; Sun, 29 Sep 2024 10:04:49 -0400 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 1suuWw-0002dd-KQ; Sun, 29 Sep 2024 10:04:10 -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=dEy/bNuLYB5uFf8QeFXGFj3kIIhQzsnJCZiB1QfioJk=; b=J7h6L7RE66QwMgGWbGOS HKbieCp0ky+d//uhjh1tiqhWVneJ2xHzKhwg1IfpRuWxfrflUWckMMRV5squRFBP/d0XOsoQZQAjm u85e+KUCndwkq3goyu64JOnKjmbhfsdYU501BhVVYVDdT+4qaxK86QOFGinkQ6pHoITX3qyD+1Rms N8AvjFlZEfHnPikCQc0SFFdC2ZJ7vw9XdOJz2tHM5/13POEJfPUg//Sxny0ZC6suj+KPQr23VSozf gGRocKPxJWbbt9POp/+I+E76LI6mjrVJWgkMri+mOqy3Hg/zUgP7RC7jz+Apt5APW0bSZ0OeB5BPz eb4m/mP2SbF57A==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddufedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgesthdtredttdertden ucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenuc ggtffrrghtthgvrhhnpeeluddvgeefuddvjeekfeetleegtefgveehhfeuffeuffeghefg ueefgfdvffegtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieej feekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilh drfhhmpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthho peejfeehfedtseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghlihiise hgnhhurdhorhhgpdhrtghpthhtohepvhhishhufigvshhhmhesghhmrghilhdrtghomhdp rhgtphhtthhopehjrghosehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: "Jose A. Ortega Ruiz" Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87v7yfzhfz.fsf@mail.jao.io> (Jose A. Ortega Ruiz's message of "Sat, 28 Sep 2024 20:50:08 +0100") 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> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Sun, 29 Sep 2024 16:03:54 +0200 Message-ID: <87h69yh7zp.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , 73530@debbugs.gnu.org, Visuwesh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Jose A. Ortega Ruiz" writes: >> I think I'd prefer to delay the creation of the index until imenu is >> invoked the first time and get rid of doc-view-imenu-enabled. If we >> really wanted to and the requirements are met, we could also run the >> index creation in an idle-timer. Probably not by default but maybe by >> adding and documenting a function one could add to doc-view-mode-hook >> for that purpose. > > FWIW, I'd keep doc-view-imenu-enabled, and use it to control the > creation of the idle timer. The latter sounds like the right solution > to avoid delays, and the former a much simpler strategy than asking > users to configure hooks. Also fine with me. Visuwesh, would you like to proceed in that direction? Thanks, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 10:35:57 2024 Received: (at 73530) by debbugs.gnu.org; 29 Sep 2024 14:35:57 +0000 Received: from localhost ([127.0.0.1]:40498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suv1h-00024R-8M for submit@debbugs.gnu.org; Sun, 29 Sep 2024 10:35:57 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:52436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suv1f-00023r-5d for 73530@debbugs.gnu.org; Sun, 29 Sep 2024 10:35:56 -0400 Received: by mail-pl1-f194.google.com with SMTP id d9443c01a7336-2053525bd90so32866215ad.0 for <73530@debbugs.gnu.org>; Sun, 29 Sep 2024 07:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727620458; x=1728225258; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WK4iY3HbmbRTcnl9LcODHpfeCcWYEJbmqTnGMoMTpaE=; b=Z36gzh2adkn49mWeTJoKj+Cz1hl1a5VZ0cWOf2I5q2UcUBILKqLNRJbOLrg3lL6vKp i62bEyTXRN+hEZrGdBZvxnfbSIFE2y05WbECp9rJD7VMk1MgkkY8CCeDNaGVxgWiylR1 w7i7aROZfwPfW/tON1O7rVN7hzTjg2hihQknt1hL+FY0Tu5A2gzMGGl6KOJHsnL9lsOf 5mggkGrNqgA+5kAzVpXvpU2qAE+AvSMcfXTv9yaCDyBrgVjVKR6NE3lcMdwJkYN58GYX qu18TkocV8PiYp62RWjTeLb8kT7KwM6IOX5q0JYMhE7RbOrcvochnOHpfV6amf4ycIzH tgcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727620458; x=1728225258; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WK4iY3HbmbRTcnl9LcODHpfeCcWYEJbmqTnGMoMTpaE=; b=j52WWXsX7fuzsuxZyAQ8ncNsFxvWWGzFv03Nngj1tBCllBzfgZY8DGi9NY0+HkzTUK HKAJeQ2FmBThfAvtoThdlK+G5EAbMfcb9ar/NZeYcjOvjWwMp6PN9WkoL3AJf1ZFLnM1 6xOtpWOFLdr67lVGe/tD2Krv0GRjMIzfNECIArVtwRMfL3SUisTdoiXZHYzhUdOQ9B8y jxIUkFF/aDqbZoqa7R67C/UHH9xMVxhgvkZSqCnR5ZACaJGrbQbIzlhzocIB+kLgp3VU GRyWq6Tk3kS0PnFIM4d6tqc898DHuNYlxBhPVgqqscXJiH/TrklM2sS6KCJkUhV0AAXI leNA== X-Forwarded-Encrypted: i=1; AJvYcCWdZaPInTUas1MoZ0/Wl6zP7IN5efQ95y/N6buFyKWr8hpfCl5mfT92hdl/lB7LN8SlJ+wNRg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy31YqWmBCBLsp+4cl5m1KxLtsgdY1rtdsvsxXSVpCeiNlrGtwa GmKusyHqg6wJw6WbyUPK38N0v15zNIpKANiN2cm3ghFcGUDZ2AkO X-Google-Smtp-Source: AGHT+IGFpVbVKnZmXNsjv6Bb9Hhb4Z2WMpT8PQcRXumzLGJuE2DzA4IhxGsYWW7WZfnnfPhcG76z6w== X-Received: by 2002:a17:902:e844:b0:20b:65a8:917c with SMTP id d9443c01a7336-20b65a923c0mr53085045ad.10.1727620457666; Sun, 29 Sep 2024 07:34:17 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e576e3sm40387565ad.261.2024.09.29.07.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 07:34:17 -0700 (PDT) From: Visuwesh To: Tassilo Horn Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87h69yh7zp.fsf@gnu.org> (Tassilo Horn's message of "Sun, 29 Sep 2024 16:03:54 +0200") 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> Date: Sun, 29 Sep 2024 20:04:13 +0530 Message-ID: <87ttdyedga.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=9A=E0=AF=86= =E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 29= , 2024] Tassilo Horn wrote: > "Jose A. Ortega Ruiz" writes: > >>> I think I'd prefer to delay the creation of the index until imenu is >>> invoked the first time and get rid of doc-view-imenu-enabled. If we >>> really wanted to and the requirements are met, we could also run the >>> index creation in an idle-timer. Probably not by default but maybe by >>> adding and documenting a function one could add to doc-view-mode-hook >>> for that purpose. >> >> FWIW, I'd keep doc-view-imenu-enabled, and use it to control the >> creation of the idle timer. The latter sounds like the right solution >> to avoid delays, and the former a much simpler strategy than asking >> users to configure hooks. > > Also fine with me. Visuwesh, would you like to proceed in that > direction? Is an idle timer necessary? Imenu calls the index function only when it finds that the index hasn't been created yet so we can rely on that mechanism instead. This would be simpler than using an idle timer. WDYT? > Thanks, > Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 12:21:26 2024 Received: (at 73530) by debbugs.gnu.org; 29 Sep 2024 16:21:26 +0000 Received: from localhost ([127.0.0.1]:41004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suwfm-0007UT-4i for submit@debbugs.gnu.org; Sun, 29 Sep 2024 12:21:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suwfj-0007UL-UQ for 73530@debbugs.gnu.org; Sun, 29 Sep 2024 12:21:24 -0400 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 1suwf8-0006lW-Pv; Sun, 29 Sep 2024 12:20:46 -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=L+CDppBWPJVRxk3A/z1BUBJADC2fImxbq52hzz5V6rA=; b=UrF5W0VXuUadSntgG2cC kOo+srGG/zMovwBy2xZqVI4QBxCM42UNQLHMUjLa/ZTnf0podqqbjflL4PzVTZPpneSoiV+NjaxPl zsnK4sthqIY/f/ReVAn5WNpV89xu0b1i1Fr6FXwOqcxAWfXkzqFaT1qTS5M8FEnsJO3I+zyQ9kWEF hVAjuh0YjK9WQVwWa4h95ilC2TjtBV0FD4f3RRyeg0xoxdARKiR1xf/e09Zk9z3+r0cz/GfNgVxBD vWIa1ndrTxKGs6iVuZtj2n22iqFCxOf54zsebKFoyIQKJnXe/OTzezsJT3kqEJuWpzOisLc42LXxL KA0r+2x8xYkvsA==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddufedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhgffffkgggtsehttdertddtredt necuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqne cuggftrfgrthhtvghrnhepleduvdegfeduvdejkeefteelgeetgfevhefhueffueffgeeh gfeufefgvdffgedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeei jeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrih hlrdhfmhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepjeefheeftdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvlhhiii esghhnuhdrohhrghdprhgtphhtthhopehjrghosehgnhhurdhorhhgpdhrtghpthhtohep vhhishhufigvshhhmhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Visuwesh Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87ttdyedga.fsf@gmail.com> (Visuwesh's message of "Sun, 29 Sep 2024 20:04:13 +0530") 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> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Sun, 29 Sep 2024 18:20:42 +0200 Message-ID: <87y13ae8it.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Visuwesh writes: >>> FWIW, I'd keep doc-view-imenu-enabled, and use it to control the >>> creation of the idle timer. The latter sounds like the right >>> solution to avoid delays, and the former a much simpler strategy >>> than asking users to configure hooks. >> >> Also fine with me. Visuwesh, would you like to proceed in that >> direction? > > Is an idle timer necessary? I don't know yet. Jose said the index building could take a little while. > Imenu calls the index function only when it finds that the index > hasn't been created yet so we can rely on that mechanism instead. > This would be simpler than using an idle timer. WDYT? Then let's do it the simple way and then test how long the index building actually takes on reasonable large PDFs/DjVu files. Thanks, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 12:40:44 2024 Received: (at 73530) by debbugs.gnu.org; 29 Sep 2024 16:40:45 +0000 Received: from localhost ([127.0.0.1]:41130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suwyS-00008r-6k for submit@debbugs.gnu.org; Sun, 29 Sep 2024 12:40:44 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:54492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suwyP-0008Rs-AA for 73530@debbugs.gnu.org; Sun, 29 Sep 2024 12:40:42 -0400 Received: by mail-pl1-f194.google.com with SMTP id d9443c01a7336-20b1335e4e4so33271495ad.0 for <73530@debbugs.gnu.org>; Sun, 29 Sep 2024 09:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727627943; x=1728232743; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OXZ/hGcXUbWjQ/vcB7XiSDmSZfO3Rg9usDbuepmR1A8=; b=ATEIipYIrgdHXc/3ZAj0xVugPtwxOXmr498B6YCXANWfSVVjnD86QWh8F+eFjWQFJx gWt01aheEnGsQq9YoJP128aV67Uu1Kx5WezmzPZpFL+1uVJHdXF9Jw6E6O+bGCTWhnIH 3viL3YPYCzi36vAxtW4sBGXU749L9SnBEmYp3qrhHeZzVRZI8G/ymajYSopjR7yNZr0A 1jA5T8L1VCJNTwJjIbYRzOxd091ARHHuUN1rmFbPRoBBHy0rVHIopPGYg6/id8FBUw5H KEsIZOqOrzaE13WN9IsdFLc6MGB9NJanffpBJtSj+BQ6L1pYyS7EIXl6HVB4GbkSSHH4 I2Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727627943; x=1728232743; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OXZ/hGcXUbWjQ/vcB7XiSDmSZfO3Rg9usDbuepmR1A8=; b=cFqgRTLU2eFrhZsB3uQfqImZewX5oa3CkGuEPTSr0quPYkuNKJuekCnuNuAcyN3LBg H1ViwTZhkOHiK6FvQkQuTgZ5VaQjD44Haav1hjaezQpJTXZBHkKb08r4lC4MMX7Ulz6s vBc+75URKGb/SfExztAd6HZWnG4p2FsGs4YrboKBQqb15h5OdaMn3OyjEnV+rpVuWfJa /829BB8OeG/7u1Ma7pSey5g+TpabrvpD51swiogQN1jzh7cNs9TbF+QbiFZVC4M5SkiV c1UW+2+y9KX+ibstvuyjdCiEEkcyPt2S422rp2LYrbVcReNFVBJUJWgw0ijLrV+x3MUx oF1w== X-Forwarded-Encrypted: i=1; AJvYcCU3qxAViojYv+uYww+g2NHXM9RN7LHYT00JWrVsgRYK7ECY+MUnw8/7I6St0epMKax30oFnow==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxKDRVChg6vhP1umS0dajuFUIRiVA6XKz/Hf/THu8bb2gkWldvp F2FhZScoVJprB+gtUIFjTZTP2rXzWLzvpk6FTly/a++L6NUIj7bo X-Google-Smtp-Source: AGHT+IESvId34WO/iXqMxzA+tsw8DW8VjKa5sUImdAQKcoTKFYh2dglJgYaCiYymngYY7ZcikkS7fg== X-Received: by 2002:a17:902:d4c6:b0:205:8456:df0c with SMTP id d9443c01a7336-20b37b6924dmr149360605ad.26.1727627942562; Sun, 29 Sep 2024 09:39:02 -0700 (PDT) Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e101a1sm41060245ad.126.2024.09.29.09.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 09:39:02 -0700 (PDT) From: Visuwesh To: Tassilo Horn Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87y13ae8it.fsf@gnu.org> (Tassilo Horn's message of "Sun, 29 Sep 2024 18:20:42 +0200") 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> Date: Sun, 29 Sep 2024 22:08:59 +0530 Message-ID: <87plome7oc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=9A=E0=AF=86= =E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 29= , 2024] Tassilo Horn wrote: >> Imenu calls the index function only when it finds that the index >> hasn't been created yet so we can rely on that mechanism instead. >> This would be simpler than using an idle timer. WDYT? > > Then let's do it the simple way and then test how long the index > building actually takes on reasonable large PDFs/DjVu files. OK, I will send an updated patch in a few days. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 13:16:36 2024 Received: (at 73530) by debbugs.gnu.org; 29 Sep 2024 17:16:36 +0000 Received: from localhost ([127.0.0.1]:41317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suxX6-0007GC-RS for submit@debbugs.gnu.org; Sun, 29 Sep 2024 13:16:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suxX0-0007G2-D8 for 73530@debbugs.gnu.org; Sun, 29 Sep 2024 13:16:30 -0400 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 1suxWP-0003n9-Cn; Sun, 29 Sep 2024 13:15:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:References:In-Reply-To:To:From:Date: MIME-Version; bh=KlgpJFkIsHLFrnZ04hw83l3SWzgLpynzzId71I6/W9s=; b=Hm6cdqiT35z1 TVksKrABattWlLPiA88I99N/IsHJfdS1Z2L4Jvz73taMtnV7eMIX7TDbD5tPRGq0nGl1fMNOWPnVP GvAsBe4pYf+ac2Kge5/WGLY0vyk+JzUDhmDH98CFRNWBquJAAitrgENpCo3qpjtWyU6ppIIFYOLnZ eupEQrd9CQCZ9bm2tHSUd9thyv2kr3toqwYpZbqoflxYbIeVT7BW9fs6halt/Vc8qdRHhs9IKTWeh 1kbc1TuE3TBYDI7c4TXvX72SFhIx8jsUOOywfm+ULasFXVK3VvCONXQqysU65ZRIUA/gjFy9H7yn2 5Xw+pjyDRXPSjjeNXjbK+g==; X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddufedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvvefkjghfufgtgfesthhqredtredt jeenucfhrhhomhepfdfvrghsshhilhhoucfjohhrnhdfuceothhsughhsehgnhhurdhorh hgqeenucggtffrrghtthgvrhhnpedvtedutefhueduheejfeffkeehgefhlefflefhjeej keegtdehhfefvddtgfdtueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithih qdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsth hmrghilhdrfhhmpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgt phhtthhopeejfeehfedtseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvh hishhufigvshhhmhesghhmrghilhdrtghomhdprhgtphhtthhopegvlhhiiiesghhnuhdr ohhrghdprhgtphhtthhopehjrghosehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Sun, 29 Sep 2024 19:15:25 +0200 From: "Tassilo Horn" To: Visuwesh Message-Id: In-Reply-To: <87plome7oc.fsf@gmail.com> 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> Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Am So, 29. Sep 2024, um 18:38, schrieb Visuwesh: > [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=9A=E0=AF= =86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF= =8D 29, 2024] Tassilo Horn wrote: > >>> Imenu calls the index function only when it finds that the index >>> hasn't been created yet so we can rely on that mechanism instead. >>> This would be simpler than using an idle timer. WDYT? >> >> Then let's do it the simple way and then test how long the index >> building actually takes on reasonable large PDFs/DjVu files. > > OK, I will send an updated patch in a few days. Great, thank you!=20 Tassilo From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 21:36:19 2024 Received: (at control) by debbugs.gnu.org; 30 Sep 2024 01:36:19 +0000 Received: from localhost ([127.0.0.1]:43457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sv5Kl-0007oh-4L for submit@debbugs.gnu.org; Sun, 29 Sep 2024 21:36:19 -0400 Received: from mail-ed1-f50.google.com ([209.85.208.50]:50563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sv5KU-0007l3-9C for control@debbugs.gnu.org; Sun, 29 Sep 2024 21:36:02 -0400 Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5c721803a89so4924234a12.1 for ; Sun, 29 Sep 2024 18:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727660064; x=1728264864; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=F9/3KHy5HcagN6YAiX1f77ofS9Pb23Kit6exrrQOLWQ=; b=TAONbDVjX1Wo3HNdDDZMQUDRrWTdkr8nl23GUZDaTt2to1SV8TY1Bup1HoHJatQj13 yZUNUZW/sd5BGGb7SHNTeNBZt7vyqD50xLcNe6eGLGwQ24FR5MobLfPRIJOAMYRCfb0h nKbX5Mz7SF2rhOnew5cD3vCbSSiecnWCQgHcMs+66m1Mz7MtvewLJiY+fIrA/1lJRAu/ 3n03vFfvqeVKoI5pD5t8A1c5PpeaVYJmkKYJw1tw4H7f8JZ9ykr1DHRLi31qHjr/obRD JIBQnCf+IcrMWiuWktobB+r3X2VcIg47Zmp47Fx4Yy692XBrvWj2FLZ3EdtbrVEX9sIJ BlZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727660064; x=1728264864; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=F9/3KHy5HcagN6YAiX1f77ofS9Pb23Kit6exrrQOLWQ=; b=Mb8VNjiwZv4d9XNwhukqHWFdRi2eYw4EyEoEKfJ+kcFI6615PKzTKonS7BGVhKG7s9 k7sBPDFyfkQ/Kg+HTdMF9UflgqVcqrfExexzODcMolRLB8kFO6ENx9w1yjGrAC+rOg1L uEU7HkCWTlZDZQp0jtzrnZQ/QYKCaqSgAq5OvungSsiR25qVTTEs3q4DznbLd6qSJnAo 1qWhAXT7CMe5GaGjzyEH8jliZGcnBRc0HzIRc2aHwsSRsl7V9ObqGamQFyhxyq4XeOCQ PYKzDgg7n5FsuMmnS6Jwwq6f4q22sxeFgcIsNskOIot1SJaJ93HdStU5y38p42aBqwFX tgCA== X-Gm-Message-State: AOJu0YxymOCj4yOnI+YKrvO2ChQRjMn4edlNztVfjZmwc3yyjR1j3kXr z/vg4aJaMpVWNdBn0BIc9PeDuKy9Y0HxUOjcYvU12HXUPJ9PhhcQiQFzDuOzUMBTCR7W95Z2Zug wBTZk6Zglmw1qE9IbpLiNM/stJwA69Q== X-Google-Smtp-Source: AGHT+IH7ppyic3JN3gMCP7weD4HuYbRpPsfvEhR7qrQ7LbYWB5/MirMAnaH7hGOUvrRuIJlT/MQKMzVECSE9EB3OZpQ= X-Received: by 2002:a50:cb8b:0:b0:5c2:5cf1:70e2 with SMTP id 4fb4d7f45d1cf-5c8824f24b0mr8347675a12.20.1727660064352; Sun, 29 Sep 2024 18:34:24 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 29 Sep 2024 18:34:24 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Sun, 29 Sep 2024 18:34:24 -0700 Message-ID: Subject: control message for bug #73530 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) severity 73530 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 30 13:31:13 2024 Received: (at 73530) by debbugs.gnu.org; 30 Sep 2024 17:31:13 +0000 Received: from localhost ([127.0.0.1]:46012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svKEq-0007zg-Ao for submit@debbugs.gnu.org; Mon, 30 Sep 2024 13:31:13 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:57524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svKEn-0007zW-6v for 73530@debbugs.gnu.org; Mon, 30 Sep 2024 13:31:10 -0400 Received: by mail-pf1-f196.google.com with SMTP id d2e1a72fcca58-718e6299191so2435771b3a.2 for <73530@debbugs.gnu.org>; Mon, 30 Sep 2024 10:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727717370; x=1728322170; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=c1b/PdYIy8QVxUO9EyQEXyukKmKkH/0Q3rPafjy2tS0=; b=XX/ymjz9IJ1NYQz0Hhi9hO+AmDYFpa2KE5AG2sc+M0pp23/crLW43iUpW7zOVqWALq 7sWNvX71Pg/kC1EkUQPOaDXZGg7ZWiwBLwMJZpmZtSETIU1uQowyQ5NkxpYvL27zX0qS vyWGtdUArr3aFPIhlrbGbJbnCYw4+/zkM8X7wLVd6EQGVo51Of4nzWlbijjifGXZ5sMo 6nePj6SkIWzJxhh4fW0WuBSmUCExfWI4xcCWoA6DbSTGeWoVFe2c98bz0ZslPwPwDjyT 7a0zjz3YGYRhGiiiJqQc9nfyUNgoPAf8aCLSQynOqE2s/HocEfoqW0OezcRJMUs02OM0 xVGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727717370; x=1728322170; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=c1b/PdYIy8QVxUO9EyQEXyukKmKkH/0Q3rPafjy2tS0=; b=Olj3WJELtF1XZRxKcQ96AfZ0J+rpQnD+lscVU9SOameRPV7k+fEmm3ERY+p62PCNFU Ov3aJXHXPWkVWUndGqOgnrJgfWHfOXNoosaHqIePl5O/UPajoMxuc4MfEz3Jl6lm7ou5 gRQQ8n3iouooO2BSMPYnf+15AWf0xEH9L51lW8Lk/6MmUFVR3C5fgb/cF6Cbta+tEh6g PHrOSfGT2xUdejXR52+MerYgNNVZccCqjZW2TqIGrhYRV8joXrJwSNCH+CsTfX1D3a74 kzAGt44VHvyr+/oZEatKDKVtmZAkHcbeW3vE6PSvRcOxdrnbEApEc6LlPlVLJFGLPvPo dsfA== X-Forwarded-Encrypted: i=1; AJvYcCWPk5V3D0n2wcWctpr9uYlMLfVhXMISqGzxf1leQ7W3kAjttY3H+qLQ39kLV6/vlwlwenVGrg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwYKz698A0q0tgXXabKkcamFYoC2RcVbZ4wmSb+7icOtcKeyiJJ eoJAyUYP9pPIrtkerLewuu2apTIt2JnLe0B4wD+XIJCfKxHy2w8b X-Google-Smtp-Source: AGHT+IENLx+bxecGlBgqTcOT2m3Qx8YxRKLVKpCcCdinWm0TzxDJNpEeHAk2CTvs59wi80UOE26F+w== X-Received: by 2002:a05:6a00:4f84:b0:714:1bcf:3d93 with SMTP id d2e1a72fcca58-71b25f28701mr18201888b3a.5.1727717370008; Mon, 30 Sep 2024 10:29:30 -0700 (PDT) Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db2c8007sm6805709a12.51.2024.09.30.10.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Sep 2024 10:29:29 -0700 (PDT) From: Visuwesh To: "Tassilo Horn" Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: (Tassilo Horn's message of "Sun, 29 Sep 2024 19:15:25 +0200") 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> Date: Mon, 30 Sep 2024 22:59:25 +0530 Message-ID: <87ikuddp8q.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=9A=E0=AF=86= =E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 29= , 2024] Tassilo Horn wrote: > Am So, 29. Sep 2024, um 18:38, schrieb Visuwesh: >> [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=9A=E0=AF= =86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D= 29, 2024] Tassilo Horn wrote: >> >>>> Imenu calls the index function only when it finds that the index >>>> hasn't been created yet so we can rely on that mechanism instead. >>>> This would be simpler than using an idle timer. WDYT? >>> >>> Then let's do it the simple way and then test how long the index >>> building actually takes on reasonable large PDFs/DjVu files. >> >> OK, I will send an updated patch in a few days. > > Great, thank you!=20 Please review the attached. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-imenu-index-function-for-Djvu-files-in-doc-view.patch >From 8ccfe9440363569d6624153177d724bbcf2a122f Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Sat, 28 Sep 2024 20:37:50 +0530 Subject: [PATCH] Add imenu index function for Djvu files in doc-view * lisp/doc-view.el (doc-view-imenu-enabled): Tweak the default value to check for 'djvused', and make it obsolete. (doc-view--djvu-outline, doc-view--parse-djvu-outline): Add new functions to return imenu index for a Djvu file. (doc-view--outline): Add new function to create the imenu index depending on the file type. (doc-view--outline): Document new possible variable value. (doc-view-imenu-index): Use the above function instead. (doc-view-imenu-setup): Try to create the imenu index unconditionally. * doc/emacs/misc.texi (DocView Navigation): Mention index creation using 'djvused' too. * etc/NEWS: Announce the change. (Bug#73530) --- doc/emacs/misc.texi | 15 +++---- etc/NEWS | 7 ++++ lisp/doc-view.el | 99 ++++++++++++++++++++++++++++++++++++++------- 3 files changed, 98 insertions(+), 23 deletions(-) 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 +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}. @findex doc-view-page-to-register @findex doc-view-jump-to-register diff --git a/etc/NEWS b/etc/NEWS index 607665a71bb..b6035e13639 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -268,6 +268,13 @@ Docview can store current page to buffer local registers with the new command 'doc-view-page-to-register' (bound to 'm'), and later can be restored with 'doc-view-jump-to-register' (bound to '''). ++++ +*** Docview can generate imenu index for Djvu files. +When the 'djvused' program is available, Docview can now generate imenu +index for Djvu files from its outline. +The name of the 'djvused' program can be customized by changing the user +option 'doc-view-djvused-program'. + ** Tramp +++ diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 395993e6263..1c8bcaee2f1 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -29,6 +29,8 @@ ;; and OXPS documents require `mutool' which comes with mupdf ;; (https://mupdf.com/index.html). Djvu documents require `ddjvu' ;; (from DjVuLibre). ODF files require `soffice' (from LibreOffice). +;; `djvused' (from DjVuLibre) can be optionally used to generate imenu +;; outline for Djvu files when available. ;;; Commentary: @@ -216,10 +218,23 @@ doc-view-mupdf-use-svg :type 'boolean :version "30.1") -(defcustom doc-view-imenu-enabled (and (executable-find "mutool") t) - "Whether to generate an imenu outline when \"mutool\" is available." +(defcustom doc-view-djvused-program (and (executable-find "djvused") + "djvused") + "Name of \"djvused\" program to generate imenu outline for Djvu files. +This is part of DjVuLibre." + :type 'file + :version "31.1") + +(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") (defcustom doc-view-imenu-title-format "%t (%p)" "Format spec for imenu's display of section titles from docview documents. @@ -1953,7 +1968,9 @@ doc-view--outline-rx "[^\t]+\\(\t+\\)\"\\(.+\\)\"\t#\\(?:page=\\)?\\([0-9]+\\)") (defvar-local doc-view--outline nil - "Cached PDF outline, so that it is only computed once per document.") + "Cached PDF outline, so that it is only computed once per document. +It can be the symbol `unavailable' to indicate that outline is +unavailable for the document.") (defun doc-view--pdf-outline (&optional file-name) "Return a list describing the outline of FILE-NAME. @@ -1968,6 +1985,7 @@ doc-view--pdf-outline (fn (expand-file-name fn))) (with-temp-buffer (unless (eql 0 (call-process "mutool" nil (current-buffer) nil "show" fn "outline")) + (setq doc-view--outline 'unavailable) (imenu-unavailable-error "Unable to create imenu index using `mutool'")) (goto-char (point-min)) (while (re-search-forward doc-view--outline-rx nil t) @@ -1978,6 +1996,42 @@ doc-view--pdf-outline outline))) (nreverse outline))))) +(defun doc-view--djvu-outline (&optional file-name) + "Return a list describing the outline of FILE-NAME. +If FILE-NAME is nil or omitted, it defaults to the current buffer's file +name. + +For the format, see `doc-view--pdf-outline'." + (unless file-name (setq file-name (buffer-file-name))) + (with-temp-buffer + (call-process doc-view-djvused-program nil (current-buffer) nil + "-e" "print-outline" file-name) + (goto-char (point-min)) + (when (eobp) + (setq doc-view--outline 'unavailable) + (imenu-unavailable-error "Unable to create imenu index using `djvused'")) + (nreverse (doc-view--parse-djvu-outline (read (current-buffer)))))) + +(defun doc-view--parse-djvu-outline (bookmark &optional level) + "Return a list describing the djvu outline from BOOKMARK. +Optional argument LEVEL is the current heading level, which defaults to 1." + (unless level (setq level 1)) + (let ((res)) + (unless (eq (car bookmark) 'bookmarks) + (user-error "Unknown outline type: %S" (car bookmark))) + (pcase-dolist (`(,title ,page . ,rest) (cdr bookmark)) + (push `((level . ,level) + (title . ,title) + (page . ,(string-to-number (string-remove-prefix "#" page)))) + res) + (when (and rest (listp (car rest))) + (setq res (append + (doc-view--parse-djvu-outline + (cons 'bookmarks rest) + (+ level 1)) + res)))) + res)) + (defun doc-view--imenu-subtree (outline act) "Construct a tree of imenu items for the given outline list and action. @@ -2010,19 +2064,36 @@ doc-view-imenu-index For extensibility, callers can specify a FILE-NAME to indicate the buffer other than the current buffer, and a jumping function GOTO-PAGE-FN other than `doc-view-goto-page'." - (let* ((goto (or goto-page-fn 'doc-view-goto-page)) - (act (lambda (_name _pos page) (funcall goto page))) - (outline (or doc-view--outline (doc-view--pdf-outline file-name)))) - (car (doc-view--imenu-subtree outline act)))) + (unless doc-view--outline + (setq doc-view--outline (doc-view--outline file-name))) + (unless (eq doc-view--outline 'unavailable) + (let* ((goto (or goto-page-fn #'doc-view-goto-page)) + (act (lambda (_name _pos page) (funcall goto page))) + (outline doc-view--outline)) + (car (doc-view--imenu-subtree outline act))))) + +(defun doc-view--outline (&optional file-name) + "Return the outline for the file FILE-NAME. +If FILE-NAME is nil, use the current file instead." + (unless file-name (setq file-name (buffer-file-name))) + (let ((outline + (pcase doc-view-doc-type + ('djvu + (when doc-view-djvused-program + (doc-view--djvu-outline file-name))) + (_ + (doc-view--pdf-outline file-name))))) + (when outline (imenu-add-to-menubar "Outline")) + ;; When the outline could not be made due to unavailability of the + ;; required program, or its absency from the document, return + ;; 'unavailable'. + (or outline 'unavailable))) (defun doc-view-imenu-setup () "Set up local state in the current buffer for imenu, if needed." - (when doc-view-imenu-enabled - (setq-local imenu-create-index-function #'doc-view-imenu-index - imenu-submenus-on-top nil - imenu-sort-function nil - doc-view--outline (doc-view--pdf-outline)) - (when doc-view--outline (imenu-add-to-menubar "Outline")))) + (setq-local imenu-create-index-function #'doc-view-imenu-index + imenu-submenus-on-top nil + imenu-sort-function nil)) ;;;; User interface commands and the mode -- 2.45.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 02 02:43:03 2024 Received: (at 73530) by debbugs.gnu.org; 2 Oct 2024 06:43:03 +0000 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 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 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 vhhishhufigvshhhmhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Visuwesh Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87ikuddp8q.fsf@gmail.com> (Visuwesh's message of "Mon, 30 Sep 2024 22:59:25 +0530") 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> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Wed, 02 Oct 2024 08:42:49 +0200 Message-ID: <875xqb2efq.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 02 04:21:10 2024 Received: (at 73530) by debbugs.gnu.org; 2 Oct 2024 08:21:10 +0000 Received: from localhost ([127.0.0.1]:56525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svubd-0000Gt-LC for submit@debbugs.gnu.org; Wed, 02 Oct 2024 04:21:10 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svubb-0000GD-AU for 73530@debbugs.gnu.org; Wed, 02 Oct 2024 04:21:08 -0400 Received: by mail-pl1-f195.google.com with SMTP id d9443c01a7336-20b01da232aso4498945ad.1 for <73530@debbugs.gnu.org>; Wed, 02 Oct 2024 01:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727857201; x=1728462001; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=eDCL1ou1JTN9zVEWiK+8N7GmA+VUVi+2pFQV/sL/S1Y=; b=cUhkj+G6fwjXMk7qJk8dVb6paRkCRQ0OxonV/2GyqVEodc9yJhxBnpaAn9GKN/QF94 uerYeYqlbC0mRp9LJJAjRUKaMsbUZ+wz+HrUR+2XjGBOTVWX2ZG3BgcQSPWvUAcWA3YA yYZDnioCjKLz7/U69UVLtnUeno2OHqv1odOn6eTxcYML8HXcGHyzGBPzv/DpcKwSNWQb O0Vm122AMhFLd7tarMWbiB1ywSYHEmgVoofG+lxJots/9s+goKeHTXZEF8LG4pr8Gh7a Y8J94k7Ui48Fh8wrknhWoWt/vFivyeWtB+8uOKipWv1gZDLUpi+bDMADPaxmQAAcFz5/ FjcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727857201; x=1728462001; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eDCL1ou1JTN9zVEWiK+8N7GmA+VUVi+2pFQV/sL/S1Y=; b=Z0MnsLwKgc1JF00CPRkHFnwUcL7AJ4Cr6veajmvyfnwX1Tcp7ONgj6LWUkIZsY8E7Q 8sE0DndVq+18tLMjEQ8TOrKTNMqKT/Q799+gVYaQUe7PsCxGyF6LKapHhOZWZy2uJ3qW Uq9KVG2QShpaDyBUUhNDZAjlpVRZ+lpdW1NTM7aE4y+BS4aYkW+tEw6pFRuJRB934t/+ wgkqmcZDC4/TD1ct8L/pcGY7KdgrRxVXWQ4vjy3TPUTktBaFTWMh2yF4jd8y65lsI7h6 15cLnarAUz8c61NDAatO11r7HUvG6oRl/QSe9fM9rWMPTT+9bVTA4VUqB+wKN4a6MXB7 C0qA== X-Forwarded-Encrypted: i=1; AJvYcCVje2gvSNzxyhkJy4jGMpspyT9Em5peWZBCV9rvGW7gJzF4a89AOnSqDnUfTLU1UCY9q6SLBg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzTQp/tNxy9VwXIl6rGlW+KEV+7zOOIefswE4ElgZ/MLi6m2mK0 q7En94joLabn08GLvvZKgb1OAKQPllve3itGUh0ZU8rhc8n1VoaG X-Google-Smtp-Source: AGHT+IF0NP4fA0SitpMDYDqxdHYzrZpkyHKakZeKnsgC7dr84ROtbQrrzQb7dOJe8IJQfNIjEhHPVQ== X-Received: by 2002:a17:903:2409:b0:1fd:9648:2d66 with SMTP id d9443c01a7336-20bc5b97ba9mr36976155ad.17.1727857201097; Wed, 02 Oct 2024 01:20:01 -0700 (PDT) Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e4dbc0sm80424305ad.243.2024.10.02.01.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 01:20:00 -0700 (PDT) From: Visuwesh To: Tassilo Horn Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <875xqb2efq.fsf@gnu.org> (Tassilo Horn's message of "Wed, 02 Oct 2024 08:42:49 +0200") 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> Date: Wed, 02 Oct 2024 13:49:55 +0530 Message-ID: <87y136dihg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=85=E0=AE=95=E0=AF=8D= =E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 02, 2024] Tassilo Horn wrote: > Visuwesh writes: > > Hi Visuwesh, > > [Sorry if this message appears twice but it seems to have bounced > yesterday.] [ I did not get the previous mail FYI. ] >> 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. Oops, I suppose I can no longer be lazy about pulling from remote anymore. > 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=3Dsection.1 | "Annotations" #nameddest=3Dsection.2 | "Links" #nameddest=3Dsection.3 | "Attachments" #nameddest=3Dsection.4 + "Outline" #nameddest=3Dsection.5 + "subsection" #nameddest=3Dsubsection.5.1 | "subsubsection" #nameddest=3Dsubsubsection.5.1.1 Compare it with: % mutool show atkins_physical_chemistry.pdf outline | "Cover" #page=3D1&view=3DFit | "PREFACE" #page=3D7&view=3DFit | "USING THE BOOK" #page=3D8&view=3DFit | "ABOUT THE AUTHORS" #page=3D12&view=3DFit | "ACKNOWLEDGEMENTS" #page=3D13&view=3DFit | "BRIEF CONTENTS" #page=3D15&view=3DFit | "FULL CONTENTS" #page=3D17&view=3DFit | "CONVENTIONS" #page=3D27&view=3DFit | "LIST OF TABLES" #page=3D28&view=3DFit ... > 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. > 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}. >>=20=20 >> -@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. Fixed. >> +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. Done. On this note, should we use doc-view-pdfdraw-program in place of mutool in doc-view--pdf-outline? >> +(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. Ahh, I misunderstood the suggestion. > 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: % time mutool show atkins_physical_chemistry.pdf outline >/dev/null 0m00.32s real 0m00.30s user 0m00.02s system % time mutool show atkins_physical_chemistry.pdf outline >/dev/null 0m00.30s real 0m00.26s user 0m00.03s system % mutool show atkins_physical_chemistry.pdf outline |wc -l 925 % du -h atkins_physical_chemistry.pdf=20 97M atkins_physical_chemistry.pdf (benchmark-run 10 (doc-view--pdf-outline "~/doc/uni/refb/atkins_physical_chemistry.pdf"= )) ;; =3D> (3.0118861719999996 0 0.0) (benchmark-run 1 (doc-view--pdf-outline "~/doc/uni/refb/atkins_physical_chemistry.pdf"= )) ;; =3D> (0.306343039 0 0.0) which honestly isn't that long a time to wait for the first time you say M-g i. Now for the DjVu file that I was testing on: % time djvused -e print-outline Solid_State_Physics_Ashcroft.djvu >/dev= /null 0m00.24s real 0m00.23s user 0m00.01s system % djvused -e print-outline Solid_State_Physics_Ashcroft.djvu |wc -l 115 % du -sh Solid_State_Physics_Ashcroft.djvu=20 83M Solid_State_Physics_Ashcroft.djvu (benchmark-run 10 (doc-view--djvu-outline "~/tmp/Solid_State_Physics_Ashcroft.djvu")) ;; =3D> (2.2234427809999997 0 0.0) (benchmark-run 1 (doc-view--djvu-outline "~/tmp/Solid_State_Physics_Ashcroft.djvu")) ;; =3D> (0.239040117 0 0.0) IIRC, there's a djvu file somewhere stashed in my home directory that had an index. I can benchmark making the index for that file too if you want. For my init.el which has a (length imenu--index-alist) =3D 852, (benchmark-run 10 (setq imenu--index-alist nil) (imenu--make-index-alist)) ;; =3D> (7.113529254 0 0.0) with REPETITIONS=3D1, I get (0.854962398 0 0.0). In conclusion, the waiting time is barely an inconvenience. > Anyhow, please write a complete sentence in the deprecation, so a dot at > the end. And remove the comma. Done. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-imenu-index-function-for-DjVu-files-in-doc-view.patch >From 54c6050fa054dfb23b9f73c46661bfb8c69cc931 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Wed, 2 Oct 2024 13:48:25 +0530 Subject: [PATCH] Add imenu index function for DjVu files in doc-view * lisp/doc-view.el (doc-view-imenu-enabled): Tweak the default value to check for 'djvused', and make it obsolete. (doc-view--djvu-outline, doc-view--parse-djvu-outline): Add new functions to return imenu index for a Djvu file. (doc-view--outline): Add new function to create the imenu index depending on the file type. (doc-view--outline): Document new possible variable value. (doc-view-imenu-index): Use the above function instead. (doc-view-imenu-setup): Try to create the imenu index unconditionally. * doc/emacs/misc.texi (DocView Navigation): Mention index creation using 'djvused' too. * etc/NEWS: Announce the change. (Bug#73530) --- doc/emacs/misc.texi | 18 ++++---- etc/NEWS | 7 +++ lisp/doc-view.el | 101 +++++++++++++++++++++++++++++++++++++------- 3 files changed, 102 insertions(+), 24 deletions(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index b074eb034b2..7b11a829b0b 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -581,17 +581,17 @@ 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}. +@vindex doc-view-djvused-program + DocView can generate an outline menu for PDF and DjVu documents using +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}. The filename of the +@command{djvused} program can be customized by changing the +@code{doc-view-djvused-program} user option. @cindex registers, in DocView mode @findex doc-view-page-to-register diff --git a/etc/NEWS b/etc/NEWS index abe316547aa..bbcef80b762 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -351,6 +351,13 @@ Docview can store current page to buffer-local registers with the new command 'doc-view-page-to-register' (bound to 'm'), and later the stored page can be restored with 'doc-view-jump-to-register' (bound to '''). ++++ +*** Docview can generate imenu index for DjVu files. +When the 'djvused' program is available, Docview can now generate imenu +index for DjVu files from its outline. +The name of the 'djvused' program can be customized by changing the user +option 'doc-view-djvused-program'. + ** Tramp +++ diff --git a/lisp/doc-view.el b/lisp/doc-view.el index e79295a8b01..6aa90926465 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -27,8 +27,10 @@ ;; `pdftotext', which comes with xpdf (https://www.foolabs.com/xpdf/) ;; or poppler (https://poppler.freedesktop.org/). EPUB, CBZ, FB2, XPS ;; and OXPS documents require `mutool' which comes with mupdf -;; (https://mupdf.com/index.html). Djvu documents require `ddjvu' +;; (https://mupdf.com/index.html). DjVu documents require `ddjvu' ;; (from DjVuLibre). ODF files require `soffice' (from LibreOffice). +;; `djvused' (from DjVuLibre) can be optionally used to generate imenu +;; outline for DjVu documents when available. ;;; Commentary: @@ -216,10 +218,23 @@ doc-view-mupdf-use-svg :type 'boolean :version "30.1") -(defcustom doc-view-imenu-enabled (and (executable-find "mutool") t) - "Whether to generate an imenu outline when \"mutool\" is available." +(defcustom doc-view-djvused-program (and (executable-find "djvused") + "djvused") + "Name of \"djvused\" program to generate imenu outline for DjVu files. +This is part of DjVuLibre." + :type 'file + :version "31.1") + +(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") (defcustom doc-view-imenu-title-format "%t (%p)" "Format spec for imenu's display of section titles from docview documents. @@ -1958,7 +1973,9 @@ doc-view--outline-rx "[^\t]+\\(\t+\\)\"\\(.+\\)\"\t#\\(?:page=\\)?\\([0-9]+\\)") (defvar-local doc-view--outline nil - "Cached PDF outline, so that it is only computed once per document.") + "Cached PDF outline, so that it is only computed once per document. +It can be the symbol `unavailable' to indicate that outline is +unavailable for the document.") (defun doc-view--pdf-outline (&optional file-name) "Return a list describing the outline of FILE-NAME. @@ -1973,6 +1990,7 @@ doc-view--pdf-outline (fn (expand-file-name fn))) (with-temp-buffer (unless (eql 0 (call-process "mutool" nil (current-buffer) nil "show" fn "outline")) + (setq doc-view--outline 'unavailable) (imenu-unavailable-error "Unable to create imenu index using `mutool'")) (goto-char (point-min)) (while (re-search-forward doc-view--outline-rx nil t) @@ -1983,6 +2001,42 @@ doc-view--pdf-outline outline))) (nreverse outline))))) +(defun doc-view--djvu-outline (&optional file-name) + "Return a list describing the outline of FILE-NAME. +If FILE-NAME is nil or omitted, it defaults to the current buffer's file +name. + +For the format, see `doc-view--pdf-outline'." + (unless file-name (setq file-name (buffer-file-name))) + (with-temp-buffer + (call-process doc-view-djvused-program nil (current-buffer) nil + "-e" "print-outline" file-name) + (goto-char (point-min)) + (when (eobp) + (setq doc-view--outline 'unavailable) + (imenu-unavailable-error "Unable to create imenu index using `djvused'")) + (nreverse (doc-view--parse-djvu-outline (read (current-buffer)))))) + +(defun doc-view--parse-djvu-outline (bookmark &optional level) + "Return a list describing the djvu outline from BOOKMARK. +Optional argument LEVEL is the current heading level, which defaults to 1." + (unless level (setq level 1)) + (let ((res)) + (unless (eq (car bookmark) 'bookmarks) + (user-error "Unknown outline type: %S" (car bookmark))) + (pcase-dolist (`(,title ,page . ,rest) (cdr bookmark)) + (push `((level . ,level) + (title . ,title) + (page . ,(string-to-number (string-remove-prefix "#" page)))) + res) + (when (and rest (listp (car rest))) + (setq res (append + (doc-view--parse-djvu-outline + (cons 'bookmarks rest) + (+ level 1)) + res)))) + res)) + (defun doc-view--imenu-subtree (outline act) "Construct a tree of imenu items for the given outline list and action. @@ -2015,19 +2069,36 @@ doc-view-imenu-index For extensibility, callers can specify a FILE-NAME to indicate the buffer other than the current buffer, and a jumping function GOTO-PAGE-FN other than `doc-view-goto-page'." - (let* ((goto (or goto-page-fn 'doc-view-goto-page)) - (act (lambda (_name _pos page) (funcall goto page))) - (outline (or doc-view--outline (doc-view--pdf-outline file-name)))) - (car (doc-view--imenu-subtree outline act)))) + (unless doc-view--outline + (setq doc-view--outline (doc-view--outline file-name))) + (unless (eq doc-view--outline 'unavailable) + (let* ((goto (or goto-page-fn #'doc-view-goto-page)) + (act (lambda (_name _pos page) (funcall goto page))) + (outline doc-view--outline)) + (car (doc-view--imenu-subtree outline act))))) + +(defun doc-view--outline (&optional file-name) + "Return the outline for the file FILE-NAME. +If FILE-NAME is nil, use the current file instead." + (unless file-name (setq file-name (buffer-file-name))) + (let ((outline + (pcase doc-view-doc-type + ('djvu + (when doc-view-djvused-program + (doc-view--djvu-outline file-name))) + (_ + (doc-view--pdf-outline file-name))))) + (when outline (imenu-add-to-menubar "Outline")) + ;; When the outline could not be made due to unavailability of the + ;; required program, or its absency from the document, return + ;; 'unavailable'. + (or outline 'unavailable))) (defun doc-view-imenu-setup () "Set up local state in the current buffer for imenu, if needed." - (when doc-view-imenu-enabled - (setq-local imenu-create-index-function #'doc-view-imenu-index - imenu-submenus-on-top nil - imenu-sort-function nil - doc-view--outline (doc-view--pdf-outline)) - (when doc-view--outline (imenu-add-to-menubar "Outline")))) + (setq-local imenu-create-index-function #'doc-view-imenu-index + imenu-submenus-on-top nil + imenu-sort-function nil)) ;;;; User interface commands and the mode -- 2.45.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 02 10:55:55 2024 Received: (at 73530) by debbugs.gnu.org; 2 Oct 2024 14:55:55 +0000 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 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 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 ihhsuhifvghshhhmsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Visuwesh Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87y136dihg.fsf@gmail.com> (Visuwesh's message of "Wed, 02 Oct 2024 13:49:55 +0530") 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> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Wed, 02 Oct 2024 16:53:33 +0200 Message-ID: <87ttdu1rpu.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 04:38:32 2024 Received: (at 73530) by debbugs.gnu.org; 3 Oct 2024 08:38:32 +0000 Received: from localhost ([127.0.0.1]:59975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swHLs-0005WH-0O for submit@debbugs.gnu.org; Thu, 03 Oct 2024 04:38:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swHLe-0005Vt-UZ for 73530@debbugs.gnu.org; Thu, 03 Oct 2024 04:38:21 -0400 Received: from fencepost.gnu.org ([209.51.188.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swHL2-0007V4-V2; Thu, 03 Oct 2024 04:37:33 -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=ripFrdXnGZoBrH4E11cXg6JEH1uFA/iFCjrWk7uO2iM=; b=HAK0CI6ZnaESxF4h84YC 6CtZxMQaYDnKuYE3NceBtPmtCO95g4eh554XjFA5W+u2Mfl4axgShqAZhrwDR3F0bjcOuSZisSJYH UovaWkgurklhNlHa9mEFb8FQb8FIrbtdM6Kk2io7uNadYWRErx9hzqS8LIE/6VAN1iZH8lXU8WrPB BhWsMUkDIZf+ZnnvVtktcu+c3+KCRyu3MGPJxg2nSjC7AZIjG9OJ8Bg+dwd5m48v+qFvUSlRtsk49 lvWxsx0yMp7FaVTOZQMJxb2mAvTrunEd4AlCJHq+DmRpAn7ZCMDaO3cHg+MERF9gbmNA2in++vPB0 PIxiHPAbEvrgZw==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvtddgudeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhgffffkgggtsehttdertddtredt necuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqne cuggftrfgrthhtvghrnhepleduvdegfeduvdejkeefteelgeetgfevhefhueffueffgeeh gfeufefgvdffgedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeei jeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrih hlrdhfmhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepjeefheeftdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvlhhiii esghhnuhdrohhrghdprhgtphhtthhopehjrghosehgnhhurdhorhhgpdhrtghpthhtohep vhhishhufigvshhhmhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Visuwesh Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87ttdu1rpu.fsf@gnu.org> (Tassilo Horn's message of "Wed, 02 Oct 2024 16:53:33 +0200") 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> <87ttdu1rpu.fsf@gnu.org> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Thu, 03 Oct 2024 10:03:08 +0200 Message-ID: <87bk01obpf.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Tassilo Horn 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? 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. >>> 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 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. >>> 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. Thanks, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 07:11:45 2024 Received: (at 73530) by debbugs.gnu.org; 3 Oct 2024 11:11:45 +0000 Received: from localhost ([127.0.0.1]:60131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swJkG-00050i-GT for submit@debbugs.gnu.org; Thu, 03 Oct 2024 07:11:44 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:52376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swJkE-00050P-6I for 73530@debbugs.gnu.org; Thu, 03 Oct 2024 07:11:43 -0400 Received: by mail-pg1-f196.google.com with SMTP id 41be03b00d2f7-7e6ed072cdaso482180a12.0 for <73530@debbugs.gnu.org>; Thu, 03 Oct 2024 04:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727953834; x=1728558634; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PC/iy0kzw3ST43G8Rz18k00It+kivk6m+b4qbJZUH1I=; b=fIiU5ZK1So1w55IgDZFKo333savq1nl53jSMFQt+HWB7GChPKvymxigcAlYnAO8i4Y XjTw5i/oiwmPJApFv3B0XWzXer0aij18ywx061U5jF3Od5U9HJ3S+EumLhP3NF5vzk/+ fffitVQVqzaKCBm71XKFp/ThXTx/cZNpGq6H9+jIMWDH/V+uhw9BlkkQIN8GHFYNAPDn gDn/LYbc5IrFHtMEH0IaYBwUv8tUEzDJGZV2l5MTZeg7peieXwBMPdY1WuvhWiFTYqEu gJWW+LYOhixtKiEWVku2GfYbENbNBwtMl7riiCPLobqUjCODSqxvdQ+ye3vdXY2WGPpF Ma3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727953834; x=1728558634; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PC/iy0kzw3ST43G8Rz18k00It+kivk6m+b4qbJZUH1I=; b=fKjaBSuseuJnkRS7V7c37gti01tM6tzbfXzdZi70eSOeAm54bHdF/BIK1p+frcQQhA YIJVFCneAgBMZ/2ZlGe1WxC55Vlu4cEMp3AlhHVBK8jrrfPx3t+Nq5Gav6mqi4lICJba qijdpHIFck1x6yz7Wg5XqKzlTMWJCM3ztwFWL8++f/Ggri2k18wVbPPwYV+0SVfFePql XJTPYIXuPdwdsLVZRgQIEfHU6qkqinc+zKWHRDWxMT6a2rAfQbgYnb+QK/sI/tbc1jqK epmce0P/m7v3G+EDn2+X06EbF44gehgSB89N9qDE9ErUSgXIyt/wKW2T78c2y89I+32B I0mA== X-Forwarded-Encrypted: i=1; AJvYcCWiOkWlf/Msai+MMz1XOwu8JQiQU+o7RJ+7lbHPjUylpk6B7afWCYDlRTq9c221m5Wa/AyYUA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxcx7KYtKf4/DKgIQfjswGfkyHYTDhgNFZq1AxqPdSR3fgSK2dd AFqedppTz0csaf1VsMPeavrXYx7L6Lflk6IyfMLmfxjGrX4ce3dBaYf3vO5H X-Google-Smtp-Source: AGHT+IGg19AaDsVaGiCsJpWKfug7w4Qe4fGoPPy4L6X/zpMPlqlMwCj49XeexmePfJKxnSUkLwdRkA== X-Received: by 2002:a05:6a20:d489:b0:1cf:2ef7:b396 with SMTP id adf61e73a8af0-1d5db1614e0mr8886069637.6.1727953834284; Thu, 03 Oct 2024 04:10:34 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71dd9d6fed5sm1110552b3a.11.2024.10.03.04.10.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 04:10:33 -0700 (PDT) From: Visuwesh To: Tassilo Horn Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87bk01obpf.fsf@gnu.org> (Tassilo Horn's message of "Thu, 03 Oct 2024 10:03:08 +0200") 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> <87ttdu1rpu.fsf@gnu.org> <87bk01obpf.fsf@gnu.org> Date: Thu, 03 Oct 2024 16:40:29 +0530 Message-ID: <87plohcuhm.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=85= =E0=AE=95=E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2024] T= assilo Horn wrote: > Tassilo Horn 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=3Dsection.1 >>> | "Annotations" #nameddest=3Dsection.2 >>> >>> Compare it with: >>> >>> % mutool show atkins_physical_chemistry.pdf outline >>> | "Cover" #page=3D1&view=3DFit >>> | "PREFACE" #page=3D7&view=3DFit >>> | "USING THE BOOK" #page=3D8&view=3DFit >> >> Ok, I see. All my LaTeX PDFs have #nameddest=3Dsection.x values instead >> of #page=3DX 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 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 08:12:07 2024 Received: (at 73530) by debbugs.gnu.org; 3 Oct 2024 12:12:07 +0000 Received: from localhost ([127.0.0.1]:60229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swKgg-0008EJ-IM for submit@debbugs.gnu.org; Thu, 03 Oct 2024 08:12:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swKge-0008DQ-Nj for 73530@debbugs.gnu.org; Thu, 03 Oct 2024 08:12:05 -0400 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 1swKgX-000853-5b; Thu, 03 Oct 2024 08:11:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:References:In-Reply-To:To:From:Date: MIME-Version; bh=NmeIyhPZG9X4aWt7chjahLzB5XIjo7svnxUs6Wp+dbM=; b=IkCfeaKhWHmW HpHwTpntIOE6PPAZrB2jZy/25QCAOmxxQCwXb27P4EWFSdILac7ps6peJttns5MI4oBjl4852TsH5 zCjIkKzayinufpU2tMzln/cxLhMjFB3842GaI5lZr8GSajy5/6TBhjmoIw8TLfYcHOcnR7XoG+lfU 9vmMBpelI2dZGjiPVquMxS+detI/dR0gJe6KUTcdctPo8zBbyi1pVx0jJLnvPRhVW1AvJ5hD6GwFY Vyh1XmCNdia02gx77xdh6UQI5FDT83mPgZ5Bizi+lHJL2MsCZWwFW6dIjDZ8c4pMm80Jbgb29BOMK kPK9OMZxTBOb6ta3+b7jYQ==; X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvuddggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgfgsehtqhertdertdej necuhfhrohhmpedfvfgrshhsihhlohcujfhorhhnfdcuoehtshguhhesghhnuhdrohhrgh eqnecuggftrfgrthhtvghrnhepvdetudethfeuudehjeefffekheeghfelffelhfejjeek gedthefhfedvtdfgtdeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidq keeijeefkeejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmh grihhlrdhfmhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghp thhtohepjeefheeftdesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehvih hsuhifvghshhhmsehgmhgrihhlrdgtohhmpdhrtghpthhtohepvghlihiisehgnhhurdho rhhgpdhrtghpthhtohepjhgrohesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Thu, 03 Oct 2024 14:11:32 +0200 From: "Tassilo Horn" To: Visuwesh Message-Id: In-Reply-To: <87plohcuhm.fsf@gmail.com> 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> <87ttdu1rpu.fsf@gnu.org> <87bk01obpf.fsf@gnu.org> <87plohcuhm.fsf@gmail.com> Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi again,=20 of course we should do the nameddest thing in another patch. No reason t= o put this one on hold. Thanks,=20 Tassilo=20 Am Do, 3. Okt 2024, um 13:10, schrieb Visuwesh: > [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE= =85=E0=AE=95=E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2= 024] Tassilo Horn wrote: > >> Tassilo Horn 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=3Dsection.1 >>>> | "Annotations" #nameddest=3Dsection.2 >>>> >>>> Compare it with: >>>> >>>> % mutool show atkins_physical_chemistry.pdf outline >>>> | "Cover" #page=3D1&view=3DFit >>>> | "PREFACE" #page=3D7&view=3DFit >>>> | "USING THE BOOK" #page=3D8&view=3DFit >>> >>> Ok, I see. All my LaTeX PDFs have #nameddest=3Dsection.x values ins= tead >>> of #page=3DX 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 limitat= ion >> 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 g= et > 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 le= ast >>>>> 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 approa= ch >> 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 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 t= est >>>>> 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 approac= h. > > Great, thank you for taking the time to test the patch. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 10:52:57 2024 Received: (at 73530) by debbugs.gnu.org; 3 Oct 2024 14:52:58 +0000 Received: from localhost ([127.0.0.1]:33705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swNCK-0000G9-VM for submit@debbugs.gnu.org; Thu, 03 Oct 2024 10:52:57 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:56755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swNCI-0000G0-Lu for 73530@debbugs.gnu.org; Thu, 03 Oct 2024 10:52:55 -0400 Received: by mail-pl1-f194.google.com with SMTP id d9443c01a7336-20b86298710so8666385ad.1 for <73530@debbugs.gnu.org>; Thu, 03 Oct 2024 07:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727967112; x=1728571912; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=u2jBTm3VImokDIKus0aCqqff6Z+SI1QOnvFK6Axf/a8=; b=BOHhzQJM/9I36eSKr3olOvwiwftC6mzanHp4UxxIf9mW1t9mG4YBQ9+zizLiAIeTf5 cNh4VKVwzWzp0jmLUiiQmeuva1u+qnNz88mOP/2rjLpALXnXOwmWkX5j3P5EOHSMqNXl s+uZipMTb7Ga9xrVoJjN2QXsdVfj0Ed15GOTuFx3fdPphbqiiVc7O0cHUK+orDYAB2K/ ygmQkMG2nVPw5/9qtQbFYrMNyn7P/SC8CiGnfb2aIp3besbNoGJAr7srmH6NLIqyY78z JBkjjV4BUvs80w2ldwAI8QVIYsUL3PMWfo7m4J2PiBtbaEk9HUFAhZqYmk8G6wOA9Q5Z M5Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727967112; x=1728571912; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=u2jBTm3VImokDIKus0aCqqff6Z+SI1QOnvFK6Axf/a8=; b=luYqfBg8J/PwtEtwnjAllOChH/WuDywX7TxtzQ00HbgbhCoPYEciRa4KEOaqb8LSsa YlLT8OmhGaKSwbPGVxYdATvXqS6UpYMHZmeKtebxGLjwJ/8E/At7T96j10Q5dPpNhk4D Sdn9b0tx7f1t8KesktOeyo5szVKl5WL12eHcx1d8FmFf06TQZymojl+lgwSzebfOzAWP 1925hICZKSWihzRv7PzwyBa9PgJobkM0uaNdu0fmbOILAHl4i698nf0iJUZqKaulkoDr Jio8di8wC+E18JMoThiv+3Di+nzg/CiKbkQHQqkK7e6vffqIbw+vFZf1wnJTvZU6OpZT VJZA== X-Forwarded-Encrypted: i=1; AJvYcCXcLmsKTN0Dgv8S7tyifvJOyuYvzgYcrNZ3N2TqA4f2HxjlIbbypYA2F+4iSUwe0Gt30/JVhw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyCdNILdD5vXqwcPz6R8P2UjFdbAZzWTKcSzukPz71qTqCsrOpq xm72vLhqctbGXrf/P7Y7ac4YXccfg1Kc7OlJl8iJIXgmIyI9IXbw X-Google-Smtp-Source: AGHT+IHi6WAyd/t7sF+14YXppI02E7BJJIvNjMZ74P4JLqWer/NbHAM4aFSfqXyPUDa/C5eM7ha0Cg== X-Received: by 2002:a17:902:e848:b0:20b:9d96:622c with SMTP id d9443c01a7336-20bc59bc452mr108909575ad.8.1727967111674; Thu, 03 Oct 2024 07:51:51 -0700 (PDT) Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20beefb0d9dsm9819045ad.231.2024.10.03.07.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 07:51:51 -0700 (PDT) From: Visuwesh To: Tassilo Horn Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87bk01obpf.fsf@gnu.org> (Tassilo Horn's message of "Thu, 03 Oct 2024 10:03:08 +0200") 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> <87ttdu1rpu.fsf@gnu.org> <87bk01obpf.fsf@gnu.org> Date: Thu, 03 Oct 2024 20:21:46 +0530 Message-ID: <87ldz5ck8t.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: [வியாழன் அக்டோபர் 03, 2024] Tassilo Horn wrote: >>>> 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 th [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [1.7.159.70 listed in zen.spamhaus.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.214.194 listed in sa-accredit.habeas.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (visuweshm[at]gmail.com) 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.214.194 listed in bl.score.senderscore.com] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.214.194 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.214.194 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 73530 Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: [வியாழன் அக்டோபர் 03, 2024] Tassilo Horn wrote: >>>> 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 th [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.214.194 listed in wl.mailspike.net] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.214.194 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.214.194 listed in bl.score.senderscore.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.214.194 listed in list.dnswl.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [1.7.159.70 listed in zen.spamhaus.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (visuweshm[at]gmail.com) 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=85= =E0=AE=95=E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2024] T= assilo Horn wrote: >>>> 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 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. > >>>> 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. I have now attached a patch with the above change. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-imenu-index-function-for-DjVu-files-in-doc-view.patch >From 441f0e9339a853ac011d08c8754fc5c9217d146f Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Wed, 2 Oct 2024 13:48:25 +0530 Subject: [PATCH] Add imenu index function for DjVu files in doc-view * lisp/doc-view.el (doc-view-pdfdraw-program): Prefer mutool over other names. (doc-view-imenu-enabled): Tweak the default value to check for 'djvused', and make it obsolete. (doc-view--djvu-outline, doc-view--parse-djvu-outline): Add new functions to return imenu index for a Djvu file. (doc-view--outline): Add new function to create the imenu index depending on the file type. (doc-view--outline): Document new possible variable value. (doc-view-imenu-index): Use the above function instead. (doc-view-imenu-setup): Try to create the imenu index unconditionally. * doc/emacs/misc.texi (DocView Navigation): Mention index creation using 'djvused' too. * etc/NEWS: Announce the change. (Bug#73530) --- doc/emacs/misc.texi | 18 ++++---- etc/NEWS | 7 +++ lisp/doc-view.el | 108 ++++++++++++++++++++++++++++++++++++-------- 3 files changed, 106 insertions(+), 27 deletions(-) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index b074eb034b2..7b11a829b0b 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -581,17 +581,17 @@ 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}. +@vindex doc-view-djvused-program + DocView can generate an outline menu for PDF and DjVu documents using +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}. The filename of the +@command{djvused} program can be customized by changing the +@code{doc-view-djvused-program} user option. @cindex registers, in DocView mode @findex doc-view-page-to-register diff --git a/etc/NEWS b/etc/NEWS index abe316547aa..bbcef80b762 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -351,6 +351,13 @@ Docview can store current page to buffer-local registers with the new command 'doc-view-page-to-register' (bound to 'm'), and later the stored page can be restored with 'doc-view-jump-to-register' (bound to '''). ++++ +*** Docview can generate imenu index for DjVu files. +When the 'djvused' program is available, Docview can now generate imenu +index for DjVu files from its outline. +The name of the 'djvused' program can be customized by changing the user +option 'doc-view-djvused-program'. + ** Tramp +++ diff --git a/lisp/doc-view.el b/lisp/doc-view.el index e79295a8b01..3683f1f60d4 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -27,8 +27,10 @@ ;; `pdftotext', which comes with xpdf (https://www.foolabs.com/xpdf/) ;; or poppler (https://poppler.freedesktop.org/). EPUB, CBZ, FB2, XPS ;; and OXPS documents require `mutool' which comes with mupdf -;; (https://mupdf.com/index.html). Djvu documents require `ddjvu' +;; (https://mupdf.com/index.html). DjVu documents require `ddjvu' ;; (from DjVuLibre). ODF files require `soffice' (from LibreOffice). +;; `djvused' (from DjVuLibre) can be optionally used to generate imenu +;; outline for DjVu documents when available. ;;; Commentary: @@ -185,13 +187,13 @@ doc-view-ghostscript-program (defcustom doc-view-pdfdraw-program (cond + ((executable-find "mutool") "mutool") ((executable-find "pdfdraw") "pdfdraw") ((executable-find "mudraw") "mudraw") - ((executable-find "mutool") "mutool") (t "mudraw")) "Name of MuPDF's program to convert PDF files to PNG." :type 'file - :version "24.4") + :version "31.1") (defcustom doc-view-pdftotext-program-args '("-raw") "Parameters to give to the pdftotext command." @@ -216,10 +218,23 @@ doc-view-mupdf-use-svg :type 'boolean :version "30.1") -(defcustom doc-view-imenu-enabled (and (executable-find "mutool") t) - "Whether to generate an imenu outline when \"mutool\" is available." +(defcustom doc-view-djvused-program (and (executable-find "djvused") + "djvused") + "Name of \"djvused\" program to generate imenu outline for DjVu files. +This is part of DjVuLibre." + :type 'file + :version "31.1") + +(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") (defcustom doc-view-imenu-title-format "%t (%p)" "Format spec for imenu's display of section titles from docview documents. @@ -1958,7 +1973,9 @@ doc-view--outline-rx "[^\t]+\\(\t+\\)\"\\(.+\\)\"\t#\\(?:page=\\)?\\([0-9]+\\)") (defvar-local doc-view--outline nil - "Cached PDF outline, so that it is only computed once per document.") + "Cached PDF outline, so that it is only computed once per document. +It can be the symbol `unavailable' to indicate that outline is +unavailable for the document.") (defun doc-view--pdf-outline (&optional file-name) "Return a list describing the outline of FILE-NAME. @@ -1972,7 +1989,9 @@ doc-view--pdf-outline (let ((outline nil) (fn (expand-file-name fn))) (with-temp-buffer - (unless (eql 0 (call-process "mutool" nil (current-buffer) nil "show" fn "outline")) + (unless (eql 0 (call-process doc-view-pdfdraw-program nil + (current-buffer) nil "show" fn "outline")) + (setq doc-view--outline 'unavailable) (imenu-unavailable-error "Unable to create imenu index using `mutool'")) (goto-char (point-min)) (while (re-search-forward doc-view--outline-rx nil t) @@ -1983,6 +2002,42 @@ doc-view--pdf-outline outline))) (nreverse outline))))) +(defun doc-view--djvu-outline (&optional file-name) + "Return a list describing the outline of FILE-NAME. +If FILE-NAME is nil or omitted, it defaults to the current buffer's file +name. + +For the format, see `doc-view--pdf-outline'." + (unless file-name (setq file-name (buffer-file-name))) + (with-temp-buffer + (call-process doc-view-djvused-program nil (current-buffer) nil + "-e" "print-outline" file-name) + (goto-char (point-min)) + (when (eobp) + (setq doc-view--outline 'unavailable) + (imenu-unavailable-error "Unable to create imenu index using `djvused'")) + (nreverse (doc-view--parse-djvu-outline (read (current-buffer)))))) + +(defun doc-view--parse-djvu-outline (bookmark &optional level) + "Return a list describing the djvu outline from BOOKMARK. +Optional argument LEVEL is the current heading level, which defaults to 1." + (unless level (setq level 1)) + (let ((res)) + (unless (eq (car bookmark) 'bookmarks) + (user-error "Unknown outline type: %S" (car bookmark))) + (pcase-dolist (`(,title ,page . ,rest) (cdr bookmark)) + (push `((level . ,level) + (title . ,title) + (page . ,(string-to-number (string-remove-prefix "#" page)))) + res) + (when (and rest (listp (car rest))) + (setq res (append + (doc-view--parse-djvu-outline + (cons 'bookmarks rest) + (+ level 1)) + res)))) + res)) + (defun doc-view--imenu-subtree (outline act) "Construct a tree of imenu items for the given outline list and action. @@ -2015,19 +2070,36 @@ doc-view-imenu-index For extensibility, callers can specify a FILE-NAME to indicate the buffer other than the current buffer, and a jumping function GOTO-PAGE-FN other than `doc-view-goto-page'." - (let* ((goto (or goto-page-fn 'doc-view-goto-page)) - (act (lambda (_name _pos page) (funcall goto page))) - (outline (or doc-view--outline (doc-view--pdf-outline file-name)))) - (car (doc-view--imenu-subtree outline act)))) + (unless doc-view--outline + (setq doc-view--outline (doc-view--outline file-name))) + (unless (eq doc-view--outline 'unavailable) + (let* ((goto (or goto-page-fn #'doc-view-goto-page)) + (act (lambda (_name _pos page) (funcall goto page))) + (outline doc-view--outline)) + (car (doc-view--imenu-subtree outline act))))) + +(defun doc-view--outline (&optional file-name) + "Return the outline for the file FILE-NAME. +If FILE-NAME is nil, use the current file instead." + (unless file-name (setq file-name (buffer-file-name))) + (let ((outline + (pcase doc-view-doc-type + ('djvu + (when doc-view-djvused-program + (doc-view--djvu-outline file-name))) + (_ + (doc-view--pdf-outline file-name))))) + (when outline (imenu-add-to-menubar "Outline")) + ;; When the outline could not be made due to unavailability of the + ;; required program, or its absency from the document, return + ;; 'unavailable'. + (or outline 'unavailable))) (defun doc-view-imenu-setup () "Set up local state in the current buffer for imenu, if needed." - (when doc-view-imenu-enabled - (setq-local imenu-create-index-function #'doc-view-imenu-index - imenu-submenus-on-top nil - imenu-sort-function nil - doc-view--outline (doc-view--pdf-outline)) - (when doc-view--outline (imenu-add-to-menubar "Outline")))) + (setq-local imenu-create-index-function #'doc-view-imenu-index + imenu-submenus-on-top nil + imenu-sort-function nil)) ;;;; User interface commands and the mode -- 2.45.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 04 01:34:11 2024 Received: (at 73530-done) by debbugs.gnu.org; 4 Oct 2024 05:34:11 +0000 Received: from localhost ([127.0.0.1]:34244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swax9-0005oo-7D for submit@debbugs.gnu.org; Fri, 04 Oct 2024 01:34:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swax7-0005oZ-QQ for 73530-done@debbugs.gnu.org; Fri, 04 Oct 2024 01:34:10 -0400 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 1swaur-0007OS-E0; Fri, 04 Oct 2024 01:31:50 -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=IN61iTfpDyhok9avcufS9He+wu5/UuDir6ttAuf+icE=; b=YCjyq5WwVZFOl+Mr58ua 6fus6v55SctYnBMG9vwV468ruk3bZ0I4BSFW9ydcqICK6LPmAE7ktGNyKdgpvNP5Uuiw0RlM+r3TU Ce9/6AVjSaqSZPc2Gw9yFC2QOlPh71RERWu557+ExTlh6iDcVjD+Es8geF42fnFSOmL8tYM/6Zpfc L9ihiZHC0xA4/HWEownnOyROIeYpplArKBbWQMmDQmkRlJclED6CHEBQyUeanQKZDP1/KXkfeBxNR ewhEB0WHZYMdSfEGUZrlFvBSsIQ3hd72THjm4qr7H7FSEc6pRpHE7ZlMOaWEtjwDv8ptPrAAGF0yj uEr2MF5wwUr5QQ==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvvddgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgesthdtredttdertden ucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenuc ggtffrrghtthgvrhhnpeeluddvgeefuddvjeekfeetleegtefgveehhfeuffeuffeghefg ueefgfdvffegtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieej feekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilh drfhhmpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthho peejfeehfedtqdguohhnvgesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhope gvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehjrghosehgnhhurdhorhhgpdhrtghp thhtohepvhhishhufigvshhhmhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail From: Tassilo Horn To: Visuwesh Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87ldz5ck8t.fsf@gmail.com> (Visuwesh's message of "Thu, 03 Oct 2024 20:21:46 +0530") 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> <87ttdu1rpu.fsf@gnu.org> <87bk01obpf.fsf@gnu.org> <87ldz5ck8t.fsf@gmail.com> User-Agent: mu4e 1.12.6; emacs 31.0.50 Date: Fri, 04 Oct 2024 07:31:43 +0200 Message-ID: <87r08wh1s0.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73530-done Cc: Eli Zaretskii , "Jose A. Ortega Ruiz" , 73530-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Visuwesh writes: >> As said above, it's more than fast enough, so let's take your approach. > > I have now attached a patch with the above change. Applied and pushed to master. I'm closing this issue. Thanks a lot, Tassilo From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 04 03:33:10 2024 Received: (at 73530) by debbugs.gnu.org; 4 Oct 2024 07:33:11 +0000 Received: from localhost ([127.0.0.1]:34326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swcoI-0003Zc-LA for submit@debbugs.gnu.org; Fri, 04 Oct 2024 03:33:10 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swcoH-0003ZN-4M for 73530@debbugs.gnu.org; Fri, 04 Oct 2024 03:33:09 -0400 Received: by mail-pf1-f193.google.com with SMTP id d2e1a72fcca58-718d91eef2eso1318656b3a.1 for <73530@debbugs.gnu.org>; Fri, 04 Oct 2024 00:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728027119; x=1728631919; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LwDGRlKLOCnl37cY66DaNDHVYX7wegd2wV9XmC9Km7E=; b=OiUivrGkQFp7Bqr3fyIrCVNaquhoDnxLsfIR2J0/crrhpDvnlNOclvtQRxyjkLH1C0 WOTdOA3v2TTQRpuNHuQiQCv4nNdwdn+EH8UVI0lm8RAcAJQ9G75ubdN9ksXaui/Ay+4I DM0itXzaX7V+mXzvEtB9SXUDgmdEqNSw5X0Nv1nT9EFK9aQqQG4kXjLq/Muhy4BNsc8e KOg5hwt1XN7+bdHLRU9GAkWfWd2CDAcyyDw3xKYombIAjfXBrboeNdf7ACuuTOscyB72 KvaG07o2UrDEZ74u1qa2PwR4ZFMIOFynUIT24NP9enPztIHEFj9tERAky4vczhHjr5dU RvOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728027119; x=1728631919; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LwDGRlKLOCnl37cY66DaNDHVYX7wegd2wV9XmC9Km7E=; b=ssC9ycNMVxRmIg8QiFCihox0aqLVdBNjgQzSfIxaU5U4dTG0eKXd7e8SMDqYDHAEOe cTdWSDT9+5xw2bCYFzoVHS07Iu/fqIBrLNlI2g9bj9e2lNjXqKvDyrFBJCTHtkD7WPNy 0RUG2EbjJqZOFKY7ugIQG8KAep1MRL/OWKxcg1Xw01vFDLGUGb2v0YKUNExsNQW+1USv iYD6yRnGXhy4VuZ3Y6NoIdxQOziwRDq6dsMUd2EhJu+tUJhPR3sajlZFd0l3+ezQBgbe JXYtpANs6/lnngIiR4ysKiwpU24Qo4iDZdgGWBTD7VyH3RO5L6y2OICIIl7veFhdvI40 8Y3A== X-Gm-Message-State: AOJu0Yx6NzaWyVk7gbCgSnKHvmQCNCozDNv+Rs/Fu16VTM8ca/IsfcUb z2E36C6hgHNY0fRS+86rWSa6GI8ikRzJBG1aob0d385wJVHLvUN7D0s4Mdjb X-Google-Smtp-Source: AGHT+IHt8jz+BD3e1juXvdpUDP3Lz53FuEaN9dK/AkqeCZ9w79SnkjJSeraQnTE7d6R+L0pXKpGR+A== X-Received: by 2002:a05:6a00:66c8:b0:717:98e7:3d0 with SMTP id d2e1a72fcca58-71dd5a0ebe5mr9041559b3a.0.1728027119281; Fri, 04 Oct 2024 00:31:59 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71dd9d7e559sm2576758b3a.58.2024.10.04.00.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 00:31:58 -0700 (PDT) From: Visuwesh To: 73530@debbugs.gnu.org Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view In-Reply-To: <87r08wh1s0.fsf@gnu.org> (Tassilo Horn's message of "Fri, 04 Oct 2024 07:31:43 +0200") References: <8734ljg6f5.fsf@gmail.com> <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> <87ttdu1rpu.fsf@gnu.org> <87bk01obpf.fsf@gnu.org> <87ldz5ck8t.fsf@gmail.com> <87r08wh1s0.fsf@gnu.org> Date: Fri, 04 Oct 2024 13:01:55 +0530 Message-ID: <877caocoic.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73530 Cc: tsdh@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=85=E0=AE=95= =E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 04, 2024] Tassilo Ho= rn wrote: > Visuwesh writes: > >>> As said above, it's more than fast enough, so let's take your approach. >> >> I have now attached a patch with the above change. > > Applied and pushed to master. I'm closing this issue. Great, thank you! From unknown Tue Jun 17 20:20:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 01 Nov 2024 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator