1

So i'm using this wrapper suggested on the emacs python wiki (found here) around pep8, pyflakes and pylint which works on the command line (after the trouble of getting it setup on windows according to " Running python scripts with subprocess in windows. Python code checker wrappers from the emacswiki yield the same error ".

However, in emacs, flymake will underline the line having an error but when I hover the mouse, the box that should contain the error message is empty. My init file contains:

 (setq pycodechecker "etcwrapper.bat")
(when (load "flymake" t)
   (load-library "flymake-cursor")
   (defun dss/flymake-pycodecheck-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 pycodechecker (list local-file))))
   (add-to-list 'flymake-allowed-file-name-masks
                '("\\.py\\'" dss/flymake-pycodecheck-init)))

etcwraper.bat is a simple batch script that runs python on the python wrapper script. I put it in a directory in my system path for convenience. Also can I make flymake underline only one character rather than the whole line? Any suggestions?

Community
  • 1
  • 1
octi
  • 1,470
  • 1
  • 17
  • 28

1 Answers1

0

I'm not a python expert, and have never used it on windows, so this answer may not be useful... but I know there's a hack in some versions of flymake-cursor to cope with the fact that pyflakes either doesn't report errors correctly for compile errors, or that they're in the wrong format for flymake to parse.

You can see the attempted fix for it in my fork of flymake-cursor here:

https://github.com/illusori/emacs-flymake-cursor/blob/master/flymake-cursor.el#L126

I got that fix from the Dino Chiesa version, so I don't know the full backstory, but it sounds like that's the issue you're having.

A more recent version of flymake-cursor such as mine or Dino's may help you see an error indicator in the emacs message area, but the mouse overlay is handled in flymake which has no fixes for this issue as far as I'm aware.

If you provide the output generated by your etcwrapper.bat when run manually, I might be able to help further.

Underlining just one character is also tricky, from my understanding you'd need to redefine flymake-make-overlay from flymake.el and create two overlays instead of one. You may just find it easier to customize the face for flymake-errline and flymake-warnline to something less intrusive than underline.

Sorry that neither of these answers are a fix. :)

Sam Graham
  • 1,563
  • 1
  • 14
  • 17