Subject: Re: bug#21528: 25.0.50; gud tries to guess what file we're debugging, which can take a long time

From: Eli Zaretskii <[email-masked]>
Date: Mon, 21 Sep 2015 10:04:28 +0300

> From: Dima Kogan <[email-masked]>
> Date: Sun, 20 Sep 2015 19:50:21 -0700
> 
> Hi. Currently when the user invokes any gud-based mode ('M-x pdb' for
> instance) the minibuffer pops up with a suggested command. This command
> tries to guess what you're trying to debug based on some pretty
> arbitrary heuristics. This is in 'gud-query-cmdline' in gud.el
> 
> These heuristics include looking at each file in the current directory
> to find the most recent executable file. In my experience this almost
> never is what I want. If I'm doing remote debugging with tramp and the
> current directory has many files in it, then emacs can sit there for a
> very long time before opening the minibuffer, while it looks at all the
> files in the remote directory. I think this delay changes this behavior
> from not-useful to harmful, and I think it should be removed. Thoughts?

Removing it altogether, based on your personal and very specific use
case, would be too drastic, IMO.  Can you propose some less drastic
measure?  If nothing smarter could be done automatically, a defcustom
to control this should be a stopgap, I think.

And while at that: the search for executables could bypass certain
files, like shell scripts, for example.