[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/12: emacs: Add 'guix-any'.
From: |
Alex Kost |
Subject: |
05/12: emacs: Add 'guix-any'. |
Date: |
Fri, 14 Aug 2015 08:18:15 +0000 |
alezost pushed a commit to branch wip-emacs-popup-ui
in repository guix.
commit dcc677595c2de091060725568822adc7c103c9b2
Author: Alex Kost <address@hidden>
Date: Wed Aug 12 15:37:20 2015 +0300
emacs: Add 'guix-any'.
* emacs/guix-utils.el (guix-any): New function.
---
emacs/guix-utils.el | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/emacs/guix-utils.el b/emacs/guix-utils.el
index 8a0673a..3343d41 100644
--- a/emacs/guix-utils.el
+++ b/emacs/guix-utils.el
@@ -168,6 +168,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
- branch wip-emacs-popup-ui created (now 220f64d), Alex Kost, 2015/08/14
- 01/12: guix lint: Export checkers and <lint-checker> accessors., Alex Kost, 2015/08/14
- 02/12: emacs: Add 'guix-lint-checker-names'., Alex Kost, 2015/08/14
- 05/12: emacs: Add 'guix-any'.,
Alex Kost <=
- 03/12: emacs: Add 'guix-package-names'., Alex Kost, 2015/08/14
- 04/12: emacs: Add and use 'guix-while-search'., Alex Kost, 2015/08/14
- 06/12: emacs: Add and use 'guix-concat-strings'., Alex Kost, 2015/08/14
- 09/12: emacs: Add code for executing guix commands in REPL., Alex Kost, 2015/08/14
- 10/12: emacs: Add "guix-popup.el"., Alex Kost, 2015/08/14
- 08/12: emacs: Add minibuffer readers., Alex Kost, 2015/08/14
- 07/12: emacs: Move help variables to "guix-help-vars.el"., Alex Kost, 2015/08/14
- 11/12: doc: Reorganize "Emacs Interface" node., Alex Kost, 2015/08/14
- 12/12: emacs: Add popup interface for guix commands., Alex Kost, 2015/08/14