branch: elpa/lua-mode
commit 853b0405b7c9403484746328412fe5ae71fe240d
Author: Nikita Bloshchanevich <[email protected]>
Commit: Nikita Bloshchanevich <[email protected]>

    `lua-start-process': start a new process sometimes
    
    Start a new lua process if NAME is given and different.
---
 lua-mode.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lua-mode.el b/lua-mode.el
index 64334a2..bd9a60f 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1857,11 +1857,12 @@ This function just searches for a `end' at the 
beginning of a line."
 PROGRAM defaults to NAME, which defaults to `lua-default-application'.
 When called interactively, switch to the process buffer."
   (interactive)
-  (unless (process-live-p lua-process)
-    (setq name (or name (if (consp lua-default-application)
-                            (car lua-default-application)
-                          lua-default-application)))
-    (setq program (or program lua-default-application))
+  (setq name (or name (if (consp lua-default-application)
+                          (car lua-default-application)
+                        lua-default-application)))
+  (setq program (or program lua-default-application))
+  ;; don't re-initialize if there already is a lua process
+  (unless (comint-check-proc (format "*%s*" name))
     (setq lua-process-buffer (apply #'make-comint name program startfile
                                     (or switches 
lua-default-command-switches)))
     (setq lua-process (get-buffer-process lua-process-buffer))

Reply via email to