Remove set! on local variables. They are just ugly.

This commit is contained in:
mainzelm 2005-05-17 20:08:39 +00:00
parent 03f535f0f2
commit cb680b277c
1 changed files with 24 additions and 29 deletions

View File

@ -42,20 +42,18 @@
;;Layout of the directory-tree-browser ;;Layout of the directory-tree-browser
(define layout-result-browse-dir-list (define layout-result-browse-dir-list
(lambda (result-str result width directory) (lambda (result-str result width directory)
(begin (let ((printed-file-list (print-file-list-1 result directory)))
(let ((printed-file-list (print-file-list-1 result directory)) (append
(heading "")) (list
(begin
(if (<= (string-length directory) (- width 25)) (if (<= (string-length directory) (- width 25))
(set! heading (string-append "Paths relative to " (string-append "Paths relative to " directory " :")
directory " :"))
(let ((dir-string (substring directory (let ((dir-string (substring directory
(- (string-length directory) (- (string-length directory)
(- width 25)) (- width 25))
(string-length directory)))) (string-length directory))))
(set! heading (string-append "Paths relative to ..." (string-append "Paths relative to ..."
dir-string)))) dir-string))))
(append (list heading) (list " <-") printed-file-list)))))) printed-file-list))))
;;One File per-line ;;One File per-line
@ -153,18 +151,16 @@
((next-command-message? message) ((next-command-message? message)
(let* ((command (next-command-string message)) (let* ((command (next-command-string message))
(parameters (next-command-message-parameters message)) (parameters (next-command-message-parameters message))
(result #f)
(width (next-command-message-width message))) (width (next-command-message-width message)))
(if (< (length parameters) 2) (if (< (length parameters) 2)
(begin (let* ((result (list "forgot parameters?"))
(set! result (list "forgot parameters?")) (text
(let* ((text
(layout-result-standard "forgot parameters?" (layout-result-standard "forgot parameters?"
result width)) result width))
(browse-obj (browse-obj
(make-browse-dir-list-res-obj 1 1 result text (cwd) (make-browse-dir-list-res-obj 1 1 result text (cwd)
width (cwd) '() '() #f))) width (cwd) '() '() #f)))
browse-obj)) browse-obj)
(let* ((file-list (let* ((file-list
(evaluate (list-ref parameters 0))) (evaluate (list-ref parameters 0)))
@ -205,12 +201,11 @@
(all-items (browse-dir-list-res-obj-file-list model))) (all-items (browse-dir-list-res-obj-file-list model)))
(if (<= actual-pos 2) (if (<= actual-pos 2)
model model
(let ((actual-item (list-ref all-items (- actual-pos 3))) (let* ((actual-item (list-ref all-items (- actual-pos 3)))
(actual-res-item #f)) (actual-res-item
(begin
(if (not (string=? (cwd) "/")) (if (not (string=? (cwd) "/"))
(set! actual-res-item (string-append (cwd) "/" actual-item)) (string-append (cwd) "/" actual-item)
(set! actual-res-item (string-append "/" actual-item))) (string-append "/" actual-item))))
(if (member actual-res-item marked-items) (if (member actual-res-item marked-items)
model model
(let* ((new-res-marked-items (append res-marked-items (let* ((new-res-marked-items (append res-marked-items
@ -233,7 +228,7 @@
new-marked-items new-marked-items
new-res-marked-items new-res-marked-items
#f))) #f)))
new-model))))))) new-model))))))
;; user pressed 'u' --- unmark current entry ;; user pressed 'u' --- unmark current entry
((= key key-u) ((= key key-u)