I am developing a game with the love2d lua API and with emacs as IDE.
In order to easily test the game from emacs, I wrote following functions :
(defgroup love nil
"The customization group for LÖVE."
:prefix "love-"
:group 'lua)
(defcustom love-exe (or (executable-find "love")
"d:/path/to/love.exe")
"Path to LÖVE executable for playtesting."
:type 'string
:group 'love)
(defun love/start ()
"Run LÖVE externally for the sake of playtesting."
(interactive)
(if (buffer-live-p "*love*")
(kill-buffer "*love*"))
(start-process "löve" "*love*" love-exe (file-name-directory (buffer-file-name))))
(defun love/kill ()
"Kill LÖVE process."
(interactive)
(if (get-process "löve")
(kill-process "löve")
(message "No running löve process")))
The above code is able to launch the love2d GUI however, I cannot catch the console message like those written to stdout from within the game. They do not show up on the process buffer, although I disabled buffering on stdout.
I also checked that issuing the same command from a mingw64 shell does no more display the messages sent to stdout.
I was advised there to use another version of the executable, which is lovec.exe whose only difference is that the GUI process is attached to a console. When I run this executable within a mingw64 shell, I can indeed see the console messages.
However, if I replace in the above lisp functions love.exe by lovec.exe, I can also see the console messages in the process buffer but, the GUI does no more show up although that the process is still alive.
Perhaps I miss something about starting a process attached to a console from emacs. How would you do that ?
Regards