From: Taylor R Campbell Date: Sun, 10 Feb 2019 22:39:41 +0000 (+0000) Subject: Convert multi-LETREC to internal definitions in edwin/occur.scm. X-Git-Tag: mit-scheme-pucked-10.1.10~6^2~7^2~5 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=330916480d6a64566c89d5568869cd1f8cd0f3cd;p=mit-scheme.git Convert multi-LETREC to internal definitions in edwin/occur.scm. --- diff --git a/src/edwin/occur.scm b/src/edwin/occur.scm index 8039c686e..ac9205db9 100644 --- a/src/edwin/occur.scm +++ b/src/edwin/occur.scm @@ -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)))