From 3b140722a43c6faa8051cf9bce01940337ce90da Mon Sep 17 00:00:00 2001 From: eknauel Date: Sat, 20 Aug 2005 16:09:48 +0000 Subject: [PATCH] fix completion, don't insert absolute file names. --- scheme/complete-util.scm | 15 ++++++--------- scheme/nuit-packages.scm | 1 - scheme/std-command.scm | 7 +++---- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/scheme/complete-util.scm b/scheme/complete-util.scm index 4217d78..b2d3305 100644 --- a/scheme/complete-util.scm +++ b/scheme/complete-util.scm @@ -67,20 +67,17 @@ file)))))) partial-name)) -(define (complete-files/path partial-name) - (debug-message "complete-files/path " partial-name) - (complete-with-filesystem-objects - (lambda (file) file) partial-name)) - ;; completion functions for arguments and redirection (define (find-completions-for-arg cmd to-complete) (debug-message "find-completions-for-arg " cmd "," to-complete) (let ((prefix (to-complete-prefix to-complete))) - (if prefix - (complete-files/path (expand-file-name prefix (cwd))) - (complete-files/path "")))) + (complete-with-filesystem-objects + (if prefix + (lambda (file) + (and (string-prefix? prefix file) file)) + (lambda (file) file)) + (or (to-complete-prefix to-complete) (cwd))))) ;; #### no special treatment yet (define find-completions-for-redir find-completions-for-arg) - diff --git a/scheme/nuit-packages.scm b/scheme/nuit-packages.scm index 420b8e3..63b8904 100644 --- a/scheme/nuit-packages.scm +++ b/scheme/nuit-packages.scm @@ -476,7 +476,6 @@ complete-with-filesystem-objects make-completer-for-file-with-extension complete-executables/path - complete-files/path find-completions-for-arg find-completions-for-redir)) diff --git a/scheme/std-command.scm b/scheme/std-command.scm index ce7e2ab..3594a32 100644 --- a/scheme/std-command.scm +++ b/scheme/std-command.scm @@ -111,11 +111,11 @@ (define just-run-in-foreground (lambda (command args) - (run/fg (,command ,@args)))) + (run/fg* `(exec-epf (,command ,@args))))) (define just-run-in-background (lambda (command args) - (run/bg (,command ,@args)))) + (run/bg* `(exec-epf (,command ,@args))))) ;; Parse options for ls command using args-fold (SRFI 37) ;; We don't care for options that format the output. @@ -284,6 +284,5 @@ (lambda (command to-complete) (debug-message "ftp completer " command "," to-complete) (completions-for cs (or (to-complete-prefix to-complete) "")))) - (lambda (command args) - (run/fg (,command ,@args))))) + just-run-in-foreground))