-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set my own comamnd line options for nim-compile
#231
Comments
Also, I think because |
This is my configuration: (defun arne--get-nim-compile-command ()
"Calculate a good default compile command for Nim."
(let ((koch-dir (locate-dominating-file buffer-file-name "koch.nim"))
(nimble-dir (arne--locate-dominating-nimble-file)))
(cond
(koch-dir ;; in the compiler
(concat
"cd "
(shell-quote-argument
(file-relative-name koch-dir))
(cond ;; is test file in the test folder?
((string-match "^tests/.*/t[^/]*.nims?$" (file-relative-name buffer-file-name koch-dir))
"; testament/testament run ")
((string-match "nimsuggest/tests/t[^/]*.nim$" (file-relative-name buffer-file-name koch-dir))
"; nimsuggest/tester ")
(t
"; nim c -r "))
(shell-quote-argument
(file-relative-name buffer-file-name koch-dir))))
((string-match "\\.nims$" buffer-file-name)
(concat "nim e "
(shell-quote-argument
(file-relative-name buffer-file-name))))
(t
(concat "nim c -r "
(shell-quote-argument
(file-relative-name buffer-file-name)))))))
(defun arne--init-nim-mode ()
"Define some settings for the nim mode. Some ``imenu'' integration."
(when buffer-file-name
(setq-local compile-command (arne--get-nim-compile-command)))
(add-hook 'nim-mode-hook 'arne--init-nim-mode) The idea here is: The logic in |
I try to set my own command line options for
nim-compile
as file local variables (like("js" "-r" "--verbosity:0" "--hint[Processing]:off" "--excessiveStackTrace:on")
.Only way I found to do this is setting
nim-compile-default-command
- despite the fact that this variable has the suffix-default-command
, but the variable contains neither the full command nor is it the default any more.Do I miss something? Or is this the recommended way?
I use Linux, emacs 26.2, nim-mode-20191219.847 and nim 1.2.6.
The text was updated successfully, but these errors were encountered: