2012-09-15 55 views
2

上下文:我一直在使用ropemacs for python,并设置和工作pyemacs。我想开始在Python中编程emacs(我有一些在elisp中编程emacs的经验)。我开始与你好世界样本。

我创建〜/ .emacs.d/hello.py与样品从docs获取你好世界在pymacs工作

from Pymacs import lisp 

def hello_world(): 
    lisp.insert("Hello from Python!") 
hello_world.interaction = '' 

我则想在我的init文件加载hello.py:

(eval-after-load "pymacs"        
    '(add-to-list 'pymacs-load-path "~/.emacs.d/")) 
(pymacs-load "hello") ;;this line fails        
(require 'hello)         

我收到以下错误。我究竟做错了什么?

Debugger entered--Lisp error: (error "Pymacs loading hello...failed")   
    signal(error ("Pymacs loading hello...failed"))        
    pymacs-report-error("Pymacs loading %s...failed" "hello")      
    (cond (lisp-code (let ((result (eval lisp-code))) (message "Pymacs loading %$ 
    (let ((lisp-code (pymacs-call "pymacs_load_helper" module prefix))) (cond (l$ 
    pymacs-load("hello")               
    eval((pymacs-load "hello") nil)            
    eval-last-sexp-1(nil)               
    eval-last-sexp(nil)               
+0

您的'hello_world.interaction ='''行是缩进,而在文档中它不是。 – tkf

+0

嗨tkf这是一个错字。修正了缩进 – Raghu

回答

0

我也许有点迟到了,但原因是因为你应该确保将模块添加到pymacs负载路径后重新加载pymacs解释,这样做最简单的方法是杀死Pymacs缓冲区,它应该工作后