Emacs的Python模式比较 [英] Comparison of Python modes for Emacs

查看:123
本文介绍了Emacs的Python模式比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有Emacs 24.3,它是一个相当近的 python.el 文件提供了一个Python模式进行编辑。

So I have Emacs 24.3 and with it comes a quite recent python.el file providing a Python mode for editing.

但是我继续阅读在 python-mode.el -devs / python-mode / python-mode / view / head:/python-mode.el> Launchpad ,并比较两个文件,它跳到我前面的4000行以下,而后者几乎是20000,这表明后者是功能更丰富的。

But I keep reading that there is a python-mode.el on Launchpad, and comparing the two files it jumps out to me that the former is under 4000 lines, while the latter is almost 20000. This suggests that the latter is much more feature-rich.

我找不到任何在线功能比较关于他们,文档或至少一个列出每个功能的功能。是的,有语法高亮和嵌入式解释器,但是如何在shell缓冲区中完成,源文件缓冲区完成,自动缩进,重新等等。

And I can't find any online feature comparison about them, documentation, or at least a list about the features for each of them. Yep, there is syntax highlighting and embedded interpreter, but what about completion in shell buffer, completion in source file buffer, autoindent, reindent etc.

那么什么是重要的功能的这些模式? (或任何其他Python模式的Emacs,你推荐。)请提供详细的答案。

So what are the important features of these modes? (Or any other Python mode for Emacs which you recommend.) Please provide detailed answers.

推荐答案

我是python-mode.el用户一年前就退出使用它,因为我觉得它的开发方式并没有很好的组织。这是从当时笔记中的列表。但是,我需要提醒你,自那以后经过将近一年,所以情况可能会改变。

I was python-mode.el user once but quit using it a year ago because I felt the way it was developed was not well organized. Here is a list from the note I took at that time. But I need to warn you that almost a year is passed since then so the situation may be changed.


  1. 粘贴功能。

  2. 许多意外的工作代码。例如,不要传递变量,而是使用隐式绑定。这会产生许多编译错误(如果将其更改为词法范围,则将不起作用)。

  3. 提交的粗细粒度。我发送一个补丁,它承诺了无关的更改。

我喜欢python-mode.el的一件事是它附带自动化测试集(尽管我从来没有运行过)。 python.el还没有测试集。但是我知道python.el的作者现在正在编写它。

One thing I like about python-mode.el is it comes with automated test set (although I've never run it). python.el does not have a test set yet. But I know the author of python.el is writing it now.

虽然python.el是紧凑的,但并不意味着你的功能差。它更像是保持核心小,让别人通过提供简洁的API来扩展它。 python.el的同一个作者写了 python-django.el 来扩展python.el for django项目。我为Python编写了自动完成插件,称为 Jedi.el 和高级IPython插件,名为EIN 的。他们都比python-mode.el更好地支持python.el(嗯,那是因为我不使用python-mode.el)。

While python.el is compact, it does not mean you get poor functionality. It is more like keeping core small and let others to extend it by providing concise API. Same author of python.el wrote python-django.el to extend python.el for django projects. I wrote auto-completion plugin for Python called Jedi.el and advanced IPython plugin called EIN. Both of them have better support for python.el than python-mode.el (well, that's because I don't use python-mode.el, though).

我有一些我从python-mode.el中遗漏的东西,但是他们很快就在python.el中修复(当然这可能意味着我没有在python-mode.el中使用太多的功能)。 >

I had a few thing I missed from python-mode.el first, but they are quickly fixed in python.el (Of course, this probably means that I was not using so much functionality in python-mode.el).


在shell缓冲区中完成,源文件缓冲区中的完成,autoindent,reindent等。

what about completion in shell buffer, completion in source file buffer, autoindent, reindent etc.




  • shell缓冲区中的完成:
    它在python.el和python-mode.el中都可以工作。但有时候,如果您使用Emacs版本和python(-mode).el版本的组合不正确,则无法正常工作。所以大概python.el是这样安全的。
    但是如果您想要更好的解决方案,请使用 EIN :)

    源文件缓冲区中的完成:
    只需使用 Jedi.el :)

    completion in source file buffer: Just use Jedi.el :)

    autoindent / reindent:
    我不知道哪一个在性能方面更好。然而,返回的keybind与另一个不同。在python-mode.el中,如果你键入RET,你会得到自动缩进。在python.el中,RET不给你缩进,你应该使用C-j。实际上C-j用于换行+缩进是Emacs中的普遍行为。所以如果你用其他语言编程,python.el会更好。

    autoindent/reindent: I don't know which one is better in performance-wise. However, keybind for return differs one to the other. In python-mode.el, if you type RET you get autoindent. In python.el, RET does not give you indentation and you should use C-j instead. Actually C-j for newline+indentation is universal behavior in Emacs. So python.el is better if you do programming in other languages.

    这篇关于Emacs的Python模式比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆