From d51eb491391b922bca8750ad4c39a982cea77c70 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Tue, 11 Oct 2005 15:45:00 +0000 Subject: [PATCH] optimize compeltion for jobs, complete printenv from environ part of darcs patch Sat Sep 24 22:46:24 MST 2005 Martin Gasbichler --- scheme/std-command.scm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scheme/std-command.scm b/scheme/std-command.scm index 2cddec8..7064240 100644 --- a/scheme/std-command.scm +++ b/scheme/std-command.scm @@ -247,7 +247,11 @@ (register-plugin! (make-command-plugin "printenv" - no-completer + (lambda (command to-complete) + (completions-for + (make-completion-set + (map car (env->alist))) + (or (to-complete-prefix to-complete) ""))) (lambda (command args) (case (length args) ((0) (printenv)) @@ -268,13 +272,16 @@ 0 (string->number (car args))))))) +(define jobs-completion-set + (make-completion-set + '("running" "ready" "stopped" + "output" "waiting-for-input"))) + (register-plugin! (make-command-plugin "jobs" (lambda (command to-complete) - (completions-for - (make-completion-set - '("running" "ready" "stopped" - "output" "waiting-for-input")) + (completions-for + jobs-completion-set (or (to-complete-prefix to-complete) ""))) (lambda (command args) (let ((selectors