diff options
author | Michael R. Mauger <michael@mauger.com> | 2017-07-03 15:32:41 -0400 |
---|---|---|
committer | Michael R. Mauger <michael@mauger.com> | 2017-07-03 15:32:41 -0400 |
commit | 776635c01abd4aa759e7aa9584b513146978568c (patch) | |
tree | 554f444bc96cb6b05435e8bf195de4df1b00df8f /lisp/emacs-lisp/seq.el | |
parent | 77083e2d34ba5559ae2899d3b03cf08c2e6c5ad4 (diff) | |
parent | 4cd0db3d6e6e4d5bd49283483bdafbbfc0f583f1 (diff) | |
download | emacs-776635c01abd4aa759e7aa9584b513146978568c.tar.gz emacs-776635c01abd4aa759e7aa9584b513146978568c.tar.bz2 emacs-776635c01abd4aa759e7aa9584b513146978568c.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/emacs-lisp/seq.el')
-rw-r--r-- | lisp/emacs-lisp/seq.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 10de2484798..23e444fe241 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -4,7 +4,7 @@ ;; Author: Nicolas Petton <nicolas@petton.fr> ;; Keywords: sequences -;; Version: 2.19 +;; Version: 2.20 ;; Package: seq ;; Maintainer: emacs-devel@gnu.org @@ -355,6 +355,12 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil." e)) sequence)) +(cl-defgeneric seq-set-equal-p (sequence1 sequence2 &optional testfn) + "Return non-nil if SEQUENCE1 and SEQUENCE2 contain the same elements, regardless of order. +Equality is defined by TESTFN if non-nil or by `equal' if nil." + (and (seq-every-p (lambda (item1) (seq-contains sequence2 item1 testfn)) sequence1) + (seq-every-p (lambda (item2) (seq-contains sequence1 item2 testfn)) sequence2))) + (cl-defgeneric seq-position (sequence elt &optional testfn) "Return the index of the first element in SEQUENCE that is equal to ELT. Equality is defined by TESTFN if non-nil or by `equal' if nil." |