GNU bug report logs -
#767
23.0.60; compilation-start gives bad default-directory
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 767 in the body.
You can then email your comments to 767 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
[Message part 1 (text/plain, inline)]
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'
[compile-start-default-directory.diff (text/plain, inline)]
? 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
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Chong Yidong <cyd <at> stupidchicken.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #10 received at 767 <at> emacsbugs.donarmstrong.com (full text, mbox):
> If on w32 default-directory is something like c:\top\sub then the
> subprocess started by compilation-start will get pwd=c:\top.
Does the following patch fix this?
*** trunk/src/callproc.c.~1.240.~ 2008-07-31 12:19:14.000000000 -0400
--- trunk/src/callproc.c 2008-08-26 18:15:59.000000000 -0400
***************
*** 374,379 ****
--- 374,381 ----
a sensible default. */
current_dir = build_string ("~/");
current_dir = expand_and_dir_to_file (current_dir, Qnil);
+ current_dir = Ffile_name_as_directory (current_dir);
+
if (NILP (Ffile_accessible_directory_p (current_dir)))
report_file_error ("Setting current directory",
Fcons (current_buffer->directory, Qnil));
Reply sent to
Chong Yidong <cyd <at> stupidchicken.com>
:
You have taken responsibility.
Full text and
rfc822 format available.
Notification sent to
"Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
:
bug acknowledged by developer.
Full text and
rfc822 format available.
Message #15 received at 767-done <at> emacsbugs.donarmstrong.com (full text, mbox):
I've checked in the fix.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #20 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
> If on w32 default-directory is something like c:\top\sub then the
Then it's a bug. C-h v default-directory says:
Name of default directory of current buffer. Should end with slash.
To interactively change the default directory, use command `cd'.
So if it doesn't end in slash, we have a problem.
Stefan
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #30 received at 767 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier wrote:
>> If on w32 default-directory is something like c:\top\sub then the
>
> Then it's a bug. C-h v default-directory says:
>
> Name of default directory of current buffer. Should end with slash.
> To interactively change the default directory, use command `cd'.
>
> So if it doesn't end in slash, we have a problem.
I never noticed that it must end with a slash and in many circumstances
it works without it.
I suggested that this should be fixed somewhere in start-process and I
think Chong added something along those lines.
Do you suggest something else? (Making Emacs actually require the ending
slash seems is not very backwards compatible.)
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #35 received at 767 <at> emacsbugs.donarmstrong.com (full text, mbox):
> I never noticed that it must end with a slash and in many circumstances
> it works without it.
I know it does in many cases, but as you've found out it doesn't
always work.
> I suggested that this should be fixed somewhere in start-process and I
> think Chong added something along those lines.
I saw that yes. And I think that given the docstring, the patch should
not let-bind default-directory but just setq it (or do nothing at all).
> (Making Emacs actually require the ending slash seems is not very
> backwards compatible.)
AFAIK it's been that way for ever, so backward compatibility is not
really relevant.
Stefan
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #40 received at 767 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier wrote:
>> I suggested that this should be fixed somewhere in start-process and I
>> think Chong added something along those lines.
>
> I saw that yes. And I think that given the docstring, the patch should
> not let-bind default-directory but just setq it (or do nothing at all).
Why not change the doc string instead and say that it is recommended
that default-directory ends with a slash? I do not understand the reason
for your suggestions above.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #45 received at 767 <at> emacsbugs.donarmstrong.com (full text, mbox):
>>> I suggested that this should be fixed somewhere in start-process and I
>>> think Chong added something along those lines.
>> I saw that yes. And I think that given the docstring, the patch should
>> not let-bind default-directory but just setq it (or do nothing at all).
> Why not change the doc string instead and say that it is recommended
> that default-directory ends with a slash?
Because it worked just fine as it is. You still haven't told us where
the offending (non slash-terminated) value came from (which is the
thing that needs to be fixed).
Stefan
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #50 received at 767 <at> emacsbugs.donarmstrong.com (full text, mbox):
Stefan Monnier wrote:
>>>> I suggested that this should be fixed somewhere in start-process and I
>>>> think Chong added something along those lines.
>>> I saw that yes. And I think that given the docstring, the patch should
>>> not let-bind default-directory but just setq it (or do nothing at all).
>> Why not change the doc string instead and say that it is recommended
>> that default-directory ends with a slash?
>
> Because it worked just fine as it is. You still haven't told us where
> the offending (non slash-terminated) value came from (which is the
> thing that needs to be fixed).
It is not a bad question, but I can't remember now. Whatever I try to do
I get an ending slash there (unless I do not set default-directory
myself of course). However I am quite sure I did not get that before.
Something must be different ...
The value of default-directory on w32 may still use \ instead of /. That
is the case after "emacs -Q", but that is another problem.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Eli Zaretskii <eliz <at> gnu.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #55 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Sun, 07 Sep 2008 15:34:10 -0400
> Cc: 767 <at> emacsbugs.donarmstrong.com, emacs-pretest-bug <at> gnu.org
>
> > If on w32 default-directory is something like c:\top\sub then the
>
> Then it's a bug. C-h v default-directory says:
>
> Name of default directory of current buffer. Should end with slash.
> To interactively change the default directory, use command `cd'.
>
> So if it doesn't end in slash, we have a problem.
It does end in a slash on my machine (also on MS-Windows).
I think the original problem is that it uses backslashes instead of
forward slashes.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Eli Zaretskii <eliz <at> gnu.org>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Information forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#767
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
"Lennart Borgman (gmail)" <lennart.borgman <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #65 received at 767 <at> emacsbugs.donarmstrong.com (full text, mbox):
Eli Zaretskii wrote:
>> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
>> Date: Sun, 07 Sep 2008 15:34:10 -0400
>> Cc: 767 <at> emacsbugs.donarmstrong.com, emacs-pretest-bug <at> gnu.org
>>
>>> If on w32 default-directory is something like c:\top\sub then the
>> Then it's a bug. C-h v default-directory says:
>>
>> Name of default directory of current buffer. Should end with slash.
>> To interactively change the default directory, use command `cd'.
>>
>> So if it doesn't end in slash, we have a problem.
>
> It does end in a slash on my machine (also on MS-Windows).
>
> I think the original problem is that it uses backslashes instead of
> forward slashes.
No, but I do not understand now why the final forward slash was missing.
But of course it might also mean trouble that default-directory when you
start Emacs on w32 uses backslashes. Is there any reason not to change that?
bug archived.
Request was from
Debbugs Internal Request <don <at> donarmstrong.com>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Mon, 06 Oct 2008 14:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 16 years and 262 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.