Fix predicate of plist-member on function-history

The keys of this plist are strings and should thus be compared
with `equal`.  `eq` works surprisingly often (because we often
happen to use exactly the same string) but not always.

* lisp/loadhist.el (loadhist-unload-element):
* src/data.c (add_to_function_history): Pass `equal` to `plist-member`.
This commit is contained in:
Stefan Monnier
2026-02-20 23:31:13 -05:00
parent b83771e534
commit 6b101f17b8
2 changed files with 2 additions and 2 deletions

View File

@@ -190,7 +190,7 @@ unloading."
;; Unloading a file whose definition is "inactive" (i.e. has been
;; overridden by another file): just remove it from the history,
;; so future unloading of that other file has a chance to DTRT.
(let* ((tmp (plist-member hist loadhist-unload-filename))
(let* ((tmp (plist-member hist loadhist-unload-filename #'equal))
(pos (- (length hist) (length tmp))))
(cl-assert (> pos 1))
(setcdr (nthcdr (- pos 2) hist) (cdr tmp)))))))

View File

@@ -937,7 +937,7 @@ add_to_function_history (Lisp_Object symbol, Lisp_Object olddef)
if (NILP (XCDR (tail)) && STRINGP (XCAR (tail)))
file = XCAR (tail);
Lisp_Object tem = plist_member (past, file);
Lisp_Object tem = Fplist_member (past, file, Qequal);
if (!NILP (tem))
{ /* New def from a file used before.
Overwrite the previous record associated with this file. */