Maintain a completion-set for registered command-plugins
This commit is contained in:
+11
-2
@@ -2,12 +2,18 @@
|
||||
|
||||
(define *view-plugins* '())
|
||||
|
||||
(define *command-completions*
|
||||
(make-empty-completion-set))
|
||||
|
||||
(define (command-plugin-list)
|
||||
*command-plugins*)
|
||||
|
||||
(define (view-plugin-list)
|
||||
*view-plugins*)
|
||||
|
||||
(define (command-completions)
|
||||
*command-completions*)
|
||||
|
||||
(define-record-type view-plugin :view-plugin
|
||||
(make-view-plugin fun type-predicate)
|
||||
view-plugin?
|
||||
@@ -24,7 +30,10 @@
|
||||
(define (register-plugin! plugin)
|
||||
(cond
|
||||
((command-plugin? plugin)
|
||||
(set! *command-plugins* (cons plugin *command-plugins*)))
|
||||
(set! *command-plugins* (cons plugin *command-plugins*))
|
||||
(set! *command-completions*
|
||||
(adjoin-completion-set *command-completions*
|
||||
(command-plugin-command plugin))))
|
||||
((view-plugin? plugin)
|
||||
(set! *view-plugins* (cons plugin *view-plugins*)))
|
||||
(error "unknown plugin type" plugin)))
|
||||
@@ -96,7 +105,7 @@
|
||||
((restore-message? message)
|
||||
restore-message-result-object)
|
||||
((selection-message? message)
|
||||
selection-message-result-object message)
|
||||
selection-message-result-object)
|
||||
(else
|
||||
(error "This message-type has no field for result-objects"
|
||||
message)))
|
||||
|
||||
Reference in New Issue
Block a user