From 6b101f17b8b1f08264af27802125b5ffad6a9e4b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 20 Feb 2026 23:31:13 -0500 Subject: [PATCH] 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`. --- lisp/loadhist.el | 2 +- src/data.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 375c64812ec..51f1be4071a 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el @@ -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))))))) diff --git a/src/data.c b/src/data.c index da8ca42e565..4973d577c1c 100644 --- a/src/data.c +++ b/src/data.c @@ -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. */