From cd2bba7c2d6371b8398a3f0671aa9930ffcb23fd Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 28 Dec 2014 01:05:32 -0500 Subject: [PATCH] Add dump-buffer-to-stderr command --- rmacs/editor.rkt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rmacs/editor.rkt b/rmacs/editor.rkt index e5973c1..60cafe5 100644 --- a/rmacs/editor.rkt +++ b/rmacs/editor.rkt @@ -244,3 +244,21 @@ (define-command kernel-mode (force-redisplay buf) #:bind-key "C-l" (editor-force-redisplay! (buffer-editor buf))) + +(define-command kernel-mode (dump-buffer-to-stderr buf #:window win) + #:bind-key "C-M-x" + (local-require racket/pretty) + (log-info "") + (log-info "--------------------------------------------------------------------------------") + (log-info "--------------------------------------------------------------------------------") + (log-info "========================================================================= WINDOW") + (log-info "id ~v" (window-id win)) + (log-info "top ~v ~v" (window-top win) (buffer-mark-pos* buf (window-top win))) + (log-info "point ~v ~v" (window-point win) (buffer-mark-pos* buf (window-point win))) + (log-info "mark ~v ~v" (window-mark win) (buffer-mark-pos* buf (window-mark win))) + (log-info "title ~v" (buffer-title buf)) + (log-info "rope:") + (pretty-write (buffer-rope buf) (current-error-port)) + (log-info "modeset:") + (pretty-write (buffer-modeset buf) (current-error-port)) + (log-info "--------------------------------------------------------------------------------"))