GNU bug report logs - #58103
[PATCH] docview: imenu access to table of contents

Previous Next

Package: emacs;

Reported by: Jose A Ortega Ruiz <jao <at> gnu.org>

Date: Tue, 27 Sep 2022 05:42:01 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Jose A Ortega Ruiz <jao <at> gnu.org>
Cc: 58103 <at> debbugs.gnu.org
Subject: bug#58103: [PATCH] docview: imenu access to table of contents
Date: Thu, 29 Sep 2022 00:00:54 +0200
Jose A Ortega Ruiz <jao <at> gnu.org> writes:

> Tags: patch
>
>
> Hi,
>
> The patch below provides a quite simple implemetation of an imenu for
> doc-view, using mutool.  That means of course that is limited to systems
> where it's installed, and doesn't try to be too smart, but it's been
> working quite well for me.  It needs a slight tweak to imenu.el to add a
> knob inhibiting it to push all entries with submenus to the top, which
> doesn't make sense when those entries represent sections of a TOC.
>
> If this is acceptable (with any needed modification, of course), i guess
> we could also add a bit of further customization, like perhaps a "flat
> mode", or whether or not the section titles include page numbers, but
> i'm not sure if that's desired (in my usage, i never want either).

Thanks for working on this! I've given it a try, and I get the following
error when the PDF does not have an outline (starting from emacs -Q):

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\`%PDF-1\\'" nil)
  imenu-find-default("%PDF-1" (("*Rescan*" . -99) (nil)))
  imenu--completion-buffer((("*Rescan*" . -99) nil) nil)
  imenu-choose-buffer-index()
  byte-code("\300 C\207" [imenu-choose-buffer-index] 1)
  call-interactively(imenu record nil)
  command-execute(imenu record)
  execute-extended-command(nil "imenu" "imenu")
  funcall-interactively(execute-extended-command nil "imenu" "imenu")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Can you reproduce the same issue as well?  I'm using mutool version
1.19.0.

In GNU Emacs 29.0.50 (build 8, aarch64-apple-darwin21.6.0, NS
 appkit-2113.60 Version 12.6 (Build 21G115)) of 2022-09-28 built on
 Daniels-MacBook-Pro.local
Repository revision: b6a163ba7cdf57eff5542b4cb6956780ebb2880f
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.6

Configured using:
 'configure CPPFLAGS=-I/opt/homebrew/opt/openjdk <at> 11/include'

Configured features:
ACL DBUS GLIB GNUTLS JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER
PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS WEBP XIM ZLIB




This bug report was last modified 2 years and 291 days ago.

Previous Next


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