summaryrefslogtreecommitdiff
path: root/lisp/loadhist.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-04-05 01:13:54 +0200
committerStefan Kangas <stefan@marxist.se>2021-04-05 11:14:34 +0200
commit1760029b092724271f9527543dbd9830b377704f (patch)
tree6ac67c4ee0d0a5ed2b46e67084a2bacb0a9e4081 /lisp/loadhist.el
parent46b8d7087c8270c92d6a3b94e811de5e3cc99701 (diff)
downloademacs-1760029b092724271f9527543dbd9830b377704f.tar.gz
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/loadhist.el')
-rw-r--r--lisp/loadhist.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index a60d6b29095..59c002d3078 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -82,12 +82,6 @@ A library name is equivalent to the file name that `load-library' would load."
(when (eq (car-safe x) 'require)
(push (cdr x) requires)))))
-(defsubst file-set-intersect (p q)
- "Return the set intersection of two lists."
- (let (ret)
- (dolist (x p ret)
- (when (memq x q) (push x ret)))))
-
(defun file-dependents (file)
"Return the list of loaded libraries that depend on FILE.
This can include FILE itself.
@@ -97,7 +91,7 @@ A library name is equivalent to the file name that `load-library' would load."
(dependents nil))
(dolist (x load-history dependents)
(when (and (stringp (car x))
- (file-set-intersect provides (file-requires (car x))))
+ (seq-intersection provides (file-requires (car x)) #'eq))
(push (car x) dependents)))))
(defun read-feature (prompt &optional loaded-p)
@@ -322,6 +316,13 @@ something strange, such as redefining an Emacs function."
;; Don't return load-history, it is not useful.
nil)
+;; Obsolete.
+
+(defsubst file-set-intersect (p q)
+ "Return the set intersection of two lists."
+ (declare (obsolete seq-intersection "28.1"))
+ (nreverse (seq-intersection p q #'eq)))
+
(provide 'loadhist)
;;; loadhist.el ends here