el/dot-emacs.el: Prevent GUD-Gdb from making its windows be `dedicated'.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 22 Jun 2018 16:54:20 +0000 (17:54 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 22 Jun 2018 16:56:00 +0000 (17:56 +0100)
Otherwise it's really hard to override its wrong decisions about where
to put things.

el/dot-emacs.el

index 86ba4d5..a75d95c 100644 (file)
@@ -4106,6 +4106,19 @@ there is sadness."
 (add-hook 'find-file-hook 'mdw-try-smerge t)
 
 ;;;--------------------------------------------------------------------------
+;;; GUD, and especially GDB.
+
+;; Inhibit window dedication.  I mean, seriously, wtf?
+(defadvice gdb-display-buffer (after mdw-undedicated (buf) compile activate)
+  "Don't make windows dedicated.  Seriously."
+  (set-window-dedicated-p ad-return-value nil))
+(defadvice gdb-set-window-buffer
+    (after mdw-undedicated (name &optional ignore-dedicated window)
+     compile activate)
+  "Don't make windows dedicated.  Seriously."
+  (set-window-dedicated-p (or window (selected-window)) nil))
+
+;;;--------------------------------------------------------------------------
 ;;; MPC configuration.
 
 (eval-when-compile (trap (require 'mpc)))