Emacs:使用pdbtrack(python.el) [英] Emacs: using pdbtrack (python.el)

查看:226
本文介绍了Emacs:使用pdbtrack(python.el)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究Emacs作为一个Python IDE。有一个非常好的最新的解决方案:Gabriele Lanar的emacs-for-python。不幸的是,我不能使用pdbtrack。也就是说,放入pdb中,我没有显示Python源缓冲区,光标位于当前行,等等。这样做的唯一方法是这个丑陋的hack: http://page.sourceforge.net/tricks.html#Running_pdb_under_emacs
此外,Gud可能从来没有像过去一样解释语言如Python:(超链接不允许)
有一个讨论, https:/ /github.com/fgallina/python.el/issues/43 ,但它无处可寻。
我还发现了python-pdbtrack-activate变量,但默认情况下它设置为t。有一句希望:BTW应该可以在全局添加pdbtrack过滤器函数,但没有测试,我不认为我会默认激活这样的事情。为什么,我不介意这样的事情在默认情况下是不活动的,我只想知道如何打开它...
通过pdb.set_trace()尽可能地放入调试器的能力是必不可少的,IMO。我希望现在有可能。

解决方案

这不是您的确切问题的答案,但它也解决了您的问题。
我使用emacs术语模式中的 pdb ++ :pdb ++的粘性模式给了我相当于pdbtrack,其优点是不必为每个访问的文件打开缓冲区(因为它只是在缓冲区中显示源代码)。



作为一个额外的好处,我也得到丰富的标签完成作为pdb ++提示: - )



如果你使用py.test,你可能还要检查我的<一个href =https://bitbucket.org/antocuni/pytest-emacs/src/5ba9a434db5d/pytest.el =nofollow> pytest-emacs ,它会自动在术语缓冲区中启动py.test以便pdb可以开箱即用。


I've been studying Emacs as a Python IDE. There's an excellent, up-to-date solution: emacs-for-python by Gabriele Lanar. Unfortunately, I can't employ pdbtrack. That is, dropping into pdb I am not shown Python source buffer with a cursor at the current line, etc. The only way to make it sort of work is this ugly hack: http://page.sourceforge.net/tricks.html#Running_pdb_under_emacs Moreover, Gud probably has never been the way to go with an interpreted language like Python: (hyperlink not allowed) There's one discussion, https://github.com/fgallina/python.el/issues/43 , but it leads nowhere. I've also discovered python-pdbtrack-activate variable, but it's set to t by default anyway. There's one word of hope: "BTW it should be possible to add the pdbtrack filter function globally, but haven't tested and I don't think I would activate such thing by default". Why, I don't mind such thing being inactive by default, I'd just like to know how to turn it on... The ability to drop into the debugger via pdb.set_trace() as nicely as possible is essential, IMO. I hope it's possible right now.

解决方案

This is not an answer to your precise question, but it solves your issue as well. I use pdb++ inside emacs' term mode: pdb++'s "sticky mode" gives me the equivalent of pdbtrack, with the advantage that it doesn't have to open a buffer for each file it visits (because it simply displays the source code in the term buffer).

As an additional bonus, I also get colorful tab completion as the pdb++ prompt :-)

If you use py.test, you might want to check also my pytest-emacs, which automatically starts py.test in a term buffer so that pdb works out of the box.

这篇关于Emacs:使用pdbtrack(python.el)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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