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:
@@ -190,7 +190,7 @@ unloading."
|
|||||||
;; Unloading a file whose definition is "inactive" (i.e. has been
|
;; Unloading a file whose definition is "inactive" (i.e. has been
|
||||||
;; overridden by another file): just remove it from the history,
|
;; overridden by another file): just remove it from the history,
|
||||||
;; so future unloading of that other file has a chance to DTRT.
|
;; 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))))
|
(pos (- (length hist) (length tmp))))
|
||||||
(cl-assert (> pos 1))
|
(cl-assert (> pos 1))
|
||||||
(setcdr (nthcdr (- pos 2) hist) (cdr tmp)))))))
|
(setcdr (nthcdr (- pos 2) hist) (cdr tmp)))))))
|
||||||
|
|||||||
@@ -937,7 +937,7 @@ add_to_function_history (Lisp_Object symbol, Lisp_Object olddef)
|
|||||||
if (NILP (XCDR (tail)) && STRINGP (XCAR (tail)))
|
if (NILP (XCDR (tail)) && STRINGP (XCAR (tail)))
|
||||||
file = XCAR (tail);
|
file = XCAR (tail);
|
||||||
|
|
||||||
Lisp_Object tem = plist_member (past, file);
|
Lisp_Object tem = Fplist_member (past, file, Qequal);
|
||||||
if (!NILP (tem))
|
if (!NILP (tem))
|
||||||
{ /* New def from a file used before.
|
{ /* New def from a file used before.
|
||||||
Overwrite the previous record associated with this file. */
|
Overwrite the previous record associated with this file. */
|
||||||
|
|||||||
Reference in New Issue
Block a user