I want to see stack trace lines highlighted in GUD and have next-error work there. That works for me if, after starting GUD (via M-x pdb) I enable compilation-shell-minor-mode.

However, if I do this:

(add-hook 'pdb-mode-hook (lambda () (compilation-shell-minor-mode t)))

Then when I run M-x pdb, I get that minor mode enabled, but the matching error lines in the buffer don't get highlighted. I then have to disable and re-enable the minor mode to get the highlighting back.

How can I configure things so that the minor mode works fully as soon as I start GUD?

  • I am not sure why the highlighting doesn't work for you initially: for me it does. It worked with your snippet, but also you could try simply: (add-hook 'pdb-mode-hook 'compilation-shell-minor-mode). From the documentation on compilation-shell-minor-mode: "If called from Lisp, enable the mode if ARG is omitted or nil" – elethan Jan 20 '16 at 2:09
  • I'm not sure why this didn't work for me back then, I believe it works fine now :-/ – Croad Langshan Feb 9 '19 at 14:59

Your Answer

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

Browse other questions tagged or ask your own question.