Commit 176a6173 authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

Add filter macro, which does what you expect.

* subr.el (filter): New macro. Because it's just silly for a Lisp not
to have this in 2014.  And VC mode needs it.
parent b1a765b3
2014-12-02 Eric S. Raymond <esr@snark.thyrsus.com>
* vc.el, all backends: API simplification: Abolish dir-status.
* subr.el (filter): New macro. Because it's just silly for a Lisp
not to have this in 2014. And VC needs it.
* vc.el, all backends: API simplification: Abolish dir-status.
It's replaced by dir-status-files.
* vc.el, all backends: API simplification: Remove 4th
......
......@@ -222,6 +222,11 @@ Then evaluate RESULT to get return value, default nil.
,@(if (cdr (cdr spec))
`((setq ,(car spec) nil) ,@(cdr (cdr spec))))))))
(defmacro filter (condp lst)
"Return the list consisting of elements in LST for which CONDP is not nil."
`(delq nil
(mapcar (lambda (x) (and (funcall ,condp x) x)) ,lst)))
(defmacro dotimes (spec &rest body)
"Loop a certain number of times.
Evaluate BODY with VAR bound to successive integers running from 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment