optimize compeltion for jobs, complete printenv from environ

part of darcs patch Sat Sep 24 22:46:24 MST 2005  Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
This commit is contained in:
mainzelm 2005-10-11 15:45:00 +00:00
parent bd803d5168
commit d51eb49139
1 changed files with 12 additions and 5 deletions

View File

@ -247,7 +247,11 @@
(register-plugin! (register-plugin!
(make-command-plugin "printenv" (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) (lambda (command args)
(case (length args) (case (length args)
((0) (printenv)) ((0) (printenv))
@ -268,13 +272,16 @@
0 0
(string->number (car args))))))) (string->number (car args)))))))
(define jobs-completion-set
(make-completion-set
'("running" "ready" "stopped"
"output" "waiting-for-input")))
(register-plugin! (register-plugin!
(make-command-plugin "jobs" (make-command-plugin "jobs"
(lambda (command to-complete) (lambda (command to-complete)
(completions-for (completions-for
(make-completion-set jobs-completion-set
'("running" "ready" "stopped"
"output" "waiting-for-input"))
(or (to-complete-prefix to-complete) ""))) (or (to-complete-prefix to-complete) "")))
(lambda (command args) (lambda (command args)
(let ((selectors (let ((selectors