2005-05-23 08:47:41 -04:00
|
|
|
(define *command-plugins* '())
|
2005-05-22 11:05:25 -04:00
|
|
|
|
2005-05-23 08:47:41 -04:00
|
|
|
(define *view-plugins* '())
|
2005-05-22 11:05:25 -04:00
|
|
|
|
2005-05-28 08:06:13 -04:00
|
|
|
(define *command-completions*
|
|
|
|
(make-empty-completion-set))
|
|
|
|
|
2005-05-23 08:47:41 -04:00
|
|
|
(define (command-plugin-list)
|
|
|
|
*command-plugins*)
|
2005-05-22 11:05:25 -04:00
|
|
|
|
2005-05-23 08:47:41 -04:00
|
|
|
(define (view-plugin-list)
|
|
|
|
*view-plugins*)
|
2005-05-22 11:05:25 -04:00
|
|
|
|
2005-05-28 08:06:13 -04:00
|
|
|
(define (command-completions)
|
|
|
|
*command-completions*)
|
|
|
|
|
2005-05-23 08:47:41 -04:00
|
|
|
(define-record-type view-plugin :view-plugin
|
2005-05-30 15:19:36 -04:00
|
|
|
(make-view-plugin constructor type-predicate)
|
2005-05-23 08:47:41 -04:00
|
|
|
view-plugin?
|
2005-05-30 15:19:36 -04:00
|
|
|
(constructor view-plugin-constructor)
|
2005-05-23 08:47:41 -04:00
|
|
|
(type-predicate view-plugin-type-predicate))
|
|
|
|
|
|
|
|
(define-record-type command-plugin :command-plugin
|
|
|
|
(make-command-plugin command completer evaluater)
|
|
|
|
command-plugin?
|
|
|
|
(command command-plugin-command)
|
|
|
|
(completer command-plugin-completer)
|
|
|
|
(evaluater command-plugin-evaluater))
|
2005-05-22 11:05:25 -04:00
|
|
|
|
|
|
|
(define (register-plugin! plugin)
|
2005-05-23 08:47:41 -04:00
|
|
|
(cond
|
|
|
|
((command-plugin? plugin)
|
2005-05-28 08:06:13 -04:00
|
|
|
(set! *command-plugins* (cons plugin *command-plugins*))
|
|
|
|
(set! *command-completions*
|
|
|
|
(adjoin-completion-set *command-completions*
|
|
|
|
(command-plugin-command plugin))))
|
2005-05-23 08:47:41 -04:00
|
|
|
((view-plugin? plugin)
|
|
|
|
(set! *view-plugins* (cons plugin *view-plugins*)))
|
|
|
|
(error "unknown plugin type" plugin)))
|
2005-05-22 11:05:25 -04:00
|
|
|
|