emacs windows 在当前缓冲区中运行 python 程序并在输出窗口上显示输出
我使用 Python 模式(不是 emacs 23 附带的默认模式)。
我无法执行当前在 emacs 中加载的 python 程序。
我收到“符号的函数定义无效:智能操作模式开启”错误。
有任何线索或任何提示可以制作一个 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)
))
I use the Python-mode (not the default one comes with emacs 23).
I could not execute the python program currently loaded in emacs.
I am getting "Symbol's function definition is void: smart-operator-mode-on" error.
Any clue or any tips makes a python program and it can be run on emacs and show the result output window?
Here the emacs error report.
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()
My init_python.el script
(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)
))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
关闭后即可工作(智能操作员模式开启)
我需要了解如何解决 smart-operator-mode-on
(setq debug-on-error t) 帮助我发现错误。谢谢努法尔。
It works after turning it off (smart-operator-mode-on)
I need to see how to solve smart-operator-mode-on
(setq debug-on-error t) helps me to spot the error. Thanks Noufal.
我通过将
smart-operator.el
文件下载到加载路径并在调用smart-operator- 之前添加
require 'smart-operator'
修复了此错误模式开启。I got this error fixed by downloading the
smart-operator.el
file into a load-path and addingrequire 'smart-operator'
before callingsmart-operator-mode-on
.