emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of dedicated windows in gdb-mi.el


From: Oleh Krehel
Subject: Re: Use of dedicated windows in gdb-mi.el
Date: Mon, 09 Feb 2015 21:46:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Oleh Krehel <address@hidden>
>> Date: Mon, 09 Feb 2015 21:33:36 +0100
>> Cc: address@hidden, address@hidden, address@hidden
>> 
>> > AFAICS, it's a simple matter of adding a defcustom to be tested in
>> > gdb-display-io-buffer, causing the latter do nothing if the user says
>> > so.
>> 
>> Just instrumented `gdb-display-io-buffer', it's not the function that
>> makes the *output* buffer pop up when there's new output.
>
> Perhaps gdb-inferior-filter, then?

That's it. Here's the patch.

>From b77380d3690fcc1ac032227df29734648874d48c Mon Sep 17 00:00:00 2001
From: Oleh Krehel <address@hidden>
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]