From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Don't change default-directory in gud.el? Date: Wed, 3 Nov 2004 13:49:47 +1300 Message-ID: <16776.11051.715258.594965@farnswood.snap.net.nz> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1099443382 2233 80.91.229.6 (3 Nov 2004 00:56:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 Nov 2004 00:56:22 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 03 01:56:10 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CP9RZ-0000uV-00 for ; Wed, 03 Nov 2004 01:56:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CP9Zd-0003Wa-Mo for ged-emacs-devel@m.gmane.org; Tue, 02 Nov 2004 20:04:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CP9ZV-0003WF-H1 for emacs-devel@gnu.org; Tue, 02 Nov 2004 20:04:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CP9ZT-0003VN-Mg for emacs-devel@gnu.org; Tue, 02 Nov 2004 20:04:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CP9ZT-0003VK-JA for emacs-devel@gnu.org; Tue, 02 Nov 2004 20:04:19 -0500 Original-Received: from [202.124.110.194] (helo=farnswood.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CP9RB-0000Sz-CL for emacs-devel@gnu.org; Tue, 02 Nov 2004 19:55:46 -0500 Original-Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 834AD627EE; Wed, 3 Nov 2004 00:49:48 +0000 (GMT) Original-To: emacs-devel@gnu.org X-Mailer: VM 6.97 under Emacs 21.2.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29350 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29350 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