Subject: bug#58278: Add new function seq-keep

From: Jonas Bernoulli <[email-masked]>
Date: Mon, 03 Oct 2022 23:30:13 +0200

While I still appreciate the `dash' package, I try to avoid it in
a package when all or most of its used `dash' functions and macros,
can be replaced with equivalent functions/macros from `seq', `cl-lib'
or other parts of Emacs.

Unfortunately I cannot find a replacement for `-keep', which I have been
using a lot.  I propose that we add something like:

  (cl-defgeneric seq-keep (pred sequence)
    "Return a list of all non-nil results of (PRED element) for elements in SEQUENCE."
    (delq nil (seq-map (lambda (elt) (funcall pred elt))
                       sequence)))

Cheers,
Jonas