Commits

Joe Bogner committed 343c86e

refactor org-parse

Comments (0)

Files changed (1)

 		 (cons Heading NextPosition))))
 
 (de org-parse (Lines Until)
-	(let (Lst NIL Go 1)
-		(for (Line (and Lines Go) Lines)
+	(let (Lst NIL)
+		(while Lines 
 			(let (Line (car Lines)
 						Level (org-parse-level Line)
 						HeadingParse (if (and (>= Level Until) (> Level 0)) (org-parse-heading Line Level (cdr Lines)))
 						Heading (car HeadingParse)
 						NextPosition (cdr HeadingParse))
-			 (if (and (<= Level Until) (not (= 0 Level))) (setq Go NIL))
-	     (if (and Go HeadingParse)
+			 (if (and (<= Level Until) (not (= 0 Level))) (setq Lines NIL))
+	     (if (and Lines HeadingParse)
 				 (prog
 					 (setq Lst (cons Heading Lst))
 					 (setq Lines NextPosition))
 				 (setq Lines (cdr Lines)))))
        (reverse Lst)))
 
-
 (printsp (org-parse Lines -1))
 (bye)