[Top][All Lists]

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

Don't change default-directory in gud.el?

From: Nick Roberts
Subject: Don't change default-directory in gud.el?
Date: Wed, 3 Nov 2004 13:49:47 +1300

Currently, in gud.el, the default-directory of the GUD buffer gets set from
the pathname (if any) of the program to be debugged. This is not consistent
what happens if gdb is invoked from the command line, where the working
directory remains unchanged. As a general rule, I find it more annoying if
Emacs does something that I don't want than if it doesn't do something I do
want (Another example is Jan Nieuwenhuizen's grumble about M-x gdb guessing
the name of the executable).

As an example of where setting the default-directory doesn't really work. If
I have:

Run gdb (like this): gdb --annotate=3 ~/emacs/src/emacs core.1825

As Emacs sets default-directory to ~/emacs/src/, gdb sets the breakpoints in
~/emacs/src/.gdbinit that I don't want and can't find the core file.

So I'd like to remove the following from gud.el:

    (and file-word
         ;; Don't set default-directory if no directory was specified.
         ;; In that case, either the file is found in the current directory,
         ;; in which case this setq is a no-op,
         ;; or it is found by searching PATH,
         ;; in which case we don't know what directory it was found in.
         (file-name-directory file)
         (setq default-directory (file-name-directory file)))

Any objections?


reply via email to

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