bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63881: 29.0.91; apropos-documentation fails when load-history contai


From: Eli Zaretskii
Subject: bug#63881: 29.0.91; apropos-documentation fails when load-history contains element whose CAR is nil
Date: Sun, 04 Jun 2023 08:31:58 +0300

> From: Visuwesh <visuweshm@gmail.com>
> 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?

> 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
> 
> The problem lies in apropos--map-preloaded-atoms in the part
> 
>     (dolist (x load-history)
>       (when (string-match preloaded-regexp (car x))
>                                            ^^^^^^^^
>         (dolist (def (cdr x))
>           (cond
>            ((symbolp def) (funcall f def))
>            ((eq 'defun (car-safe def)) (funcall f (cdr def)))))))))
> 
> 
> ----
> 
> 
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   string-match("\\`/home/viz/lib/ports/emacs/lisp/\\(?:abbrev\\|b\\(?:..." 
> nil)
>   (if (string-match preloaded-regexp (car x)) (progn (let ((tail (cdr x))) 
> (while tail (let ((def (car tail))) (cond ((symbolp def) (funcall f def)) 
> ((eq ... ...) (funcall f ...))) (setq tail (cdr tail)))))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]