Subject: Re: bug#21777: 25.0.50; gud-gdb uses a pager, which is harmful inside emacs

From: Dima Kogan <[email-masked]>
Date: Thu, 29 Oct 2015 20:43:35 -0700

Dima Kogan <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>
>>> From: Dima Kogan <[email-masked]>
>>>
>>> 3. handle this inside emacs, not relying on gdb behavior
>> 
>> 3 is okay in principle, but you didn't show any specific suggestions.
>> What did you have in mind?
>
> gud-gdb.el can send a "set height unlimited" command when it starts the
> gdb process. I'm happy to give you a patch, if you want.

Something like this:

---------------------------------------------------------------------------
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 9ab0667..61ae85c 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -785,6 +785,8 @@ directory and source-file directory for your debugger."
   (setq gdb-first-prompt t)
   (setq gud-running nil)
   (setq gud-filter-pending-text nil)
+
+  (gud-basic-call "set height unlimited")
   (run-hooks 'gud-gdb-mode-hook))
 
 ;; The completion process filter indicates when it is finished.
---------------------------------------------------------------------------

This works. The main issue is that it creates an extra "(gdb)" prompt
we'd want to suppress. You get the idea, however.