diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-04-05 01:13:54 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-04-05 11:14:34 +0200 |
commit | 1760029b092724271f9527543dbd9830b377704f (patch) | |
tree | 6ac67c4ee0d0a5ed2b46e67084a2bacb0a9e4081 /lisp/mpc.el | |
parent | 46b8d7087c8270c92d6a3b94e811de5e3cc99701 (diff) | |
download | emacs-1760029b092724271f9527543dbd9830b377704f.tar.gz emacs-1760029b092724271f9527543dbd9830b377704f.tar.bz2 emacs-1760029b092724271f9527543dbd9830b377704f.zip |
Replace local intersection functions with seq-intersection
* lisp/doc-view.el (doc-view-intersection):
* lisp/gnus/gnus-range.el (gnus-intersection):
* lisp/htmlfontify.el (hfy-interq):
* lisp/loadhist.el (file-set-intersect):
* lisp/mail/smtpmail.el (smtpmail-intersection): Make obsolete in
favor of seq-intersection. Update all callers.
* lisp/url/url-dav.el (url-intersection): Redefine as obsolete
function alias for seq-intersection. Update callers.
* lisp/mpc.el (mpc-intersection, mpc-cmd-list, mpc-reorder):
Use seq-intersection.
Diffstat (limited to 'lisp/mpc.el')
-rw-r--r-- | lisp/mpc.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/mpc.el b/lisp/mpc.el index 827f8aacdd6..315d8c0626d 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -129,12 +129,10 @@ "Return L1 after removing all elements not found in L2. If SELECTFUN is non-nil, elements aren't compared directly, but instead they are passed through SELECTFUN before comparison." - (let ((res ())) - (if selectfun (setq l2 (mapcar selectfun l2))) - (dolist (elem l1) - (when (member (if selectfun (funcall selectfun elem) elem) l2) - (push elem res))) - (nreverse res))) + (when selectfun + (setq l1 (mapcar selectfun l1)) + (setq l2 (mapcar selectfun l2))) + (seq-intersection l1 l2)) (defun mpc-event-set-point (event) (condition-case nil (posn-set-point (event-end event)) @@ -698,7 +696,7 @@ The songs are returned as alists." (let* ((osongs (mpc-cmd-find other-tag value)) (ofiles (mpc-assq-all 'file (apply 'append osongs))) (plfiles (mpc-assq-all 'file (apply 'append plsongs)))) - (when (mpc-intersection plfiles ofiles) + (when (seq-intersection plfiles ofiles) (push pl pls))))))) pls)) @@ -1669,7 +1667,7 @@ Return non-nil if a selection was deactivated." (mpc-cmd-list mpc-tag (car cst) val)) (cdr cst))))) (setq active - (if (listp active) (mpc-intersection active vals) vals)))) + (if (listp active) (seq-intersection active vals) vals)))) (when (listp active) ;; Remove the selections if they are all in conflict with |