Closed krux02 closed 8 years ago
I think you are missing nim-nimsuggest-path
to configure.
Can you specify following configuration? (please fill out the correct path of nimsuggest and put the code top of your configuration)
(setq nim-nimsuggest-path "/home/krux/..../nimsuggest/nimsuggest")
then
open up a nim file without nim's compiler directory (because it doesn't
work well) and please try "M-." (meta + dot key) on echo
statement.
The M-. is binded jump to definition
function and I would make sure
your emacs is applied nimsuggest's configuration. (In my emacs, I could jump
system.nim file)
@krux02 Also you don't need this line (this is to load from another file)
(provide 'init_nim-mode)
and you might don't need following config:
(require 'flycheck-nim-async)
(defconst nimsuggest-vervosity nil)
there are two ways to syntax check in nim files.
first one uses nim check
command and second one uses chk
option of nimsuggest.
I think you already installed flycheck-nim
, so you can delete above configuration.
(instead, if you want to use flycheck-nim-async, uninstall flycheck-nim)
flycheck-nim-async can check nimscript files as well, but there is a minor bug, so it's hard to recommend which one...
for some reason (setq nim-nimsuggest-path "/home/...")
did not help, but starting emacs from the terminal, instead from Alt+F2 emacs
did do a difference. For some reason Alt+F2 started programs do not have the same path variable.
EDIT: I have (setq nim-nimsuggest-path "/home/...") in my .emacs
, but if I examine the value of that variable at runtime, it has the value nil
. (I used C-h v RET nim-nimsuggest-path)
Sorry for my confusing suggestion. You can use defconst
instead of setq
to prevent overriding variable or put the
configuration after (require 'nim-mode)
I did put it after (require 'nim-mode)
that's the context where it failed.
Is nim-nimsuggest-path
still nil in a nim file?
if so, I guess:
nim-nimsuggest-path
is not nil in a non-nim file. In a Nim file it is set to nil in nim-suggest.el
, as told from C-h v nim-nimsuggest-path. My .emacs
get's loaded correctly.
hmm, it's strange... the (require 'nim-mode)
loads also nim-suggest.el and
once emacs loaded nim-mode by using the require
, second time emacs ignores loading
the same file. (so I thought putting the (setq nim-nimsuggest-path ...)
after (require 'nim-mode)
solve your overriding problem)
Have you tried defconst
instead of setq
?
(just FYI, load
function loads if emacs already loads the file, so sometimes
it overrides user configuration, though I know you don't use this function)
EDIT: I modified little bit around "I thought ..."
I would like to mention again, that starting emacs from an environment, where the path is set correctly solves this problem.
No defconst
does not solve the problem, and `(require 'nim-suggest) also does not solve the problem.
Flycheck in .emacs
warns me with the warning assignment to free variable 'nim-suggest-path'
Flycheck in .emacs warns me with the warning assignment to free variable 'nim-suggest-path'
because it's typo of nim-nimsuggest-path
@krux02 can you close this issue? I think you already solved this issue.
Company mode is enabled, but I do not get any completions. Instead emacs just freezes now and then for several seconds. Since I am new to emacs, I don't know what information you need in order to find out, what could cause this problem, but I will give you all the information you need, if you tell me what it is you need, and where I cant find it. I will attach my emacs config.
config.el.txt