1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Add 'seq-keep'

* doc/lispref/sequences.texi (Sequence Functions): Document it.
* lisp/emacs-lisp/seq.el (seq-keep): New function (bug#58278).
This commit is contained in:
Lars Ingebrigtsen 2022-10-04 21:44:52 +02:00
parent 1d3d87cd67
commit 92df7cd923
4 changed files with 28 additions and 0 deletions

View file

@ -695,5 +695,9 @@ which may be shorter."
result))
(nreverse result)))
(defun seq-keep (function sequence)
"Apply FUNCTION to SEQUENCE and return all non-nil results."
(delq nil (seq-map function sequence)))
(provide 'seq)
;;; seq.el ends here