1

我正在尝试使用 emacs 安装 pyflakes。到目前为止,我已经从这里获得了 flymake.el 文件。我把它放在我的 .emacs.d 文件夹中。在我的 .emacs 文件中,我有这个:

(when (load "flymake" t)
  (defun flymake-pyflakes-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 "pyflakes" (list local-file))))

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

(add-hook 'find-file-hook 'flymake-find-file-hook)

我还下载了 pyflakes,它可以从命令行调用。但是,当我用一个文件打开我的 emacs 时,我仍然发现它找不到程序“pyflakes”。为什么 emacs 找不到 pyflakes 而我的命令行可以?我在 iOS 上。

4

1 回答 1

0

通过将以下行添加到 init.el或添加/path/to/python/scriptsemacsexec-pathM-:

(setq exec-path (cons /path/to/python/scripts exec-path))
于 2013-04-16T07:26:34.400 回答