From 43088dafd778e1ac13f875a87d9ce48d4029064a Mon Sep 17 00:00:00 2001 From: mainzelm Date: Tue, 31 May 2005 13:40:39 +0000 Subject: [PATCH] Constructor arguments instead of init message --- scheme/browse-directory-list.scm | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/scheme/browse-directory-list.scm b/scheme/browse-directory-list.scm index 6e8e4b6..6197851 100644 --- a/scheme/browse-directory-list.scm +++ b/scheme/browse-directory-list.scm @@ -126,27 +126,19 @@ (select-list-handle-key-press select-list key)) instance)))) -(define (make-fsobjects-viewer) - (let ((fs-objects #f) - (buffer #f) - (select-list #f) - (working-dir #f)) +(define (make-fsobjects-viewer fs-objects buffer) + (let* ((fs-objects fs-objects) + (buffer buffer) + (working-dir (find-common-parent + (map fs-object-path fs-objects))) + (select-list + (make-file-select-list fs-objects + working-dir + (result-buffer-num-lines buffer)))) + (lambda (message) (cond - ((eq? message 'init) - (lambda (self new-fs-objects new-buffer) - (let ((num-lines (result-buffer-num-lines new-buffer)) - (parent-dir - (find-common-parent - (map fs-object-path new-fs-objects)))) - (set! buffer new-buffer) - (set! fs-objects new-fs-objects) - (set! working-dir parent-dir) - (set! select-list - (make-file-select-list fs-objects parent-dir num-lines)) - self))) - ((eq? message 'init-browser-for-dir) (lambda (self new-dir new-buffer) (with-cwd new-dir