diff --git a/monroe.el b/monroe.el index d2a98a5..8bc3992 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) @@ -524,11 +527,13 @@ 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) (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" @@ -667,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)))