Subject: bug#64516: [PATCH] docview: Only enable imenu when supported

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Jul 2023 12:14:40 +0300

> From: Morgan Smith <[email-masked]>
> Date: Fri, 07 Jul 2023 11:24:01 -0400
> 
> More info is in the commit message.
> 
> To re-create the error open up an EPUB file (or possibly any non-PDF
> file in doc-view) and press 'M-g i' to run 'imenu'.  Doing that I get
> the following error:
> 
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   string-match("\\`PK\\'" nil)
>   imenu-find-default("PK" (("*Rescan*" . -99) nil))
>   imenu--completion-buffer((("*Rescan*" . -99) nil) nil)
>   imenu-choose-buffer-index()
>   byte-code("\300 C\207" [imenu-choose-buffer-index] 1)
>   command-execute(imenu)

Thanks.

Tassilo, any comments to the problem and the proposed patch?