|
|
@ -4,7 +4,6 @@
|
|
|
|
racket/class
|
|
|
|
racket/class
|
|
|
|
racket/string
|
|
|
|
racket/string
|
|
|
|
racket/runtime-path
|
|
|
|
racket/runtime-path
|
|
|
|
racket/match
|
|
|
|
|
|
|
|
setup/getinfo
|
|
|
|
setup/getinfo
|
|
|
|
sugar/file
|
|
|
|
sugar/file
|
|
|
|
(for-syntax racket/base)
|
|
|
|
(for-syntax racket/base)
|
|
|
@ -19,14 +18,15 @@
|
|
|
|
((if (syntax? source-name) syntax-source values) source-name))
|
|
|
|
((if (syntax? source-name) syntax-source values) source-name))
|
|
|
|
|
|
|
|
|
|
|
|
(define (infer-parser-mode reader-mode reader-here-path)
|
|
|
|
(define (infer-parser-mode reader-mode reader-here-path)
|
|
|
|
(match reader-mode
|
|
|
|
(cond
|
|
|
|
[(== default-mode-auto eq?)
|
|
|
|
[(eq? reader-mode default-mode-auto)
|
|
|
|
(match (cond [(get-ext reader-here-path) => string->symbol])
|
|
|
|
(let ([val (cond [(get-ext reader-here-path) => string->symbol])])
|
|
|
|
[(== (setup:pagetree-source-ext) eq?) default-mode-pagetree]
|
|
|
|
(cond
|
|
|
|
[(== (setup:markup-source-ext) eq?) default-mode-markup]
|
|
|
|
[(eq? val (setup:pagetree-source-ext)) default-mode-pagetree]
|
|
|
|
[(== (setup:markdown-source-ext) eq?) default-mode-markdown]
|
|
|
|
[(eq? val (setup:markup-source-ext)) default-mode-markup]
|
|
|
|
[_ default-mode-preproc])]
|
|
|
|
[(eq? val (setup:markdown-source-ext)) default-mode-markdown]
|
|
|
|
[_ reader-mode]))
|
|
|
|
[else default-mode-preproc]))]
|
|
|
|
|
|
|
|
[else reader-mode]))
|
|
|
|
|
|
|
|
|
|
|
|
(define (custom-read p) (syntax->datum (custom-read-syntax (object-name p) p)))
|
|
|
|
(define (custom-read p) (syntax->datum (custom-read-syntax (object-name p) p)))
|
|
|
|
|
|
|
|
|
|
|
@ -88,12 +88,16 @@
|
|
|
|
(hash-ref! command-char-cache maybe-source-path (λ () (setup:command-char maybe-source-path))))
|
|
|
|
(hash-ref! command-char-cache maybe-source-path (λ () (setup:command-char maybe-source-path))))
|
|
|
|
(case key
|
|
|
|
(case key
|
|
|
|
[(color-lexer)
|
|
|
|
[(color-lexer)
|
|
|
|
(match (dynamic-require 'syntax-color/scribble-lexer 'make-scribble-inside-lexer (λ () #false))
|
|
|
|
(define maybe-lexer
|
|
|
|
[(? procedure? make-lexer) (make-lexer #:command-char my-command-char)]
|
|
|
|
(dynamic-require 'syntax-color/scribble-lexer 'make-scribble-inside-lexer (λ () #false)))
|
|
|
|
[_ default])]
|
|
|
|
(cond
|
|
|
|
|
|
|
|
[(procedure? maybe-lexer) (maybe-lexer #:command-char my-command-char)]
|
|
|
|
|
|
|
|
[else default])]
|
|
|
|
[(drracket:toolbar-buttons)
|
|
|
|
[(drracket:toolbar-buttons)
|
|
|
|
(match (dynamic-require 'pollen/private/drracket-buttons 'make-drracket-buttons (λ () #false))
|
|
|
|
(define maybe-button-maker
|
|
|
|
[(? procedure? make-buttons) (make-buttons my-command-char)])])]
|
|
|
|
(dynamic-require 'pollen/private/drracket-buttons 'make-drracket-buttons (λ () #false)))
|
|
|
|
|
|
|
|
(when (procedure? maybe-button-maker)
|
|
|
|
|
|
|
|
(maybe-button-maker my-command-char))])]
|
|
|
|
[(drracket:indentation)
|
|
|
|
[(drracket:indentation)
|
|
|
|
(λ (text pos)
|
|
|
|
(λ (text pos)
|
|
|
|
(define line-idx (send text position-line pos))
|
|
|
|
(define line-idx (send text position-line pos))
|
|
|
@ -114,12 +118,12 @@
|
|
|
|
(list (list "Pollen sources" (string-join filter-strings ";")))]
|
|
|
|
(list (list "Pollen sources" (string-join filter-strings ";")))]
|
|
|
|
[(drracket:default-extension)
|
|
|
|
[(drracket:default-extension)
|
|
|
|
(symbol->string
|
|
|
|
(symbol->string
|
|
|
|
(match mode
|
|
|
|
(cond
|
|
|
|
[(== default-mode-auto eq?) (setup:preproc-source-ext)]
|
|
|
|
[(eq? mode default-mode-auto) (setup:preproc-source-ext)]
|
|
|
|
[(== default-mode-preproc eq?) (setup:preproc-source-ext)]
|
|
|
|
[(eq? mode default-mode-preproc) (setup:preproc-source-ext)]
|
|
|
|
[(== default-mode-markdown eq?) (setup:markdown-source-ext)]
|
|
|
|
[(eq? mode default-mode-markdown) (setup:markdown-source-ext)]
|
|
|
|
[(== default-mode-markup eq?) (setup:markup-source-ext)]
|
|
|
|
[(eq? mode default-mode-markup) (setup:markup-source-ext)]
|
|
|
|
[(== default-mode-pagetree eq?) (setup:pagetree-source-ext)]))]
|
|
|
|
[(eq? mode default-mode-pagetree) (setup:pagetree-source-ext)]))]
|
|
|
|
[else default])))
|
|
|
|
[else default])))
|
|
|
|
|
|
|
|
|
|
|
|
(define-syntax-rule (reader-module-begin mode . _)
|
|
|
|
(define-syntax-rule (reader-module-begin mode . _)
|
|
|
|