From cb680b277c7e07caf381c3c1f57b7803582b3b67 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Tue, 17 May 2005 20:08:39 +0000 Subject: [PATCH] Remove set! on local variables. They are just ugly. --- scheme/browse-directory-list.scm | 53 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/scheme/browse-directory-list.scm b/scheme/browse-directory-list.scm index 16c67aa..449c5a6 100644 --- a/scheme/browse-directory-list.scm +++ b/scheme/browse-directory-list.scm @@ -42,20 +42,18 @@ ;;Layout of the directory-tree-browser (define layout-result-browse-dir-list (lambda (result-str result width directory) - (begin - (let ((printed-file-list (print-file-list-1 result directory)) - (heading "")) - (begin - (if (<= (string-length directory) (- width 25)) - (set! heading (string-append "Paths relative to " - directory " :")) - (let ((dir-string (substring directory - (- (string-length directory) - (- width 25)) - (string-length directory)))) - (set! heading (string-append "Paths relative to ..." - dir-string)))) - (append (list heading) (list " <-") printed-file-list)))))) + (let ((printed-file-list (print-file-list-1 result directory))) + (append + (list + (if (<= (string-length directory) (- width 25)) + (string-append "Paths relative to " directory " :") + (let ((dir-string (substring directory + (- (string-length directory) + (- width 25)) + (string-length directory)))) + (string-append "Paths relative to ..." + dir-string)))) + printed-file-list)))) ;;One File per-line @@ -153,18 +151,16 @@ ((next-command-message? message) (let* ((command (next-command-string message)) (parameters (next-command-message-parameters message)) - (result #f) (width (next-command-message-width message))) (if (< (length parameters) 2) - (begin - (set! result (list "forgot parameters?")) - (let* ((text - (layout-result-standard "forgot parameters?" - result width)) - (browse-obj + (let* ((result (list "forgot parameters?")) + (text + (layout-result-standard "forgot parameters?" + result width)) + (browse-obj (make-browse-dir-list-res-obj 1 1 result text (cwd) width (cwd) '() '() #f))) - browse-obj)) + browse-obj) (let* ((file-list (evaluate (list-ref parameters 0))) @@ -205,12 +201,11 @@ (all-items (browse-dir-list-res-obj-file-list model))) (if (<= actual-pos 2) model - (let ((actual-item (list-ref all-items (- actual-pos 3))) - (actual-res-item #f)) - (begin - (if (not (string=? (cwd) "/")) - (set! actual-res-item (string-append (cwd) "/" actual-item)) - (set! actual-res-item (string-append "/" actual-item))) + (let* ((actual-item (list-ref all-items (- actual-pos 3))) + (actual-res-item + (if (not (string=? (cwd) "/")) + (string-append (cwd) "/" actual-item) + (string-append "/" actual-item)))) (if (member actual-res-item marked-items) model (let* ((new-res-marked-items (append res-marked-items @@ -233,7 +228,7 @@ new-marked-items new-res-marked-items #f))) - new-model))))))) + new-model)))))) ;; user pressed 'u' --- unmark current entry ((= key key-u)