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.

Other relevant functions are documented in the sequence group.

View in manual

Probably introduced at or before Emacs version 29.1.

Shortdoc

;; sequence
(seq-keep #'car-safe '((1 2) 3 t (a . b)))
    => (1 a)

Aliases

tramp-compat-seq-keep

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."
  (delq nil (seq-map function sequence)))