nim-lang / nim-mode

An emacs major mode for the Nim programming language
139 stars 46 forks source link

No autoload dependency #203

Closed krux02 closed 5 years ago

krux02 commented 6 years ago

I convert autoload comments to commands. When I load the library with load-library the autoload mock isn't generated. These commands are now executed twice, but in general it lowers the entrance barrier to contribute to nim-mode, because the autoload indirection isn't required anymore to load the library properly.

I do thins, because I think autoload here really gets in the way. Loading a library with load-library is properly documented. Loading the autoload mock of a library that needs to be generated first is not properly documented. Apart from that autoload is very confusing in it's name, it does the exact opposite of automatically loading something. With this change cloning nim-mode and loading it with (add-to-list 'load-path "/path/to/nim-mode/") (load-library "nim-mode") just works. No need to dive in the curiosity of autoload.

yuutayamada commented 6 years ago

For contributors, I would rather recommend el-get or properly maintained package manager than use of load-library and I won't support load-library officially because there is ambiguity for loading order (which file you are going to load first, and they don't confirm it usually in the issue tracker). Also, I would avoid twice loading the code for advice users. (nadvice.el)

krux02 commented 6 years ago

Can you elaborate about the loading order ambiguety, and where it could cause problems in nim-mode? And what does advice have to do with all of this?