emacs-diffs
[Top][All Lists]

## scratch/shortdoc 1138316: Group sequence functions

 From: Lars Ingebrigtsen Subject: scratch/shortdoc 1138316: Group sequence functions Date: Sun, 13 Sep 2020 18:35:46 -0400 (EDT)

```branch: scratch/shortdoc
commit 11383169e35d25ca5fc3883b92cc7a0b113d73ed
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

Group sequence functions
---
lisp/emacs-lisp/shortdoc.el | 101 +++++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 48 deletions(-)

diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index eaa5e565..5e6f6fd 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -246,79 +246,84 @@ There can be any number of :example/:result elements."
:example (regexp-opt '("foo" "bar"))))

(define-short-documentation-group sequence
+  "Sequence Predicates"
(seq-contains-p
:example (seq-contains '(a b c) 'b)
:example (seq-contains '(a b c) 'd))
+  (seq-every-p
+   :example (seq-every-p #'numberp '(1 2 3)))
+  (seq-empty-p
+   :example (seq-empty-p []))
+  (seq-set-equal-p
+   :example (seq-set-equal-p '(1 2 3) '(3 1 2)))
+  (seq-some
+   :example (seq-some #'cl-evenp '(1 2 3)))
+  "Building Sequences"
(seq-concatenate
:example (seq-concatenate 'vector '(1 2) '(c d)))
-  (seq-count
-   :example (seq-count #'numberp '(1 b c 4)))
(seq-copy
:example (seq-copy '(a 2)))
-  (seq-difference
-   :example (seq-difference '(1 2 3) '(2 3 4)))
+  (seq-into
+   :example (seq-into '(1 2 3) 'vector))
+  "Utility Functions"
+  (seq-count
+   :example (seq-count #'numberp '(1 b c 4)))
+  (seq-elt
+   :example (seq-elt '(a b c) 1))
+  (seq-random-elt
+   :example-no-result (seq-random-elt '(a b c)))
+  (seq-find
+   :example (seq-find #'numberp '(a b 3 4 f 6)))
+  (seq-position
+   :example (seq-position '(a b c) 'c))
+  (seq-length
+   :example (seq-length "abcde"))
+  (seq-max
+   :example (seq-max [1 2 3]))
+  (seq-min
+   :example (seq-min [1 2 3]))
+  (seq-first
+   :example (seq-first [a b c]))
+  (seq-rest
+   :example (seq-rest '[1 2 3]))
+  (seq-reverse
+   :example (seq-reverse '(1 2 3)))
+  (seq-sort
+   :example (seq-sort #'> '(1 2 3)))
+  (seq-sort-by
+   :example (seq-sort-by (lambda (a) (/ 1.0 a)) #'< '(1 2 3)))
+  "Mapping Over Sequences"
+  (seq-map
+   :example (seq-map #'1+ '(1 2 3)))
+  (seq-map-indexed
+   :example (seq-map-indexed (lambda (a i) (cons i a)) '(a b c)))
+  (seq-mapcat
+   :example (seq-mapcat #'upcase '("a" "b" "c") 'string))
(seq-do
:example-no-result (seq-do (lambda (a) (insert a)) '("foo" "bar")))
(seq-do-indexed
:example-no-result (seq-do-indexed
(lambda (a index) (message "%s:%s" index a))
'("foo" "bar")))
+  (seq-reduce
+   :example (seq-reduce #'* [1 2 3] 2))
+  "Excerpting Sequences"
(seq-drop
:example (seq-drop '(a b c) 2))
(seq-drop-while
:example (seq-drop-while #'numberp '(1 2 c d 5)))
-  (seq-elt
-   :example (seq-elt '(a b c) 1))
-  (seq-empty-p
-   :example (seq-empty-p []))
-  (seq-every-p
-   :example (seq-every-p #'numberp '(1 2 3)))
(seq-filter
:example (seq-filter #'numberp '(a b 3 4 f 6)))
-  (seq-find
-   :example (seq-find #'numberp '(a b 3 4 f 6)))
-  (seq-first
-   :example (seq-first [a b c]))
+  (seq-remove
+   :example (seq-remove #'numberp '(1 2 c d 5)))
(seq-group-by
:example (seq-group-by #'cl-plusp '(-1 2 3 -4 -5 6)))
+  (seq-difference
+   :example (seq-difference '(1 2 3) '(2 3 4)))
(seq-intersection
:example (seq-intersection '(1 2 3) '(2 3 4)))
-  (seq-into
-   :example (seq-into '(1 2 3) 'vector))
-  (seq-length
-   :example (seq-length "abcde"))
-  (seq-map
-   :example (seq-map #'1+ '(1 2 3)))
-  (seq-map-indexed
-   :example (seq-map-indexed (lambda (a i) (cons i a)) '(a b c)))
-  (seq-mapcat
-   :example (seq-mapcat #'upcase '("a" "b" "c") 'string))
-  (seq-max
-   :example (seq-max [1 2 3]))
-  (seq-min
-   :example (seq-min [1 2 3]))
(seq-partition
:example (seq-partition '(a b c d e f g h) 3))
-  (seq-position
-   :example (seq-position '(a b c) 'c))
-  (seq-random-elt
-   :example-no-result (seq-random-elt '(a b c)))
-  (seq-reduce
-   :example (seq-reduce #'* [1 2 3] 2))
-  (seq-remove
-   :example (seq-remove #'numberp '(1 2 c d 5)))
-  (seq-rest
-   :example (seq-rest '(1 2 3)))
-  (seq-reverse
-   :example (seq-reverse '(1 2 3)))
-  (seq-set-equal-p
-   :example (seq-set-equal-p '(1 2 3) '(3 1 2)))
-  (seq-some
-   :example (seq-some #'cl-evenp '(1 2 3)))
-  (seq-sort
-   :example (seq-sort #'> '(1 2 3)))
-  (seq-sort-by
-   :example (seq-sort-by (lambda (a) (/ 1.0 a)) #'< '(1 2 3)))
(seq-subseq
:example (seq-subseq '(a b c d e) 2 4))
(seq-take

```