Function: seq-keep
seq-keep is a byte-compiled function defined in seq.el.gz.
Signature
(seq-keep FUNCTION SEQUENCE)
Documentation
Apply FUNCTION to SEQUENCE and return the list of all the non-nil results.
This does not modify SEQUENCE.
Other relevant functions are documented in the sequence group.
Probably introduced at or before Emacs version 29.1.
Shortdoc
;; sequence
(seq-keep #'car-safe '((1 2) 3 t (a . b)))
=> (1 a)
Aliases
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/seq.el.gz
(defun seq-keep (function sequence)
"Apply FUNCTION to SEQUENCE and return the list of all the non-nil results.
This does not modify SEQUENCE."
(delq nil (seq-map function sequence)))