Subject: bug#71314: [PATCH] info-lookup-symbol does not work in python-mode

From: James Thomas <[email-masked]>
Date: Sun, 02 Jun 2024 16:40:15 +0530

Eli Zaretskii wrote:

>> Cc: [email-masked]
>> Date: Sun, 02 Jun 2024 06:15:48 +0530
>> From:  James Thomas via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>>
>> - Make sure python info docs are installed (in Debian-derivatives, 'sudo
>>   apt install python3-doc')
>> - emacs -Q
>> - Open a buffer test.py and type: print
>> - C-h S fails, even after typing RET, but...
>>
>> - Then do info-lookup-reset, and the previous step works.
>>
>> Here's a possible patch, which hasn't been tested as much as needed:
>
> Thanks, but can you also explain why the original recipe fails, and
> the main idea of the fix?

The problem seems to be that info-lookup-interactive-arguments sets the
cache as 'initialized' for the mode (python-mode, in this case) without
accounting for the new case of :doc-spec-function (which needs
info-lookup--expand-info to be run), so that subsequent calls don't
bother running info-lookup-setup-mode again. It could later work, for
e.g., when the initialization was marked 'undone' by calling
info-lookup-reset as I'd said above, because by that time the --expand
had been already run.

(I didn't include this explanation earlier as I'd considered the fix a
kind of POC)

--