【问题标题】:python-mode 6.0.12 indent after return or passpython-mode 6.0.12 返回或通过后缩进
【发布时间】:2012-11-16 23:45:32
【问题描述】:

我在 emacs 中使用 python 模式。 我已经使用了 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 自动保存列表

【问题讨论】:

    标签: python emacs mode


    【解决方案1】:

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

    bzr 分支 lp:python 模式

    在 github 也有镜像。

    最好在以下位置提交错误

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 是的,我正在使用标题中所述的 python-mode6.0.12.el。默认的python模式甚至根本不会自动缩进,所以当然不会发生这个问题
      • 嗯...当我尝试它时默认会自动缩进(但我不使用 Python,所以我很容易被愚弄;-),所以也许你应该报告一个它没有的错误' t 在你的情况下工作(这只有在你使用 Emacs-24 时才有用,因为早期版本有一个完全不同的 python.el 缺少维护者)。
      • 哦,我只使用 emacs 23.3.1,我应该尝试 emacs-24 吗?
      • 那么请报告错误 (M-x report-emacs-bug) 并提供重现问题的精确步骤。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-07
      相关资源
      最近更新 更多