Subject: bug#14120: [Robert Weiner] Emacs history selection non-string arguments causing failures for a long time

From: Stefan Monnier <[email-masked]>
Date: Sun, 16 Feb 2020 20:52:32 -0500

> This bug #14120 in subr.el is still occurring in Emacs 27.0.50 because
> leading entries like (require . info) rather than strings are being
> injected into the history.  Since this has affected people for quite a
> while, I hope you or someone else can add this one line change to the Emacs
> 27 branch and resolve it.

The original #14120 report was linked to the use of CANNOT_DUMP which is
not used any more, AFAICT, so we haven't really investigated this bug.

Concretely, I don't know how/where this shows up.  Do you have some
recipe (and/or backtrace)?

> !  ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=14120
> !  ;; Avoid this bug still occuring in Emacs 27.0.50 by checking
> !  ;; if load-elt is a string or not.
> !  (or (not (stringp (car load-elt)))
>        (not (string-match file-regexp (car load-elt)))))

The docstring of `load-history` says that (car load-elt) should never be
anything else than a string or nil.  So the right fix is likely
elsewhere.

        Stefan