From 0c3091632f80c5114c5076023ba8671f1e2fff26 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 10 Sep 2024 17:53:15 +0100 Subject: [PATCH] add importable trace macro --- buffer.fnl | 1 + keymap.fnl | 1 + macros.fnl | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100644 macros.fnl diff --git a/buffer.fnl b/buffer.fnl index fb4440f..ea5e8ec 100644 --- a/buffer.fnl +++ b/buffer.fnl @@ -1,5 +1,6 @@ (local { : Gtk : Gdk : WebKit2 : cairo } (require :lgi)) (local { : view } (require :fennel)) +(import-macros {: trace} :macros) (fn new-buffer [name] (var property-change-listener nil) diff --git a/keymap.fnl b/keymap.fnl index 08f56c7..dd0f8e7 100644 --- a/keymap.fnl +++ b/keymap.fnl @@ -1,6 +1,7 @@ (local { : Gdk } (require :lgi)) (local { : view } (require :fennel)) (local lume (require :lume)) +(import-macros {: trace} :macros) (local modifier-keyvals ;; we need to detect and discard modifier-only key events when diff --git a/macros.fnl b/macros.fnl new file mode 100644 index 0000000..2d8c349 --- /dev/null +++ b/macros.fnl @@ -0,0 +1,7 @@ + +(fn trace [x] + `(do + (print :trace ,(view x) (view ,x)) + ,x)) + +{ : trace }