Add Qt executable and run-qt target - runtime issues remain

ober

226705d19f92f755c01e5c47ac557bcda5308d85

diff --git a/Makefile b/Makefile
index d00fde6..ec315c3 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,9 @@ rebuild:
 run: build
 	$(SCHEME) $(LIBDIRS) --script main.ss
 
+run-qt: build
+	$(SCHEME) $(LIBDIRS) --script qt-main.ss
+
 # Qt backend build target
 build-qt: build
 	@echo "╔════════════════════════════════════════════════════════════════╗"
diff --git a/lib/jerboa-emacs/qt/sci-shim.sls b/lib/jerboa-emacs/qt/sci-shim.sls
index 9090990..2f6c6b0 100644
--- a/lib/jerboa-emacs/qt/sci-shim.sls
+++ b/lib/jerboa-emacs/qt/sci-shim.sls
@@ -59,7 +59,6 @@
     (jerboa-emacs core) (chez-scintilla constants)
     (chez-scintilla scintilla) (chez-qt qt) (std sugar)
     (jerboa core) (jerboa runtime))
-  (def SCI_REPLACESEL 2170)
   (def (sci-send sci msg (wparam 0) (lparam 0))
        (qt-scintilla-send-message sci msg wparam lparam))
   (def (sci-send/string sci msg str (wparam 0))
diff --git a/qt-main.ss b/qt-main.ss
new file mode 100755
index 0000000..9cb7eae
--- /dev/null
+++ b/qt-main.ss
@@ -0,0 +1,23 @@
+#!/usr/bin/env scheme-script
+#!chezscheme
+;;; qt-main.ss — Qt executable entry point for jerboa-emacs
+
+(import (except (chezscheme) make-hash-table hash-table? iota 1+ 1-
+                getenv path-extension path-absolute? thread?
+                make-mutex mutex? mutex-name)
+        (jerboa core)
+        (std sugar)
+        (jerboa-emacs core)
+        (jerboa-emacs qt/app)
+        (jerboa-emacs qt/main))
+
+;;; Entry point
+(define (main args)
+  (displayln "Starting jerboa-emacs Qt...")
+  (let ((exit-code (qt-main args)))
+    (displayln (string-append "jerboa-emacs Qt exited with code: " 
+                              (number->string exit-code)))
+    exit-code))
+
+;;; Run
+(exit (main (command-line)))
diff --git a/src/jerboa-emacs/qt/sci-shim.ss b/src/jerboa-emacs/qt/sci-shim.ss
index f476d95..8a35d48 100644
--- a/src/jerboa-emacs/qt/sci-shim.ss
+++ b/src/jerboa-emacs/qt/sci-shim.ss
@@ -50,7 +50,6 @@
   :std/sugar)
 
 ;; SCI_REPLACESEL constant
-(def SCI_REPLACESEL 2170)
 
 ;; Helpers
 (def (sci-send sci msg (wparam 0) (lparam 0))