2

我已经在 emacs 中安装了 python 包,它从https://raw.github.com/fgallina/python.el/master/python.el下载了 python.el

我想要自动缩进,即当我书写def a():并按下它时,RET它应该自动使用 TAB 缩进。但是我必须手动按 TAB 进行缩进?如何启用它?

这是来自https://launchpad.net/python-mode的 python.el 中的默认行为

任何帮助将不胜感激,

谢谢

4

1 回答 1

2

您正在使用 GNU/Emacs 的 python .el 的一个分支。“这是一个自制的 python 模式,其中有一些来自 GNU/Emacs 的 python.el 的摘录。” 有些东西不起作用,因为 .el 文件的第 585 到 1070 行是关于缩进的;)。请注意,此版本未针对 Emacs 24 进行测试。尝试:Mx describe-mode 以查看您是否实际使用 python 模式。启动时是否有错误消息?您是否已将文件添加到路径中?这应该在您的 .emacs 文件中。

(add-to-list 'load-path "/Users/my/path/to/el/")
(require 'python)

来自 http://emacswiki.org/emacs/PythonProgrammingInEmacs

“Emacs 的 Python 模式有三种实现:python.el 和 python-mode.el。

ProgrammingWithPythonDotEl – python.el 随 GNU Emacs 一起提供。

ProgrammingWithPythonModeDotEl – python-mode.el 来自 Python。

用 PythonDotElGallina 编程?– https://github.com/fgallina/python.el Fabián Ezequiel Gallina 对 python.el 的新实现(从 revno 108614 开始,Emacs 主干的一部分)"

于 2012-11-06T17:32:49.190 回答