Skip to content

Commit d89128c

Browse files
committed
wip: emacs ignore-dead-server? on open
1 parent a9ec99b commit d89128c

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

src/ralphie/emacs.clj

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,29 @@
101101
([] (open nil))
102102
([wsp]
103103
(try
104-
(let [wsp (or wsp {})
104+
(let [wsp (or wsp {})
105+
ignore-dead-server? (:emacs.open/ignore-dead-server? wsp false)
105106
wsp-name
106107
(or (some wsp [:emacs.open/workspace
107108
:workspace/title :org/name :clawe.defs/name])
108109
"ralphie-fallback")
109-
initial-file (some wsp [:emacs.open/file :emacs.open/directory
110-
:workspace/initial-file])
111-
initial-file (determine-initial-file initial-file)
112-
elisp-hook (:emacs.open/elisp-hook wsp)
113-
eval-str (str
114-
"(progn "
115-
;; TODO refactor russ/open-workspace to support initial-file
116-
;; so that we don't open the readme when the workspace is already open
117-
(when wsp-name
118-
(str " (russ/open-workspace \"" wsp-name "\") "))
119-
(when initial-file
120-
;; TODO consider a 'daily file' pattern here, even searching to find one
121-
(str " (find-file \"" initial-file "\") " " "))
122-
(when elisp-hook elisp-hook)
123-
" )")]
124-
125-
(when-not (emacs-server-running?)
110+
initial-file (some wsp [:emacs.open/file :emacs.open/directory
111+
:workspace/initial-file])
112+
initial-file (determine-initial-file initial-file)
113+
elisp-hook (:emacs.open/elisp-hook wsp)
114+
eval-str (str
115+
"(progn "
116+
;; TODO refactor russ/open-workspace to support initial-file
117+
;; so that we don't open the readme when the workspace is already open
118+
(when wsp-name
119+
(str " (russ/open-workspace \"" wsp-name "\") "))
120+
(when initial-file
121+
;; TODO consider a 'daily file' pattern here, even searching to find one
122+
(str " (find-file \"" initial-file "\") " " "))
123+
(when elisp-hook elisp-hook)
124+
" )")]
125+
126+
(when (and (not (emacs-server-running?)) (not ignore-dead-server?))
126127
(notify {:notify/subject "Initializing Emacs Server, initializing."
127128
:notify/id "init-emacs-server"})
128129
(initialize-emacs-server)

0 commit comments

Comments
 (0)