1

我在 emacs 中使用 python 模式。我已经使用了 1 个月,没有任何问题。

现在我有一个问题,每当我在类中“返回”或“传递”一个函数时,缩进就会返回到下一行的开头

例如

class test(object):
    def method1(self):
        return 1
|cursor returns here, cant press tab to indent
    |cursor should be here, tab should allow free indentation

如果我不返回或“通过”,我没有问题。我不知道这是什么原因造成的。

我的 .emacs:

(add-to-list 'load-path "~/.emacs.d/")
(require 'lambda-mode)
(add-hook 'python-mode-hook #'lambda-mode 1)
(setq lambda-symbol (string (make-char 'greek-iso8859-7 107)))

(add-to-list 'load-path "~/.emacs.d/python-mode.el-6.0.12") 
(setq py-install-directory "~/.emacs.d/python-mode.el-6.0.12")
(require 'python-mode)
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(inhibit-startup-screen t))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

我的 .emacs.d 包含: lambda-mode.el python-mode.el-6.0.12 auto-save-list

4

2 回答 2

1

python-mode在来自 Emacs的默认设置中(即python.el相对于python-mode.el),我无法重现您的问题。所以也许你正在使用python-mode.el并且可以简单地切换到内置python-mode

于 2012-11-29T04:15:07.573 回答
1

无法用主干重现。如果可能,请检查一下。

bzr 分支 lp:python 模式

在 github 上也存在一个镜像。

错误最好提交在

https://bugs.launchpad.net/python-mode

于 2012-11-29T07:26:58.697 回答