Subject: bug#767 closed by Chong Yidong <[email-masked]> (Re: 23.0.60; compilation-start gives bad default-directory)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#767: 23.0.60; compilation-start gives bad default-directory

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
767: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=767
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Sun Sep  7 12:12:05 2008
From: Chong Yidong <[email-masked]>
To: "Lennart Borgman \(gmail\)" <[email-masked]>
Cc: [email-masked]
Subject: Re: 23.0.60; compilation-start gives bad default-directory
Date: Sun, 07 Sep 2008 15:14:50 -0400

I've checked in the fix.

>From [email-masked] Sat Aug 23 06:05:24 2008
Date: Sat, 23 Aug 2008 15:05:04 +0200
From: "Lennart Borgman (gmail)" <[email-masked]>
To: [email-masked]
Subject: 23.0.60; compilation-start gives bad default-directory

This is a multi-part message in MIME format.
--------------090807080508020201020009
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

If on w32 default-directory is something like c:\top\sub then the
subprocess started by compilation-start will get pwd=c:\top.

This can be cured by the attached patch for this special case, but it is
only a demonstration of the problem, not the right fix for this problem.

The attached patch only does

  (let ((default-directory (file-name-as-directory default-directory))

just before calling `start-file-process-shell-command'.

A slightly better fix would probably be to add the same thing in
`start-file-process', but it seems to me that this should handled at the
C level to catch all cases. I do not know where to do that but it must
be done somewhere before make_process in start-process.

In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2008-08-10
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'

--------------090807080508020201020009
Content-Type: text/plain;
 name="compile-start-default-directory.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="compile-start-default-directory.diff"

? compile-start-default-directory.diff
Index: compile.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.476
diff -b -u -r1.476 compile.el
--- compile.el	13 Jun 2008 16:22:16 -0000	1.476
+++ compile.el	23 Aug 2008 12:49:59 -0000
@@ -1246,7 +1246,8 @@
 	    (funcall compilation-process-setup-function))
 	(compilation-set-window-height outwin)
 	;; Start the compilation.
-	(let ((proc
+	(let* ((default-directory (file-name-as-directory default-directory))
+               (proc
 	       (if (eq mode t)
 		   ;; comint uses `start-file-process'.
 		   (get-buffer-process

--------------090807080508020201020009--