From d670a18edde414d39dbc3109f2f247e01c3f41fd Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 29 Dec 2014 18:36:57 -0500 Subject: [PATCH] More context when dumping internal structures --- rmacs/editor.rkt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rmacs/editor.rkt b/rmacs/editor.rkt index 59b9b20..6467726 100644 --- a/rmacs/editor.rkt +++ b/rmacs/editor.rkt @@ -371,7 +371,7 @@ #:bind-key "C-g" (abort "Quit")) -(define-command kernel-mode (dump-buffer-to-stderr buf #:window win) +(define-command kernel-mode (dump-buffer-to-stderr buf #:window win #:editor ed) #:bind-key "C-M-x" (local-require racket/pretty) (log-info "") @@ -387,4 +387,18 @@ (pretty-write (buffer-rope buf) (current-error-port)) (log-info "modeset:") (pretty-write (buffer-modeset buf) (current-error-port)) + (let ((t (editor-tty ed))) + (log-info "terminal width ~v height ~v cursor-row ~v -col ~v" + (tty-columns t) (tty-rows t) (tty-cursor-row t) (tty-cursor-column t))) + (log-info "editor layout:") + (cond [(editor-layout ed) => + (lambda (layouts) + (for ((l layouts)) + (match-define (layout w s tt ll ww hh) l) + (log-info " - ~a ~v top ~a left ~a width ~a height ~a" + (window-id w) s tt ll ww hh)))] + [else (log-info " - not cached")]) + (log-info "editor size-specs: ~v" + (for/list ((e (circular-list->list (editor-windows ed)))) + (list (window-id (car e)) (cadr e)))) (log-info "--------------------------------------------------------------------------------"))