【发布时间】:2011-03-08 14:26:26
【问题描述】:
我使用ropemacs编写python源码,这里是.emacs的相关部分:
(defun my-python-hook-mode ()
(interactive)
(require 'pymacs)
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
(ac-ropemacs-setup)
(setq ropemacs-confirm-saving 'nil)
(ropemacs-mode t)
(define-key python-mode-map "\C-m" 'newline-and-indent)
)
(add-hook 'python-mode-hook 'my-python-hook-mode)
以上内容适用于以 python 模式打开的文件。但由于某种原因(尚不清楚),emacs 会在 jython-mode 中处理一些 .py 文件。
每次在 jython-mode 中打开文件时,函数“my-python-hook-mode”会被调用两次,并出现警告消息 (目前没有发现副作用):
关闭ropemacs模式;最好传递一个明确的参数。
有人遇到过这样的问题吗?谢谢。
【问题讨论】:
标签: python emacs jython ropemacs