emacs: Add 'guix-any'.

* emacs/guix-utils.el (guix-any): New function.
This commit is contained in:
Alex Kost 2015-08-12 15:37:20 +03:00
parent ad0f31f6a5
commit e767752c79
1 changed files with 8 additions and 0 deletions

View File

@ -215,6 +215,14 @@ accessed with KEYS."
(while (re-search-forward ,regexp nil t)
,@body)))
(defun guix-any (pred lst)
"Test whether any element from LST satisfies PRED.
If so, return the return value from the successful PRED call.
Return nil otherwise."
(when lst
(or (funcall pred (car lst))
(guix-any pred (cdr lst)))))
;;; Diff