How do I enable pdbtrack python debugging in emacs 24.x shell?

[亡魂溺海] 提交于 2019-12-11 12:00:03

问题


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).


回答1:


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).




回答2:


You can fix this problem by adding the following hook to your .emacs file:

(add-hook 'comint-output-filter-functions 'python-pdbtrack-comint-output-filter-function)


来源:https://stackoverflow.com/questions/26285046/how-do-i-enable-pdbtrack-python-debugging-in-emacs-24-x-shell

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!