summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2013-06-06 10:15:43 -0600
committerEric Schulte <schulte.eric@gmail.com>2013-06-06 10:15:43 -0600
commit29e2853870fa888bee8753682639a0939af9035f (patch)
tree8e2b61dacfe7b5f8a1a1057712597f9f017d9a66
parentf301bbcc862c2acc61749bc1e24895bf69cd4d06 (diff)
downloadorg-mode-29e2853870fa888bee8753682639a0939af9035f.tar.gz
an Org-mode version of the cl every function
* lisp/org.el (org-every): An Org-mode version of the cl every function.
-rw-r--r--lisp/org.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/org.el b/lisp/org.el
index f6d0a83..403da46 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -21753,6 +21753,13 @@ Taken from `reduce' in cl-seq.el with all keyword arguments but
(setq cl-accum (funcall cl-func cl-accum (pop cl-seq))))
cl-accum))
+(defun org-every (pred seq)
+ "Return true if PREDICATE is true of every element of SEQ.
+Adapted from `every' in cl.el."
+ (catch 'org-every
+ (mapc (lambda (e) (unless (funcall pred e) (throw 'org-every nil))) seq)
+ t))
+
(defun org-back-over-empty-lines ()
"Move backwards over whitespace, to the beginning of the first empty line.
Returns the number of empty lines passed."