Skip to content
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

Flycheck not being started automatically for python-mode #97

Closed
gabriel4649 opened this issue Mar 28, 2013 · 8 comments
Closed

Flycheck not being started automatically for python-mode #97

gabriel4649 opened this issue Mar 28, 2013 · 8 comments
Assignees

Comments

@gabriel4649
Copy link

Maybe this isn't a bug and it's only a problem in my configuration, but Flycheck isn't getting started automatically for Python mode files. It works beutifully with other modes such as Elisp and Bash though, it also works really great when I enable it manually on my Python files.

@ghost ghost assigned swsnr Mar 28, 2013
@swsnr
Copy link
Contributor

swsnr commented Mar 28, 2013

To be clear, Flycheck is never started automatically, unless explicitly configured by adding flycheck-mode to the corresponding mode hooks. Did you do this? Can you provide a link to your Emacs configuration? Also, do you see any suspicious messages in the *Messages* buffer?

@gabriel4649
Copy link
Author

This is my Emacs configuration: https://bitbucket.org/climatewarrior/dotfiles/src/ad83eea06d36e15daddd0f33178be7b43a8e6072/.emacs.d/Emacs.org?at=default And no I didn't add flycheck-mode to the corresponding hooks, all I did was add this to my config file.

(add-hook 'prog-mode-hook 'flycheck-mode)
(add-hook 'text-mode-hook 'flycheck-mode)

When I loaded a session that had mostly Python files I just go the following flycheck related messages in Messages

Cannot use Flycheck mode in buffer README.org
Loading conf-mode...done
Cannot use Flycheck mode in buffer tango-2-theme-autoloads.el
Desktop: 25 buffers restored.
Cannot use Flycheck mode in buffer *unsent mail*

Thank you so much for your time and your help!

@swsnr
Copy link
Contributor

swsnr commented Mar 28, 2013

You're using a strange Python setup. A manual autoload is not necessary for modes built into Emacs, or installed via package.el.

So which Emacs version are you using, and where did you get the Python mode from? I assume that it is not the Python mode built into Emacs, is it?

@gabriel4649
Copy link
Author

I have Emacs 24.2.1, I was using this version of python-mode https://launchpad.net/python-mode (installed through Elpa) but now I switched to the built in version and Flycheck starts automatically for Python files :) Thanks for your help! But do you know what was causing the problem?

@swsnr
Copy link
Contributor

swsnr commented Mar 29, 2013

From which ELPA archive did you install this Python mode? It is surely not contained in the official archive, and I did not find it in Marmalade and MELPA. Are you still using Tom Tromey's archive?!

As for the cause of this issue, the Python mode from Launchpad does not derive from prog-mode, and thus does not execute prog-mode-hook. Hence Flycheck was never actually enabled for this mode. I already assumed this, which is why asked which Python you were using.

@gabriel4649
Copy link
Author

I'm using Marmalade http://marmalade-repo.org/. Oh ok, I understand, thanks for the explanation. I will close the issue now, thanks for your time again and for this great piece of software. It really does make a way more productive Python programmer.

@swsnr
Copy link
Contributor

swsnr commented Mar 30, 2013

You can also explicitly add flycheck-mode to python-mode-hook.

@swsnr
Copy link
Contributor

swsnr commented Mar 30, 2013

And by the way, update to Emacs 24.3, really :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants