2013-04-02 44 views
2

我在Emacs中使用flymake来检查用多种语言编写的代码。但是,我看不到在elisp上使用flymake的任何方法。Elisp本身有飞行模式吗?

我所知道的elint-current-bufferbyte-compile-file,这既给有关未定义变量等奇怪的是,他们并不总是给予同样的错误有用的警告:例如,ELINT不警告(require 'cl)。我也试过auto-compile-mode(在MELPA上可用),但是这仍然会将警告写入单独的缓冲区。

当我输入错误时,我真的很想让我的elisp代码加下划线。我该怎么做呢?我之前配置过flymake,但那是外部程序,而不是Emacs本身。

回答

5

Emacs wiki有this来说说关于flymake for emacs lisp,尽管它看起来不太完整。尽管如此,

flycheck支持Emacs Lisp“开箱即用”。

+0

我不知道flycheck没了,谢谢。 EmacsWiki解决方案只检查parens是否平衡,这不是非常有用。 –

+1

flycheck工作得很好,谢谢:) –

1

Erefactor是相当不错的,从维基可同时作为melpa:http://www.emacswiki.org/emacs/erefactor.el

我也喜欢跑步checkdoc后保存:

(defun emagician/run-checkdoc() 
    "run checkdoc on save if it is an elisp file" 
    (if (and (eq major-mode 'emacs-lisp-mode) 
      (> (length buffer-file-name) 
       (length package-user-dir)) 
      (not (string= (concat package-user-dir "/") 
          (substring buffer-file-name 0 (+ 1 (length package-user-dir)))))) 
     (checkdoc))) 

(add-hook 'after-save-hook 'emagician/run-checkdoc) 
+0

谢谢,我不知道关于erefactor。但是,它在单独的缓冲区中运行elint。我在erefactor.el上运行了'erefactor-elint',它给了我以下输出:https://gist.github.com/Wilfred/5320601。 备案:我还应该提到[redshank](https://github.com/emacsmirror/redshank)与erefactor非常相似。 –