racket-ansi/rmacs/main.rkt

37 lines
1.3 KiB
Racket
Raw Normal View History

2014-12-20 23:09:40 +00:00
#lang racket/base
(provide rmacs)
2014-12-20 23:09:40 +00:00
(require racket/match)
2014-12-23 06:43:01 +00:00
(require "editor.rkt")
(require "buffer.rkt")
2014-12-23 16:09:22 +00:00
(require "mode.rkt")
2014-12-23 06:43:01 +00:00
(require "mode/fundamental.rkt")
(define (rmacs #:initial-files [initial-files '()])
2014-12-23 16:09:22 +00:00
(define e (make-editor #:default-modeset (modeset-add-mode kernel-modeset
fundamental-mode)))
(for ((file initial-files)) (visit-file! e file))
2014-12-23 06:43:01 +00:00
(editor-mainloop e))
2014-12-20 23:09:40 +00:00
(module+ main
2014-12-26 23:57:01 +00:00
(require racket/trace)
2014-12-24 03:01:18 +00:00
(current-trace-notify (lambda (s) (log-info "TRACE: ~a" s)))
(void
2014-12-27 23:18:55 +00:00
(rmacs #:initial-files (match (current-command-line-arguments)
['#()
(list
(build-path (collection-file-path "main.rkt" "rmacs")
'up 'up "doc" "xterm_controls.txt"))]
[(vector files ...)
files])))
2014-12-26 23:57:01 +00:00
;; (require profile)
;; (require ansi)
;; (void (profile-thunk (lambda () (begin0 (main)
;; (tty-restore!)
;; (display (select-graphic-rendition style-normal))
;; (display (clear-screen))
;; (flush-output)))))
)