svn: r16283
This commit is contained in:
parent
7dbd784048
commit
f86e4e542c
|
@ -29,10 +29,9 @@
|
||||||
[sexp (and (file-exists? path)
|
[sexp (and (file-exists? path)
|
||||||
(parameterize ([read-accept-reader #t])
|
(parameterize ([read-accept-reader #t])
|
||||||
(call-with-input-file path read)))])
|
(call-with-input-file path read)))])
|
||||||
|
(printf "sexp ~s\n" sexp)
|
||||||
(match sexp
|
(match sexp
|
||||||
[`(module ,name ,(or `(lib "keybinding-lang.ss" "framework")
|
[`(module ,name ,(? valid-key-bindings-lang?)
|
||||||
`(lib "framework/keybinding-lang.ss")
|
|
||||||
`framework/keybinding-lang)
|
|
||||||
,@(x ...))
|
,@(x ...))
|
||||||
(let ([km (dynamic-require spec '#%keymap)])
|
(let ([km (dynamic-require spec '#%keymap)])
|
||||||
(hash-set! user-keybindings-files spec km)
|
(hash-set! user-keybindings-files spec km)
|
||||||
|
@ -41,6 +40,15 @@
|
||||||
(string-constant user-defined-keybinding-malformed-file)
|
(string-constant user-defined-keybinding-malformed-file)
|
||||||
(path->string path))])))))
|
(path->string path))])))))
|
||||||
|
|
||||||
|
(define (valid-keybindings-lang? x)
|
||||||
|
(let ([valid-langs
|
||||||
|
(list `(lib "keybinding-lang.ss" "framework")
|
||||||
|
`(lib "framework/keybinding-lang.ss")
|
||||||
|
`framework/keybinding-lang)])
|
||||||
|
(cond
|
||||||
|
[(syntax? x) (member (syntax->datum x) valid-langs)]
|
||||||
|
[else (member x valid-langs)])))
|
||||||
|
|
||||||
(define (spec->path p)
|
(define (spec->path p)
|
||||||
(cond
|
(cond
|
||||||
[(path? p) p]
|
[(path? p) p]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user