anaconda-mode/anaconda-mode — pull request #28 by fbergroth (2014-06-14 23:16:24+00:00)
Title: Extended plugin system.

I consider to reinvent this issue. It'll much easier to support this feature with `jsonrpc` library. I'll try to describe this in example of developing `anaconda-django` plugin.

* Python plugin part added to `anaconda-mode` as positional argument without anaconda prefix. Run server like this `python anaconda_mode.py jedi eldoc django`.
* Enabled plugin list managed by lisp variable `anaconda-mode-plugins`. Default value is set to `nil`.
* When `anaconda-mode` enabled for example in `python-mode-hook` it initiate each plugin by calling `anaconda-django-init` function. Also it require `anaconda-django` library if necessary.
* Plugin code imported before main server start. Something like `import anaconda_django`.
* Server side `sys.path` extended with plugin directory itself and its vendor directory. Plugin path detected by locating elisp library. `(locate-library 'anaconda-django)`
* Rpc commands of all plugins managed by single dispatcher so to avoid name corruption we must prefix our rpc function names with plugin name
```python
@dispatcher.add_method
def django_settings_get(param
```
* To enable logging in plugin use `anaconda_mode.django` instead of `__name__` if you want to merge plugin messages to anaconda log file.

So based on this rule set we can consider following project stucture:
```
vendor/
anaconda-django.el
anaconda_django.py
```
Also we can move jedi, eldoc and company plugins to `contrib` subdirectory.