首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >python-mode 6.0.12在return或pass之后缩进

python-mode 6.0.12在return或pass之后缩进
EN

Stack Overflow用户
提问于 2012-11-29 08:09:51
回答 2查看 347关注 0票数 1

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

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

例如

代码语言:javascript
复制
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:

代码语言:javascript
复制
(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自动保存列表

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-11-29 15:26:59

不能用树干繁殖。如果可能的话,请检查一下。

bzr分支lp:python-mode

在github上也存在一个镜像。

Bugs最好在

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

票数 1
EN

Stack Overflow用户

发布于 2012-11-29 12:15:08

在来自Emacs的默认python-mode (即与python-mode.el相对的python.el )中,我无法重现您的问题。因此,您可能正在使用python-mode.el,可以简单地切换到内置python-mode

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13616691

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档