From 52f8656ee254f1ce8cc987630bb804c6575c9a58 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Thu, 6 Apr 2006 16:25:59 +0000 Subject: [PATCH] Receive key bindings only once from configuration --- scheme/browse-directory-list.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scheme/browse-directory-list.scm b/scheme/browse-directory-list.scm index 9bd9685..c050910 100644 --- a/scheme/browse-directory-list.scm +++ b/scheme/browse-directory-list.scm @@ -253,14 +253,17 @@ (- (result-buffer-num-lines buffer) 1) (result-buffer-num-cols buffer)))) + (define sort-up-key (config 'ls 'sort-up-key)) + (define sort-down-key (config 'ls 'sort-down-key)) + (define (handle-key-press self key) (cond ((= key key-return) (handle-return-key self (select-list-selected-entry select-list) (calculate-number-of-lines buffer))) - ((or (= key (config 'ls 'sort-up-key)) - (= key (config 'ls 'sort-down-key))) + ((or (= key sort-up-key) + (= key sort-down-key)) (let ((column (select-line-selected-entry select-line))) (receive (compare-up compare-down select) (case column @@ -289,7 +292,7 @@ (file-info:mtime (fs-object-info fso))))) (else (error "unknown column" column))) - (let ((compare (if (= key (config 'ls 'sort-up-key)) + (let ((compare (if (= key sort-up-key) compare-up compare-down))) (set-fs-objects!