如何在emacs 24.x shell中启用pdbtrack python调试? [英] How do I enable pdbtrack python debugging in emacs 24.x shell?

查看:150
本文介绍了如何在emacs 24.x shell中启用pdbtrack python调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用emacs 23.x,pdbtrack集成(给你指向当前代码行的箭头)与常规的 M-x shell RET 一起使用。例如,在使用Makefile运行自动化测试时,这是有用的。



在emacs 24.x中,这不再有效。 / strong>我注意到,如果我使用 Mx python-shell-send-file 运行python脚本,那么pdbtrack集成起作用。但是通过标准emacs shell( Mx shell RET )运行python时,它不起作用。

解决方案

我使用这个代码段:

 (require'python)

defun my-shell-mode-hook()
(add-hook'comint-output-filter-functions'python-pdbtrack-comint-output-filter-function t))

add-hook'shell-mode-hook'my-shell-mode-hook)

以防止pdbtrack的东西从尝试工作在其他缓冲区(例如gdb缓冲区)。


With emacs 23.x, pdbtrack integration (giving you the arrow pointing to the current line of code) works with the regular M-x shell RET. This is useful, for example, to drop into the debugger while running automated tests with a Makefile.

In emacs 24.x, this no longer works. I notice that if I run a python script with M-x python-shell-send-file then the pdbtrack integration works. But it does not work when running python via a standard emacs shell (M-x shell RET).

解决方案

I use this snippet:

(require 'python)

(defun my-shell-mode-hook ()
  (add-hook 'comint-output-filter-functions 'python-pdbtrack-comint-output-filter-function t))

(add-hook 'shell-mode-hook 'my-shell-mode-hook)

to prevent the pdbtrack stuff from trying to work on other buffers (eg gdb buffers).

这篇关于如何在emacs 24.x shell中启用pdbtrack python调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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