You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beautiful-racket/beautiful-racket-lib/br/get-info.rkt

23 lines
1.1 KiB
Racket

#lang racket
8 years ago
(require racket/class)
(provide (all-defined-out))
(define (indenter t pos)
8 years ago
(with-handlers ([exn:fail? (λ (exn) #f)]) ; this function won't work until gui-lib 1.26
(send t compute-racket-amount-to-indent pos (λ(x)
(case x
8 years ago
[("with-pattern"
"with-shared-id"
"pattern-case"
"pattern-case-filter") 'lambda]
8 years ago
[("define-macro"
"define-macro-cases"
"define-cases"
"while"
"until") 'define]
[else #f])))))
(define (br-get-info key default default-filter)
(case key
[(drracket:indentation) indenter]
8 years ago
[else (default-filter key default)]))