Hi all,
Normally I do my C++ dev in Vim and used Emacs for orgmode only. Now I'm moving to Lua I fancy using Emacs for this. I have lua-mode installed and the love-mode as well. I can run my code using C-! "love ./" but any debug shows up printed graphically in the love window. I'd much rather it was in a emacs debug type of window where I can use it to skip to the error.
How do other Emacs users do their love dev?
Question for emacs users
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Question for emacs users
I'm not an emacs user, so I don't know exactly what you want. I do know, however, that all errors are printed on the terminal too, so if you catch the output of love, you should at least have it in emacs..
Re: Question for emacs users
I use Compilation mode to capture the output and hyperlink the error messages to the source code. To enter this mode, you type 'M-x compile'. You'll be prompted to enter the compile command (or accept the default 'make' command).
Here's part of my .emacs that sets this up. I bind C-x C-k to enter this mode.
The above checks if main.lua exists in your current dir, and if so sets the compile command to be 'love .', otherwise it sets the compile command to 'lua <current-buffer-file-name>'. The regular expression is needed to handle LOVE's error message format.
I also use flymake-lua. This checks the syntax of your Lua code as you type and highlights any errors. Here's how I set that up:
Let me know if you have any questions.
Here's part of my .emacs that sets this up. I bind C-x C-k to enter this mode.
Code: Select all
(global-set-key "\C-x\C-k" 'compile)
(add-hook 'lua-mode-hook
(lambda ()
(if (file-exists-p "main.lua")
(progn
(set (make-local-variable 'compile-command) "love . ")
(add-to-list 'compilation-error-regexp-alist 'love t)
(add-to-list 'compilation-error-regexp-alist-alist
'(love "^Error: Syntax error: \\(.*?\\):\\([0-9]+\\):.*$" 1 2) t))
(set (make-local-variable 'compile-command)
(concat "lua " (file-name-nondirectory buffer-file-name))))))
I also use flymake-lua. This checks the syntax of your Lua code as you type and highlights any errors. Here's how I set that up:
Code: Select all
(require 'flymake-lua)
(add-hook 'lua-mode-hook 'flymake-lua-load)
Re: Question for emacs users
Great! Thanks very much.
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Re: Question for emacs users
I am also a long-term Emacs user and started this project some time ago to help with LÖVE development:
https://github.com/ejmr/love-minor-mode
Please feel free to suggest any additions that may be useful; I will admit it does not do too much at the moment.
https://github.com/ejmr/love-minor-mode
Please feel free to suggest any additions that may be useful; I will admit it does not do too much at the moment.
Who is online
Users browsing this forum: Bing [Bot], Semrush [Bot] and 3 guests