auto-complete.el で scheme のシンボル補完とかしたいなーとおもって

補完候補を列挙すべく、、、

(defvar ac-source-gauche-file-symbols
  '((candidates
     . (lambda () 
	 (if (= 0 (shell-command "gosh -b" nil))
	     (split-string (shell-command-to-string
			    (format "gosh -b -e'(letrec ((car-of-car (lambda (x) (if (pair? x) (car-of-car (car x)) x)))) (with-input-from-file \"%s\" (lambda () (let loop((sexp (read))) (if (eof-object? sexp) #f (begin (cond ((not (pair? sexp)) #f) ((or (eq? (quote define) (car sexp)) (eq? (quote define-syntax) (car sexp)) (eq? (quote define-macro) (car sexp)) (eq? (quote define-class) (car sexp))) (print (car-of-car (cadr sexp))))) (loop (read))))))))'" (buffer-file-name))) "\n"))))))

これはひどい

Schemeの場合"<"とか"?"が拾われなくてかなしー感じなんだけど、ac-find-function とシンボルの列挙はどうやるのがスマートなんだろう。しばらく前にgaucheのMLで話題になったschemeの補完してくれるelispでも眺めてみようかしら。