简体   繁体   中英

Emacs: using pdbtrack (python.el)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM