python-mode 6.0.12在返回或传递后缩进

时间:2012-11-29 00:09:51

标签: python emacs mode

我在emacs中使用python-mode。 我已经使用了1个月而没有任何问题。

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

EG

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

2 个答案:

答案 0 :(得分:1)

在来自Emacs的默认python-mode(即python.el而不是python-mode.el)中,我无法重现您的问题。所以,也许您正在使用python-mode.el,而只需切换到内置python-mode

答案 1 :(得分:1)

无法使用trunk重现。 如果可能,请查看。

bzr branch lp:python-mode

在github也存在一面镜子。

错误最好归档于

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