2

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

2 Answers 2

7

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

Sign up to request clarification or add additional context in comments.

2 Comments

I thought at first that this snippet had no effect but then realized maybe I'm supposed to change 'my-mode-hook to 'python-mode-hook. True? I'm new to using hooks.
Sorry! I blindly went through and changed things from my actual user name to "my", and did one too many. It is shell-mode-hook you want, not my-mode-hook nor python-mode-hook.
3

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)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.