Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off *input/output* buffer in gud

Tags:

emacs

gdb

gud

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?

like image 926
debamitro Avatar asked Nov 26 '12 08:11

debamitro


3 Answers

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

like image 64
RodrigoP Avatar answered Oct 21 '22 01:10

RodrigoP


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.

like image 43
808140 Avatar answered Oct 21 '22 01:10

808140


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.

like image 6
AnttiH Avatar answered Oct 21 '22 00:10

AnttiH