fix `select-list-get-selection' and avoid copying the list in `elements'

This commit is contained in:
eknauel 2005-05-28 12:07:21 +00:00
parent 4e5a41db3d
commit 9b72181b54
1 changed files with 4 additions and 17 deletions

View File

@ -31,9 +31,7 @@
(num-lines ,(select-list-num-lines r)))))
(define (make-select-list elements num-lines)
(if (and (proper-list? elements) (every element? elements))
(really-make-select-list elements 0 0 num-lines)
(error "wrong argument type" elements)))
(really-make-select-list elements 0 0 num-lines))
(define key-m 109)
@ -102,17 +100,6 @@
(else
(values (index-move cursor-index) view-index)))))
(define (copy-element-list elements)
(fold-right
(lambda (el result)
(cons
(make-element (element-markable? el)
(element-marked? el)
(element-value el)
(element-text el))
result))
'() elements))
(define (move-cursor-maker index-move)
(lambda (select-list)
(let* ((elements (select-list-elements select-list))
@ -127,7 +114,7 @@
num-lines))
(lambda (cursor-index view-index)
(really-make-select-list
(copy-element-list elements)
elements
view-index
cursor-index
num-lines))))))
@ -177,7 +164,7 @@
(define (select-list-get-selection select-list)
(map element-value
(filter-map element-marked?
(filter element-marked?
(select-list-elements select-list))))
(define (select-list-selected-entry select-list)