Convert multi-LETREC to internal definitions in edwin/occur.scm.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 10 Feb 2019 22:39:41 +0000 (22:39 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 10 Feb 2019 22:39:41 +0000 (22:39 +0000)
src/edwin/occur.scm

index 8039c686edae4a9c0c5f69ab243a81a9c64fe399..ac9205db908f324a7c6b3c1a9f856301a56575c2 100644 (file)
@@ -50,29 +50,26 @@ Applies to all lines after point."
        (start (mark-index start))
        (anchor (mark-left-inserting-copy start))
        (end (mark-left-inserting-copy end)))
-    (letrec
-       ((loop
-         (lambda (start point)
-           (let ((point
-                  (re-search-buffer-forward pattern syntax-table
-                                            group point (mark-index end))))
-             (if point
-                 (begin
-                   (set-mark-index! anchor point)
-                   (let ((end
-                          (line-start-index group (re-match-start-index 0))))
-                     (if (< start end)
-                         (group-delete! group start end)))
-                   (continue (mark-index anchor)))
-                 (group-delete! group start (mark-index end))))))
-        (continue
-         (lambda (point)
-           (let ((start (line-end-index group point)))
-             (if (< start (mark-index end))
-                 (loop (+ start 1) point))))))
-      (if (line-start-index? group start)
-         (loop start start)
-         (continue start)))
+    (define (loop start point)
+      (let ((point
+            (re-search-buffer-forward pattern syntax-table
+                                      group point (mark-index end))))
+       (if point
+           (begin
+             (set-mark-index! anchor point)
+             (let ((end
+                    (line-start-index group (re-match-start-index 0))))
+               (if (< start end)
+                   (group-delete! group start end)))
+             (continue (mark-index anchor)))
+           (group-delete! group start (mark-index end)))))
+    (define (continue point)
+      (let ((start (line-end-index group point)))
+       (if (< start (mark-index end))
+           (loop (+ start 1) point))))
+    (if (line-start-index? group start)
+       (loop start start)
+       (continue start))
     (mark-temporary! anchor)
     (mark-temporary! end)))
 \f