emacs中的elisp REPL工具:ielm

ielm

ielm是一个Emacs自带的elisp REPL环境. 它继承自comint-mode,因此也就拥有了comint-mode的那些特性,比如命令历史,tab补全等等.

  • 启动

    M-x ielm

  • 绑定working buffer

    所谓working buffer就是一个特殊的buffer,你在ielm上执行的命令就好像是在该buffer上执行命令一样. 通过绑定working buffer,可用在ielm中修改buffer的buffer-local变量

    绑定方法为C-c C-b,然后选择要作为working buffer的buffer名称

  • 启用auto complete

    默认情况下,ielm是不支持auto complete的. 可用将下面代码放入.emacs中

    (defun ielm-auto-complete ()                               
      "Enables `auto-complete' support in \\[ielm]."           
      (setq ac-sources '(ac-source-functions                   
                         ac-source-variables                   
                         ac-source-features                    
                         ac-source-symbols                     
                         ac-source-words-in-same-mode-buffers))
      (add-to-list 'ac-modes 'inferior-emacs-lisp-mode)        
      (auto-complete-mode 1))                                  
    (add-hook 'ielm-mode-hook 'ielm-auto-complete)


你可能感兴趣的:(emacs,elisp,repl,ielm)