From b77380d3690fcc1ac032227df29734648874d48c Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Mon, 9 Feb 2015 21:43:37 +0100 Subject: [PATCH] gdb-mi.el (gdb-display-io-nopopup): New defcustom * lisp/progmodes/gdb-mi.el (gdb-inferior-filter): When `gdb-display-io-nopopup' is t, and the output buffer is already buried, don't pop it up. --- lisp/progmodes/gdb-mi.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 27846ed..2233caa 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1629,9 +1629,19 @@ this trigger is subscribed to `gdb-buf-publisher' and called with :syntax-table nil :abbrev-table nil (make-comint-in-buffer "gdb-inferior" (current-buffer) nil)) +(defcustom gdb-display-io-nopopup nil + "When t, and the `gdb-inferior-io' buffer is buried, don't pop it up." + :type 'boolean + :group 'gdb + :version "25.1") + (defun gdb-inferior-filter (proc string) (unless (string-equal string "") - (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))) + (let (buf) + (unless (and (setq buf (gdb-get-buffer 'gdb-inferior-io)) + (null (get-buffer-window buf)) + gdb-display-io-nopopup) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))) (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) (comint-output-filter proc string))) -- 1.8.4