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

From: Tassilo Horn <[email-masked]>
Date: Fri, 28 Jul 2023 12:19:20 +0200

"Basil L. Contovounesios" <[email-masked]> writes:

>> diff --git a/lisp/doc-view.el b/lisp/doc-view.el
>> index b14655fb274..847601872f5 100644
>> --- a/lisp/doc-view.el
>> +++ b/lisp/doc-view.el
>> @@ -147,6 +147,8 @@
> [...]
>> +          (unless (= 0 (call-process "mutool" nil (current-buffer) nil "show" fn "outline"))
>> +            (imenu-unavailable-error "Unable to create imenu index using `mutool'"))
>
> Is call-process guaranteed to return a number?
> Would eq/l be more suitable than =?

Good question, the docs say:

  If DESTINATION is 0, ‘call-process’ returns immediately with value nil.
  Otherwise it waits for PROGRAM to terminate
  and returns a numeric exit status or a signal description string.

I guess if mutool is killed externally while emacs runs it, it could be
such a "signal description string" in which case eql would be better
even though that situation seems unlikely.  I'll change that later.

Thanks for the heads-up,
Tassilo