emacs 中 pylint 的输出无法解析

emacs 中 pylint 的输出无法解析

我刚刚从 Ubuntu 12.04 升级到 14.04(全新升级,不是就地升级)。

我发现我无法像以前一样从 emacs(Mx pylint)内部调用 pylint,因此我安装了 python-mode 包。

现在我可以从 emacs 调用 pylint,但即使我让它包含行号 ( pylint -f parseable foo.py),emacs 也无法使用 next-error 跳转到下一个错误。当我尝试时,我在迷你缓冲区中收到以下错误:

“没有缓冲区包含错误消息位置。”

任何关于如何修复此问题的建议都将不胜感激。谷歌搜索只显示了如何让 flymake 运行 pylint 的提示,而我对此不感兴趣。

作为参考,下面是我在 emacs 的 pylint 输出窗口中看到的示例:

No config file found, using default configuration /usr/lib/python2.7/dist-packages/pylint/reporters/text.py:79: UserWarning: parseable output format is deprecated. This is equivalent to --msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 'to --msg-template=%s' % (self.name, self.line_format)) ************* Module video_demo video_demo.py:21: [E0602(undefined-variable), MatplotlibDisplay.__init__] Undefined variable 'figure' video_demo.py:25: [E0602(undefined-variable), MatplotlibDisplay.update] Undefined variable 'axes' video_demo.py:28: [E0602(undefined-variable), MatplotlibDisplay.update] Undefined variable 'figure' video_demo.py:35: [E0213(no-self-argument), VideoDisplay.update] Method should have "self" as first argument video_demo.py:50: [E1103(maybe-no-member),

答案1

我通过执行以下操作修复了它:

第一步:卸载 python-mode Ubuntu 包。它弊大于利,尤其是制表行为。

第二步:将这一行添加到我的 .emacs 文件中:

(require 'tramp)

这样就解决了调用时缺少函数M-x pylint的错误tramp-tramp-p。显然这是 Ubuntu 14.04 的 pylint.el 副本中的一个错误,现已被上游修补(请参阅此请求请求)。

相关内容