|
101 | 101 | ([] (open nil)) |
102 | 102 | ([wsp] |
103 | 103 | (try |
104 | | - (let [wsp (or wsp {}) |
| 104 | + (let [wsp (or wsp {}) |
| 105 | + ignore-dead-server? (:emacs.open/ignore-dead-server? wsp false) |
105 | 106 | wsp-name |
106 | 107 | (or (some wsp [:emacs.open/workspace |
107 | 108 | :workspace/title :org/name :clawe.defs/name]) |
108 | 109 | "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?)) |
126 | 127 | (notify {:notify/subject "Initializing Emacs Server, initializing." |
127 | 128 | :notify/id "init-emacs-server"}) |
128 | 129 | (initialize-emacs-server) |
|
0 commit comments