From 58030a6a0a78d02e00a9066d2140212b2f89014a Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sun, 16 Nov 2025 14:42:44 -0800 Subject: [PATCH 1/4] Send session field in completions request. All requests should have this field; completion in jeejah breaks without it. --- monroe.el | 1 + 1 file changed, 1 insertion(+) diff --git a/monroe.el b/monroe.el index d2a98a5..5c0a48d 100644 --- a/monroe.el +++ b/monroe.el @@ -525,6 +525,7 @@ inside a container.") (sym (thing-at-point 'symbol)) (response (monroe-send-sync-request (list "op" "completions" "ns" ns + "session" (monroe-current-session) "prefix" sym)))) (monroe-dbind-response response (completions) (when completions From 1da554315b220bc8b687bb72c11aa9fa3dcec3d0 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sun, 16 Nov 2025 14:44:14 -0800 Subject: [PATCH 2/4] Look for completion candidates in the candidate field. Previously this was mistakenly using cdadr to extract the completion candidates, which would only work by accident if the response message did not include any different fields than expected. --- monroe.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monroe.el b/monroe.el index 5c0a48d..2222a29 100644 --- a/monroe.el +++ b/monroe.el @@ -515,6 +515,9 @@ inside a container.") (goto-char (point-min)) (forward-line (1- line))))))))) +(defun monroe-completion-candidate (completions) + (monroe-dbind-response completions (candidate) candidate)) + (defun monroe-completion-at-point () "Function to be used for the hook 'completion-at-point-functions'." (interactive) @@ -529,7 +532,8 @@ inside a container.") "prefix" sym)))) (monroe-dbind-response response (completions) (when completions - (list start end (mapcar 'cdadr completions) nil))))) + (let ((candidates (mapcar 'monroe-completion-candidate completions))) + (list start end candidates nil)))))) (defun monroe-get-stacktrace () "When error happens, print the stack trace" From 35d5e1eedd7079b038d9d79d11ff131f2007c5ff Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sun, 16 Nov 2025 14:44:50 -0800 Subject: [PATCH 3/4] Add monroe-completion-at-point hook locally. This was passing in 'local in the wrong argument, so it did not have the desired effect. --- monroe.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monroe.el b/monroe.el index 2222a29..0f323e5 100644 --- a/monroe.el +++ b/monroe.el @@ -672,7 +672,7 @@ The following keys are available in `monroe-mode': (setq comint-input-sender 'monroe-input-sender) (setq mode-line-process '(":%s")) ;(set (make-local-variable 'font-lock-defaults) '(clojure-font-lock-keywords t)) - (add-hook 'completion-at-point-functions #'monroe-completion-at-point 'local) + (add-hook 'completion-at-point-functions #'monroe-completion-at-point nil 'local) ;; a hack to keep comint happy (unless (comint-check-proc (current-buffer)) (let ((fake-proc (start-process "monroe" (current-buffer) nil))) From c508ca556f253cbb5aa808d5ed49aaf0d3938025 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sun, 16 Nov 2025 16:16:02 -0800 Subject: [PATCH 4/4] Fall back to user ns if completion ns isn't found. --- monroe.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monroe.el b/monroe.el index 0f323e5..8bc3992 100644 --- a/monroe.el +++ b/monroe.el @@ -527,7 +527,7 @@ inside a container.") (ns (monroe-get-clojure-ns)) (sym (thing-at-point 'symbol)) (response (monroe-send-sync-request (list "op" "completions" - "ns" ns + "ns" (or ns "user") "session" (monroe-current-session) "prefix" sym)))) (monroe-dbind-response response (completions)