Skip to content

Commit 58d8d59

Browse files
author
Alys Brooks
committed
Adds a warning message when emacsclient isn't found
Given the name maybe-connect-emacs, warning when emacsclient can't be found seems like the correct behavior.
1 parent 4bb5990 commit 58d8d59

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

src/lambdaisland/launchpad.clj

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -323,24 +323,27 @@
323323
(defn maybe-connect-emacs [{:keys [options nrepl-port project-root] :as ctx}]
324324
(when (:cider-connect options)
325325
(debug "Connecting CIDER with project-dir" project-root)
326-
(eval-emacs
327-
`(~'let ((~'repl (~'cider-connect-clj (~'list
328-
:host "localhost"
329-
:port ~nrepl-port
330-
:project-dir ~project-root))))
331-
332-
~@(for [build-id (:shadow-cljs/build-ids ctx)
333-
:let [init-sym (symbol "launchpad" (name build-id))]]
334-
`(~'progn
335-
(~'setf (~'alist-get '~init-sym
336-
~'cider-cljs-repl-types)
337-
(~'list ~(pr-str
338-
`(shadow.cljs.devtools.api/nrepl-select ~build-id))))
339-
(~'cider-connect-sibling-cljs (~'list
340-
:cljs-repl-type '~init-sym
341-
:host "localhost"
342-
:port ~nrepl-port
343-
:project-dir ~project-root)))))))
326+
(try
327+
(eval-emacs
328+
`(~'let ((~'repl (~'cider-connect-clj (~'list
329+
:host "localhost"
330+
:port ~nrepl-port
331+
:project-dir ~project-root))))
332+
333+
~@(for [build-id (:shadow-cljs/build-ids ctx)
334+
:let [init-sym (symbol "launchpad" (name build-id))]]
335+
`(~'progn
336+
(~'setf (~'alist-get '~init-sym
337+
~'cider-cljs-repl-types)
338+
(~'list ~(pr-str
339+
`(shadow.cljs.devtools.api/nrepl-select ~build-id))))
340+
(~'cider-connect-sibling-cljs (~'list
341+
:cljs-repl-type '~init-sym
342+
:host "localhost"
343+
:port ~nrepl-port
344+
:project-dir ~project-root))))))
345+
(catch java.io.IOException e
346+
(warn "Attempt to connect to emacs failed with exception: " (ex-message e)))))
344347
ctx)
345348

346349
(defn print-summary [ctx]

0 commit comments

Comments
 (0)