Subject: bug#63881: 29.0.91; apropos-documentation fails when load-history contains element whose CAR is nil

From: Visuwesh <[email-masked]>
Date: Sun, 04 Jun 2023 14:04:06 +0530

On 4 June 2023 11:01:58 GMT+05:30, Eli Zaretskii <[email-masked]> wrote:
>> From: Visuwesh <[email-masked]>
>> Date: Sun, 04 Jun 2023 08:37:08 +0530
>> 
>> 
>> As per (info "(elisp) Where Defined"), load-history may contain an
>> element whose CAR is nil if eval-buffer was used to evaluate a defun
>> in a non-file-visiting buffer.
>> 
>> After such an entry is added to load-history, apropos-documentation
>> fails with the backtrace at end.
>
>How did you add such an entry to load-history?  IOW, is there a
>real-life use case where this happens?

eval-buffer is the answer apparently.  I don't remember using the command explicitly myself though so some other eval command is calling it.
Also see the reproducer below.

>> To reproduce the issue,
>> 
>>     1. emacs -Q
>>     2. Insert (defun test () t)
>>     3. M-x eval-buffer RET
>>     4. Confirm that a nil entry is present in load-history by evaluating
>>        (alist-get nil load-history 'none)
>>     5. C-h d any RET