summaryrefslogtreecommitdiff
path: root/doc/lispref/sequences.texi
diff options
context:
space:
mode:
authorNicolas Petton <nicolas@petton.fr>2016-03-29 09:19:32 +0200
committerNicolas Petton <nicolas@petton.fr>2016-03-29 09:19:32 +0200
commit2946344a231a915d5143017b70e91a9a7a9b11aa (patch)
tree21d46bb829f4f9b9a130b6dbd7e12b268f7e80f8 /doc/lispref/sequences.texi
parenta30e7e12ed8465e2565dd318d921bc87f52ce18e (diff)
downloademacs-2946344a231a915d5143017b70e91a9a7a9b11aa.tar.gz
New function seq-sort-by in seq.el
* lisp/emacs-lisp/seq.el (seq-sort-by): New function. * test/lisp/emacs-lisp/seq-tests.el: New test for seq-sort-by. * doc/lispref/sequences.texi: Add documentation for seq-sort-by.
Diffstat (limited to 'doc/lispref/sequences.texi')
-rw-r--r--doc/lispref/sequences.texi12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index f7d26e54d0b..08e5e3ae35c 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -763,6 +763,18 @@ according to @var{function}, a function of two arguments that returns
non-@code{nil} if the first argument should sort before the second.
@end defun
+@defun seq-sort-by function predicate sequence
+ This function is similar to @code{seq-sort}, but the elements of
+@var{sequence} are transformed by applying @var{function} on them
+before being sorted. @var{function} is a function of one argument.
+
+@example
+(seq-sort-by #'seq-length #'> ["a" "ab" "abc"])
+@result{} ["abc" "ab" "a"]
+@end example
+@end defun
+
+
@defun seq-contains sequence elt &optional function
This function returns the first element in @var{sequence} that is equal to
@var{elt}. If the optional argument @var{function} is non-@code{nil},