Skip to content

Commit 41df99c

Browse files
committed
fix: emacs/open quoting/syntax
1 parent c5bbe44 commit 41df99c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/ralphie/emacs.clj

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
initial-file (determine-initial-file initial-file)
112112
elisp-hook (:emacs.open/elisp-hook wsp)
113113
eval-str (str
114-
"(progn "
114+
"'(progn "
115115
;; TODO refactor russ/open-workspace to support initial-file
116116
;; so that we don't open the readme when the workspace is already open
117117
(when wsp-name
@@ -120,10 +120,15 @@
120120
;; TODO consider a 'daily file' pattern here, even searching to find one
121121
(str " (find-file \"" initial-file "\") " " "))
122122
(when elisp-hook elisp-hook)
123-
" )")
123+
")'")
124124
ignore-dead-server? (:emacs.open/ignore-dead-server? wsp false)
125125
wayland? (:emacs.open/wayland? wsp true) ;; defaulting to wayland!
126-
display-str (when-not wayland? "--display=:0")]
126+
display-str (if wayland? nil "--display=:0")
127+
open-str
128+
(str "emacsclient --no-wait --create-frame "
129+
" -F '((name . \"" wsp-name "\"))' "
130+
display-str
131+
" --eval " eval-str)]
127132

128133
(when (and (not (emacs-server-running?)) (not ignore-dead-server?))
129134
(notify {:notify/subject "Initializing Emacs Server, initializing."
@@ -132,11 +137,11 @@
132137
(notify {:notify/subject "Started Emacs Server"
133138
:notify/id "init-emacs-server"}))
134139

135-
(-> ($ emacsclient --no-wait --create-frame
136-
-F ~(str "((name . \"" wsp-name "\"))")
137-
~display-str
138-
--eval ~eval-str)
139-
check))
140+
(->
141+
(process/process {:cmd open-str
142+
;; :pre-start-fn (fn [{:keys [cmd]}] (println cmd))
143+
})
144+
check))
140145
;; TODO proper clawe error log
141146
(catch Exception e
142147
(notify/notify "emacs/open error" (str e))

0 commit comments

Comments
 (0)