3

我使用 Python 模式(不是 emacs 23 附带的默认模式)。

我无法执行当前加载在 emacs 中的 python 程序。

我收到“符号的函数定义无效:smart-operator-mode-on”错误。

任何线索或任何提示都可以创建一个 python 程序,它可以在 emacs 上运行并显示结果输出窗口?

这里是emacs 错误报告

Debugger entered--Lisp error: (void-function smart-operator-mode-on)
     (smart-operator-mode-on)
     (lambda nil (set-variable (quote py-indent-offset) 4) 
      (set-variable (quote indent-tabs-mode) nil) (define-key py-mode-map (kbd "RET")  (quote newline-and-indent)) (smart-operator-mode-on))()
      run-hooks(python-mode-hook)
     (if python-mode-hook (run-hooks (quote python-mode-hook)) (run-hooks (quote py-mode-hook)))   python-mode()

我的 init_python.el 脚本

 (autoload 'python-mode "python-mode" "Python Mode." t)
 (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
 (add-to-list 'interpreter-mode-alist '("python" . python-mode))

  (require 'python-mode)
  (add-hook 'python-mode-hook
    (lambda ()
(set-variable 'py-indent-offset 4)
;(set-variable 'py-smart-indentation nil)
(set-variable 'indent-tabs-mode nil)
(define-key py-mode-map (kbd "RET") 'newline-and-indent)
;(define-key py-mode-map [tab] 'yas/expand)
;(setq yas/after-exit-snippet-hook 'indent-according-to-mode)
(smart-operator-mode-on)
))
4

2 回答 2

0

我通过将smart-operator.el文件下载到加载路径并require 'smart-operator'在调用之前添加来解决此错误smart-operator-mode-on

于 2011-09-21T19:10:50.727 回答
0

关闭后它可以工作(智能操作员模式开启)我需要看看如何解决智能操作员模式开启

(setq debug-on-error t) 帮助我发现错误。谢谢努法尔。

于 2010-01-09T07:08:13.787 回答