Subject: Re: bug#73530: [PATCH] Add imenu index function for Djvu files in doc-view

From: Visuwesh <[email-masked]>
Date: Sun, 29 Sep 2024 20:04:13 +0530

[ஞாயிறு செப்டம்பர் 29, 2024] Tassilo Horn wrote:

> "Jose A. Ortega Ruiz" <[email-masked]> 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