[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e490ffc 1/2: * lisp/mpc.el (mpc-intersection): Fix commit 1760029
From: |
Stefan Monnier |
Subject: |
master e490ffc 1/2: * lisp/mpc.el (mpc-intersection): Fix commit 1760029b0927242 |
Date: |
Sat, 5 Jun 2021 11:58:07 -0400 (EDT) |
branch: master
commit e490ffcf953cd2a82aef86e05da24352db5d4568
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* 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 9addb70..ab572aa 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))