title: Running pyflakes remotely with flymake and tramp in emacs?
body: <p>I'm trying to use flymake to run pyflakes, as suggested <a href="http://www.emacswiki.org/cgi-bin/wiki/PythonMode#toc9" rel="nofollow noreferrer">here</a></p>
  
  <p>This works fine for local files, and almost works with remote files with a bit of tweaking, but I'm left with a problem where flymake/pyflakes 'modifies' the buffer when it runs (although nothing actually seems to change), which renders it a bit useless in practice (e.g. saving a file runs flymake which immediately modifies the buffer again).</p>
  
  <p>Here's what I did to almost get it working:</p>
  
  <ol>
  <li>Installed pyflakes on the remote box.</li>
  <li>Customized my <code>tramp-remote-process-environment</code> variable so that pyflakes could be found in its PATH</li>
  <li>Used a variant of the code from the wiki link above. Obviously I excluded the check that disables it for remote buffers. Also, the <code>(when (load "flymake" t) ...)</code> construct didn't seem to work as I expected, but I'm not too worried about that.</li>
  <li>Re-defined (for test purposes -- advice should be fine if this can be made to work) the <code>flymake-start-syntax-check-process</code> function so that it uses <code>start-file-process</code> (which works with tramp) instead of <code>start-process</code> (which does not).</li>
  </ol>
  
  <p>The change in #4 does not appear to cause any issues when processing a local file, but although this now enables flymake to run the remote pyflakes for the remote files (errors are highlighted as expected), in this instance the buffer is 'modified' whenever flymake runs.</p>
  
  <p>I'm guessing that <code>start-file-process</code>, for remote processes, results in some additional return value/data that does not occur for local processes.</p>
  
  <p>Does anyone have any insight/advice?</p>
  
  <ul>
  <li>Emacs 23.1 and 23.2 on Ubuntu</li>
  <li>Python 2.4.6</li>
  <li>Pyflakes 0.4.0 (via easy_install)</li>
  </ul>