From e490ffcf953cd2a82aef86e05da24352db5d4568 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 3 Jun 2021 18:05:01 -0400 Subject: [PATCH] * lisp/mpc.el (mpc-intersection): Fix commit 1760029b0927242 --- lisp/mpc.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/mpc.el b/lisp/mpc.el index 9addb70f56a..ab572aa539a 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -125,14 +125,13 @@ (unless (member elem seen) (push elem res))))) (nreverse res))) -(defun mpc-intersection (l1 l2 &optional selectfun) +(defun mpc-intersection (l1 l2 selectfun) "Return L1 after removing all elements not found in L2. -If SELECTFUN is non-nil, elements aren't compared directly, but instead +Elements aren't compared directly, but instead they are passed through SELECTFUN before comparison." - (when selectfun - (setq l1 (mapcar selectfun l1)) - (setq l2 (mapcar selectfun l2))) - (seq-intersection l1 l2)) + (seq-intersection l1 l2 (lambda (x y) + (equal (funcall selectfun x) + (funcall selectfun y))))) (defun mpc-event-set-point (event) (condition-case nil (posn-set-point (event-end event)) -- 2.39.2