From: Nick Roberts <nickrob@snap.net.nz>
Subject: Don't change default-directory in gud.el?
Date: Wed, 3 Nov 2004 13:49:47 +1300 [thread overview]
Message-ID: <16776.11051.715258.594965@farnswood.snap.net.nz> (raw)
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?
Nick
next reply other threads:[~2004-11-03 0:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-03 0:49 Nick Roberts [this message]
2004-11-03 3:37 ` Don't change default-directory in gud.el? Stefan
2004-11-03 7:29 ` Klaus Zeitler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16776.11051.715258.594965@farnswood.snap.net.nz \
--to=nickrob@snap.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).