2013-03-26 72 views
1

我試圖用emacs安裝pyflakes。到目前爲止,我從here獲得flymake.el文件。我把它放在我的.emacs.d文件夾中。在我的.emacs文件中,我有:Pyflakes與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上。

+0

您在iOS上運行的Emacs?順便說一下,Flymake隨附Emacs,所以你已經「安裝」了一個已經是Emacs一部分的文件。您甚至可能使用內置版本,因爲'emacs.d'通常不在'load-path'中。關於這個問題,請檢查Emacs中'exec-path'的內容,並檢查它是否包含帶有pyflakes可執行文件的目錄。 – lunaryorn 2013-03-26 23:42:42

+1

我懂了!我添加了pyflakes所在的bin目錄(add-to-list'exec-path * path-here *) – user1828604 2013-03-27 04:21:33

回答

0

添加在Emacs的exec-path/path/to/python/scripts,通過添加以下行來init.elM-:

(setq exec-path (cons /path/to/python/scripts exec-path))