From cbf39ba61ec8aca2c1fa8f0a9f5a23f4cdc44097 Mon Sep 17 00:00:00 2001 From: eknauel Date: Wed, 25 May 2005 11:43:46 +0000 Subject: [PATCH] make selection-list distinguish markable and unmarkable items --- scheme/process.scm | 5 ++++- scheme/select-list.scm | 25 +++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/scheme/process.scm b/scheme/process.scm index cf404a6..91c0f5c 100644 --- a/scheme/process.scm +++ b/scheme/process.scm @@ -35,7 +35,10 @@ (define (make-process-selection-list num-cols num-lines processes) (let ((layout (lambda (p) (layout-process num-cols p)))) (make-select-list - (zip processes (map layout processes)) + (zip + processes + (map (lambda (p) #t) processes) + (map layout processes)) num-lines))) (define (pps-receiver message) diff --git a/scheme/select-list.scm b/scheme/select-list.scm index aca24aa..0bc9d03 100644 --- a/scheme/select-list.scm +++ b/scheme/select-list.scm @@ -1,7 +1,8 @@ (define-record-type element :element - (make-element marked? value text) + (make-element markable? marked? value text) element? - (marked? element-marked? set-element-marked?!) + (markable? element-markable?) + (marked? element-marked?) (value element-value) (text element-text)) @@ -9,8 +10,8 @@ (lambda (r) `(element ,(element-marked? r) ,(element-text r)))) -(define (make-unmarked-element value text) - (make-element #f value text)) +(define (make-unmarked-element markable? value text) + (make-element markable? #f value text)) (define-record-type select-list :select-list (really-make-select-list elements view-index cursor-index num-lines) @@ -26,11 +27,11 @@ (view-index ,(select-list-view-index r)) (num-lines ,(select-list-num-lines r))))) -(define (make-select-list value/text-tuples num-lines) +(define (make-select-list value/markable/text-tuples num-lines) (really-make-select-list - (map (lambda (value/text) - (apply make-unmarked-element value/text)) - value/text-tuples) + (map (lambda (value/markable/text) + (apply make-unmarked-element value/markable/text)) + value/markable/text-tuples) 0 0 num-lines)) (define key-m 109) @@ -62,7 +63,10 @@ (let ((el (car element.i)) (i (cadr element.i))) (cons (make-element - (if (= index i) mark (element-marked? el)) + (if (and (element-markable? el) + (= index i)) + mark + (element-marked? el)) (element-value el) (element-text el)) result))) @@ -100,7 +104,8 @@ (fold-right (lambda (el result) (cons - (make-element (element-marked? el) + (make-element (element-markable? el) + (element-marked? el) (element-value el) (element-text el)) result))