FAQ
Hi,

I am trying to use Pylint with Emacs on Windows XP. My Emacs version
is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install
pylint, I added the code block below to Emacs init file, copied form
Emacs Wiki.


(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "epylint" (list local-file))))

(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))


When I invoke the flymake-mode on a .py file, I can see the flymake
starting the syntax check, the mode status changed to flymake*, and
then goes back to flymake after several seconds. But no error is
reported, and no syntax error highlighting.

I tried to use pylint in command line, and it works with command
"pylint test.py", reporting syntax errors on the same file.

I even tried to clear out my .emacs file, but it doesn't help.

Could someone help me on this? Thanks a lot.

Search Discussions

  • Dsrt Egle at Sep 30, 2010 at 4:50 pm

    On Sep 30, 9:38?am, Dsrt Egle wrote:
    Hi,

    I am trying to use Pylint with Emacs on Windows XP. My Emacs version
    is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install
    pylint, I added the code block below to Emacs init file, copied form
    Emacs Wiki.

    ? ? (when (load "flymake" t)
    ? ? ? (defun flymake-pylint-init ()
    ? ? ? ? (let* ((temp-file (flymake-init-create-temp-buffer-copy
    ? ? ? ? ? ? ? ? ? ? ? ? ? ?'flymake-create-temp-inplace))
    ? ? ? ? ? ?(local-file (file-relative-name
    ? ? ? ? ? ? ? ? ? ? ? ? temp-file
    ? ? ? ? ? ? ? ? ? ? ? ? (file-name-directory buffer-file-name))))
    ? ? ? ? ? (list "epylint" (list local-file))))

    ? ? ? (add-to-list 'flymake-allowed-file-name-masks
    ? ? ? ? ? ? ? ?'("\\.py\\'" flymake-pylint-init)))

    When I invoke the flymake-mode on a .py file, I can see the flymake
    starting the syntax check, the mode status changed to flymake*, and
    then goes back to flymake after several seconds. But no error is
    reported, and no syntax error highlighting.

    I tried to use pylint in command line, and it works with command
    "pylint test.py", reporting syntax errors on the same file.

    I even tried to clear out my .emacs file, but it doesn't help.

    Could someone help me on this? Thanks a lot.

    Question Update: I tried the following at command line prompt with
    "pylint" and "epylint". Does this mean that epylint has a problem?

    C:\Projects>pylint test_lib.py
    No config file found, using default configuration
    ************* Module test_lib
    E: 13: invalid syntax

    C:\Projects>epylint test_lib.py
    'test_lib.py':1: [F] No module named 'test_lib.py'

    C:\Projects>epylint
    Traceback (most recent call last):
    File "C:\Python25\Scripts\epylint", line 5, in <module>
    pkg_resources.run_script('pylint==0.21.3', 'epylint')
    File "C:\Python25\Lib\site-packages\pkg_resources.py", line 489,
    in run_script

    self.require(requires)[0].run_script(script_name, ns)
    File "C:\Python25\Lib\site-packages\pkg_resources.py", line
    1207, in run_script
    execfile(script_filename, namespace, namespace)
    File "c:\python25\lib\site-packages\pylint-0.21.3-py2.5.egg\EGG-
    INFO\scripts\epylint", line 3, in <module>
    epylint.Run()
    File "c:\python25\lib\site-packages\pylint-0.21.3-py2.5.egg
    \pylint\epylint.py", line 93, in Run
    lint(sys.argv[1])
    IndexError: list index out of range
  • Alexandre Fayolle at Oct 4, 2010 at 9:19 am

    Dsrt Egle wrote:

    Hi,

    I am trying to use Pylint with Emacs on Windows XP. My Emacs version
    is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install
    pylint, I added the code block below to Emacs init file, copied form
    Emacs Wiki.
    there are some files provided by pylint for emacs integration. And a patch
    was sent a few weeks ago on the pylint mailing list which improves emacs
    support on Windows : http://lists.logilab.org/pipermail/python-
    projects/2009-September/002039.html

    Could you give it a try? And maybe report back on the python-projects
    mailing list (info at http://lists.logilab.org/mailman/listinfo/python-
    projects).

    Regards,

    --
    Alexandre Fayolle
    Logilab
  • Alexandre Fayolle at Oct 4, 2010 at 10:53 am

    Alexandre Fayolle wrote:

    Dsrt Egle wrote:
    Hi,

    I am trying to use Pylint with Emacs on Windows XP. My Emacs version
    is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install
    pylint, I added the code block below to Emacs init file, copied form
    Emacs Wiki.
    there are some files provided by pylint for emacs integration. And a patch
    was sent a few weeks ago on the pylint mailing list which improves emacs
    support on Windows : http://lists.logilab.org/pipermail/python-
    projects/2009-September/002039.html
    Sorry for the noise : if you're using a recent version of pylint, this has
    been integrated in there for a while now...

    --
    Alexandre Fayolle
    Logilab
  • Dsrt Egle at Oct 5, 2010 at 7:48 pm

    On Oct 4, 3:53?am, Alexandre Fayolle wrote:
    Alexandre Fayolle wrote:
    DsrtEglewrote:
    Hi,
    I am trying to use Pylint with Emacs on Windows XP. My Emacs version
    is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install
    pylint, I added the code block below to Emacs init file, copied form
    Emacs Wiki.
    there are some files provided by pylint for emacs integration. And a patch
    was sent a few weeks ago on the pylint mailing list which improves emacs
    support on Windows :http://lists.logilab.org/pipermail/python-
    projects/2009-September/002039.html
    Sorry for the noise : if you're using a recent version of pylint, this has
    been integrated in there for a while now...

    --
    Alexandre Fayolle
    Logilab

    Thanks for your response, Alex. Yes, the newest pylint has that patch.
    I finally solved my problem by this answer:
    http://stackoverflow.com/questions/3827076/please-help-pylint-does-not-work-with-emacs23

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 30, '10 at 4:38p
activeOct 5, '10 at 7:48p
posts5
users2
websitepython.org

2 users in discussion

Dsrt Egle: 3 posts Alexandre Fayolle: 2 posts

People

Translate

site design / logo © 2022 Grokbase