M-x pdb is great while debugging. When the python process exits though, often there is a traceback left behind in the gud buffer that I'd like to view using compilation-mode so I can use next-error to step through the stack frames.

I can always M-x compilation-mode on python exit. Can I have emacs automatically do that for me?

  • In realgud (available from MELPA), the way this is handled is that there is a function realgud:goto-lang-backtrace-line bound to C-C ! ! So you just position yourself on the traceback line and that enter C-C !! and the location will come up in another bugger. – rocky Oct 21 '15 at 17:23
  • Another what? This is more than 15 characters long. – Croad Langshan Nov 21 '15 at 16:37
  • bugger->buffer (or rather buffer window in the same display). – rocky Nov 21 '15 at 18:11
(defun my/turn-on-compilation-shell-minor-mode ()
  (compilation-shell-minor-mode t))
(add-hook 'pdb-mode-hook #'my/turn-on-compilation-shell-minor-mode)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.