syl20bnr/spacemacs — pull request #233 by danielwuz (2014-12-09 17:18:18+00:00)
Title: enable semantic mode in python contrib by default

Not sure if this is the right way to fix the problem, so instead of opening an issue, I just made a PR so that we can have some code to discuss.

The problem is that right now, in `python` buffers, `helm-semantic-or-imenu`(bound to `SPC s l`) gives nothings. This is because we neither enabled `semantic-mode` in python buffer nor do we set up `imenu-generic-expression` variable.

The solution is also pretty straightforward: we can either enable `semantic-mode`, as in this PR, or we'll have something like this in `python-hook`:
```lisp
(setq python-imenu-generic-expression
'(("Function" "^[[:space:]]*def[ \n\t]+\\([_A-Za-z0-9]+\\)(" 1)
("Class" "^[[:space:]]*class[ \n\t]+\\([A-Z][_A-Za-z0-9]*\\)[[:space:]]*(" 1)))

(setq imenu-generic-expression python-imenu-generic-expression)
```

I prefer the first one, i.e. enable semantic by default. Not only because semantic mode actually parse the source code and therefore gives better results, but also because it has syntax hightlighting in `helm` buffer. But I'm not sure if that's something everyone wants.

Let me know your thought.