various cosmetic tidying

pull/9/head
Matthew Butterick 11 years ago
parent c907cf8083
commit 8e8d13f131

@ -43,7 +43,4 @@
(> (file-or-directory-modify-seconds path) (hash-ref (cache-ref path) 'mod-time))) (> (file-or-directory-modify-seconds path) (hash-ref (cache-ref path) 'mod-time)))
(cache path)) (cache path))
(hash-ref (cache-ref path) key)) (hash-ref (cache-ref path) key))

@ -75,4 +75,4 @@
(make-message-logger-functions debug) (make-message-logger-functions debug)
(define+provide (message . items) (define+provide (message . items)
(displayln (string-join `(,@(map (λ(x)(if (string? x) x (format "~v" x))) items))))) (displayln (string-join `(,@(map (λ(x)(if (string? x) x (format "~v" x))) items)))))

@ -76,4 +76,4 @@
#'(check-pre-part e (vector 'src 'line 'col 'pos 'span))))])) #'(check-pre-part e (vector 'src 'line 'col 'pos 'span))))]))
(define (check-pre-part v s) (define (check-pre-part v s)
v) v)

@ -111,6 +111,7 @@
(coerce/symbol? . -> . (listof complete-path?)) (coerce/symbol? . -> . (listof complete-path?))
(map ->complete-path (filter (λ(i) (has-ext? i ext)) (directory-list (world:current-project-root))))) (map ->complete-path (filter (λ(i) (has-ext? i ext)) (directory-list (world:current-project-root)))))
(define+provide (racket-source? x) (define+provide (racket-source? x)
(->boolean (and (pathish? x) (has-ext? (->path x) 'rkt)))) (->boolean (and (pathish? x) (has-ext? (->path x) 'rkt))))
@ -119,10 +120,12 @@
(define (unsaved-source? path-string) (define (unsaved-source? path-string)
((substring (->string path-string) 0 7) . equal? . "unsaved")) ((substring (->string path-string) 0 7) . equal? . "unsaved"))
(define+provide (magic-directory? path) (define+provide (magic-directory? path)
(and (directory-exists? path) (and (directory-exists? path)
(or (ends-with? (path->string path) "compiled")))) (or (ends-with? (path->string path) "compiled"))))
(define+provide (pollen-related-file? file) (define+provide (pollen-related-file? file)
(ormap (λ(proc) (proc file)) (list (ormap (λ(proc) (proc file)) (list
preproc-source? preproc-source?

@ -113,4 +113,4 @@
(module+ main (module+ main
(if (or (equal? parser-mode world:mode-preproc) (equal? parser-mode world:mode-template)) (if (or (equal? parser-mode world:mode-preproc) (equal? parser-mode world:mode-template))
(display doc) (display doc)
(print doc)))))]))))])) (print doc)))))]))))]))

@ -4,4 +4,5 @@
(module reader racket/base (module reader racket/base
(require pollen/reader-base) (require pollen/reader-base)
(define+provide-reader-in-mode world:mode-auto)) ; because default mode in file is auto ;; because default mode in file is auto
(define+provide-reader-in-mode world:mode-auto))

@ -1,5 +1,6 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-module-begin-in-mode world:mode-markdown) (define+provide-module-begin-in-mode world:mode-markdown)
(module reader racket/base (module reader racket/base

@ -1,5 +1,6 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-module-begin-in-mode world:mode-markup) (define+provide-module-begin-in-mode world:mode-markup)
(module reader racket/base (module reader racket/base

@ -136,4 +136,4 @@
(define+provide/contract (in-pagetree? pnish [pt (current-pagetree)]) (define+provide/contract (in-pagetree? pnish [pt (current-pagetree)])
(((or/c #f pagenodeish?)) (pagetree?) . ->* . boolean?) (((or/c #f pagenodeish?)) (pagetree?) . ->* . boolean?)
(->boolean (and pnish (member pnish (pagetree->list pt))))) (->boolean (and pnish (member pnish (pagetree->list pt)))))

@ -1,5 +1,6 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-module-begin-in-mode world:mode-preproc) (define+provide-module-begin-in-mode world:mode-preproc)
(module reader racket/base (module reader racket/base

@ -25,4 +25,4 @@
(define+provide (require-project-require-files here-path) (define+provide (require-project-require-files here-path)
(require+provide-project-require-files here-path #:provide #f)) (require+provide-project-require-files here-path #:provide #f))

@ -1,5 +1,6 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-module-begin-in-mode world:mode-pagetree) (define+provide-module-begin-in-mode world:mode-pagetree)
(module reader racket/base (module reader racket/base

@ -3,6 +3,7 @@
(provide define+provide-reader-in-mode (all-from-out pollen/world)) (provide define+provide-reader-in-mode (all-from-out pollen/world))
(define (make-custom-read custom-read-syntax-proc) (define (make-custom-read custom-read-syntax-proc)
(λ(p) (λ(p)
(syntax->datum (syntax->datum

@ -90,6 +90,7 @@ a:active {
text-decoration: underline; text-decoration: underline;
} }
tt { tt {
font-family: "Source Code Pro"; font-family: "Source Code Pro";
font-size: 100%; font-size: 100%;

@ -233,4 +233,4 @@
(complete-path? . -> . xexpr?) (complete-path? . -> . xexpr?)
(format-as-code (~v (file->xexpr path)))) (format-as-code (~v (file->xexpr path))))
(define route-xexpr (route-wrapper xexpr)) (define route-xexpr (route-wrapper xexpr))

@ -12,7 +12,6 @@
(provide start-server) (provide start-server)
(define (start-server) (define (start-server)
(define-values (pollen-servlet _) (define-values (pollen-servlet _)
(dispatch-rules (dispatch-rules
[((string-arg) ... (? pagetree-source?)) route-dashboard] [((string-arg) ... (? pagetree-source?)) route-dashboard]

@ -26,6 +26,4 @@
`(,id ,@(if (equal? attrs null) null (list (reverse attrs))) ,@body))) `(,id ,@(if (equal? attrs null) null (list (reverse attrs))) ,@body)))
(apply compose1 (map make-one-tag ids))) (apply compose1 (map make-one-tag ids)))

@ -84,5 +84,4 @@
#'(if condition (string-append* #'(if condition (string-append*
(with-handlers ([exn:fail? (λ(exn) (error (format "within when/block, ~a" (exn-message exn))))]) (with-handlers ([exn:fail? (λ(exn) (error (format "within when/block, ~a" (exn-message exn))))])
(map ->string (list body ...)))) (map ->string (list body ...))))
"")])) "")]))

@ -1,5 +1,6 @@
#lang racket/base #lang racket/base
(require pollen/main-base) (require pollen/main-base)
(define+provide-module-begin-in-mode world:mode-template) (define+provide-module-begin-in-mode world:mode-template)
(module reader racket/base (module reader racket/base

@ -23,4 +23,4 @@
[(_ x) [(_ x)
(if (identifier-binding #'x ) (if (identifier-binding #'x )
#'x #'x
#'(#%top . x))])) #'(#%top . x))]))
Loading…
Cancel
Save