21

I recently switched to using GNU Emacs 24 from 23, and I notice that whenever I enter gud the *input/output* buffer is open. I have close it manually with C-x 0 everytime I debug. Can anyone point me to the correct variable which needs to be configured in order to stop displaying this buffer by default?

3 Answers 3

13

There is a 'gud-gdb' in new emacs releases that implement the old behavior of gdb/emacs interaction (no dedicated-windows and no I/O buffer). If you don't want to call M-x gud-gdb when you use it you can define an alias for M-x gdb

2
  • 1
    thanx .. the default gdb behavior is undesired, given that M-x gdb-many-windows has existed forever..
    – vrdhn
    Dec 31, 2013 at 6:02
  • 1
    this is not the gdb behavior before the windows were locked into place and buffer switching was prevented. This looks to be ancient gdb behavior in emacs before source code arrows etc, gosh, ~1985? Like running it inside a shell in emacs.
    – user10469346
    Dec 19, 2018 at 21:51
7

I have this problem as well. After a quick look at the source code, the problem appears to be that GUD dedicates most of its windows (that is, it calls set-window-dedicated-p on them). A dedicated window is one that cannot be switched away from. I guess more and more young guns are using GUD in many windows mode and want GUD to manage their window layout, and those of us that like to do that manually are in the minority. There doesn't seem to be anything obvious in gdb-mi.el that disables this behavior (for example, gdb-set-window-buffer seems to always do a set-window-dedicated-p to t for all windows it manages).

For now, this solution is more or less the one I'm using -- I manually deactivate the window dedication. This seems suboptimal, though. There ought to be some way to get GUD to let you manually manage the window layout. This question is related.

2
  • For some reason, your fix only works for a little bit - then the window pops up again in dedicated mode, each time it gets a new output.
    – Tom Swirly
    Jan 16, 2015 at 20:00
  • 1
    by 'young guns' you mean people who are not emacs users who are forcing gdb to look like their favorite other tool that is not nearly as powerful. In the minority, I doubt it, everyone I know has this behavior switched off. Though now I'm running into fixes for this breaking other things. A central design feature of emacs is that it puts the user in control of the interface. This takes us back to an interfaced forced upon us, it forces me to look at a buffer that has no meaningful information, while preventing me from switching to a buffer that I want to see.
    – user10469346
    Dec 19, 2018 at 20:21
6

You can disable window dedication altogether like this: (in Emacs 24.4+)

(defun set-window-undedicated-p (window flag)
 "Never set window dedicated."
 flag)

(advice-add 'set-window-dedicated-p :override #'set-window-undedicated-p)

Note that this doesn't affect already dedicated windows.

Your Answer

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

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