Running pyflakes remotely with flymake and tramp in emacs?

不羁的心 提交于 2019-12-02 22:44:33

You need to tell flymake to create it's copy of the buffer somewhere locally, I prefer using the $TMP directory since this also allows me to use tramp on files in directories I don't have write permissions to.

You may want to checkout my fork of flymake-python since it does all this.

I have this fixed in my fork of Flymake (https://github.com/illusori/emacs-flymake).

It will either run the syntax check on the remote machine via Tramp, without the buffer-modification issue you're seeing; or you can set flymake-run-in-place to nil and it will run the syntax check on the local machine, just like flymake on a regular non-Tramp buffer.

Since it's fixed at the Flymake level, this fix works for all languages and syntax checks rather than just pyflakes.

If you're interested in details of why it's happening, basically when the Tramp handler for start-file-process kicks in, it dumps the login message for the connection onto the end of the current buffer before any output filter can be attached to the process.

Usually this manifests as people seeing the contents of /etc/issue appear at the end of their file along with "You have mail." and so on.

In your case it may be that the login message is empty or just a new-line, so you're not seeing any text being added, even though it's setting the buffer as being modified.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!