* apply start-process fails because of invalid current directory
@ 2013-07-31 7:46 Pascal Quesseveur
2013-07-31 10:38 ` Juanma Barranquero
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Pascal Quesseveur @ 2013-07-31 7:46 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
From time to time i encounter problems with commands running
start-process for ex. eimp-start-process. Trace follows:
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (file-error "Setting current directory"
"no such file or directory" "y:/")
start-process("eimp-5468Kgf" nil "mogrify" "-resize" "66%"
"c:/Users/pascalq/AppData/Local/Temp/eimp-5468x-x")
apply(start-process "eimp-5468Kgf" nil "mogrify" ("-resize" "66%"
"c:/Users/pascalq/AppData/Local/Temp/eimp-5468x-x"))
...
--8<---------------cut here---------------end--------------->8---
Problem occurs on Windows. Directory y:/ was a removable device
which is no more connected. I have read/written to that directory
before calling start-process. When I connect the device again
start-process runs fine. I have looked through apropos-value for y:/
but I don't see anything valuable.
--
Pascal Quesseveur
pascal.quesseveur@free.fr
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: apply start-process fails because of invalid current directory
2013-07-31 7:46 apply start-process fails because of invalid current directory Pascal Quesseveur
@ 2013-07-31 10:38 ` Juanma Barranquero
2013-07-31 12:37 ` Pascal Quesseveur
2013-07-31 13:05 ` Pascal Quesseveur
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Juanma Barranquero @ 2013-07-31 10:38 UTC (permalink / raw)
To: pascal.quesseveur; +Cc: Emacs Help List
On Wed, Jul 31, 2013 at 9:46 AM, Pascal Quesseveur
<pascal.quesseveur@free.fr> wrote:
> Directory y:/ was a removable device
> which is no more connected.
Then the behavior doesn't seem surprising, though it is hard to say
without a recipe to reproduce it.
Which sequence of commands are you running, and what did you expect to
happen instead?
J
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: apply start-process fails because of invalid current directory
2013-07-31 10:38 ` Juanma Barranquero
@ 2013-07-31 12:37 ` Pascal Quesseveur
2013-07-31 14:10 ` Juanma Barranquero
0 siblings, 1 reply; 12+ messages in thread
From: Pascal Quesseveur @ 2013-07-31 12:37 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: Emacs Help List
>"JB" == Juanma Barranquero <lekktu@gmail.com> a écrit :
JB> Then the behavior doesn't seem surprising, though it is hard to say
JB> without a recipe to reproduce it.
I should have detailed more:
- I plug the device
- I do some things with files on the device
- I unplug the device
- Then I work in a buffer which has nothing to do with the device (gnus)
- I call a command from eimp-mode
- The command fails
JB> Which sequence of commands are you running,
I am unable to tell exactly what I did with device (basically open
files with find-file, update and save) and I am unable to reproduce
the problem but it is not the first time I see it.
--
Pascal Quesseveur
pascal.quesseveur@free.fr
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: apply start-process fails because of invalid current directory
2013-07-31 12:37 ` Pascal Quesseveur
@ 2013-07-31 14:10 ` Juanma Barranquero
0 siblings, 0 replies; 12+ messages in thread
From: Juanma Barranquero @ 2013-07-31 14:10 UTC (permalink / raw)
To: pascal.quesseveur; +Cc: Emacs Help List
On Wed, Jul 31, 2013 at 2:37 PM, Pascal Quesseveur
<pascal.quesseveur@free.fr> wrote:
> I should have detailed more:
>
> - I plug the device
> - I do some things with files on the device
> - I unplug the device
> - Then I work in a buffer which has nothing to do with the device (gnus)
> - I call a command from eimp-mode
> - The command fails
That's weird. You're not starting Emacs from y:\, or you'll get a
warning (from Windows) when trying to unplug the device.
> I am unable to tell exactly what I did with device (basically open
> files with find-file, update and save) and I am unable to reproduce
> the problem but it is not the first time I see it.
Well, if you come with a reproducible recipe please file a bug report.
J
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: apply start-process fails because of invalid current directory
2013-07-31 7:46 apply start-process fails because of invalid current directory Pascal Quesseveur
2013-07-31 10:38 ` Juanma Barranquero
@ 2013-07-31 13:05 ` Pascal Quesseveur
2013-07-31 14:42 ` Juanma Barranquero
2013-07-31 14:47 ` Stefan Monnier
[not found] ` <mailman.2237.1375282221.12400.help-gnu-emacs@gnu.org>
3 siblings, 1 reply; 12+ messages in thread
From: Pascal Quesseveur @ 2013-07-31 13:05 UTC (permalink / raw)
To: help-gnu-emacs
I have looked in the code and the message is sent after a call to
Ffile_acessible_directory_p. The problem seems coming from the fact
there is no file associated with the current-buffer (it is a gnus
article). When the directory is unreachable the code says it uses a
sensible default which is ~/. For some reason it is not working for me
in some situations.
--
Pascal Quesseveur
pascal.quesseveur@free.fr
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: apply start-process fails because of invalid current directory
2013-07-31 7:46 apply start-process fails because of invalid current directory Pascal Quesseveur
2013-07-31 10:38 ` Juanma Barranquero
2013-07-31 13:05 ` Pascal Quesseveur
@ 2013-07-31 14:47 ` Stefan Monnier
[not found] ` <mailman.2237.1375282221.12400.help-gnu-emacs@gnu.org>
3 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2013-07-31 14:47 UTC (permalink / raw)
To: help-gnu-emacs
> From time to time i encounter problems with commands running
> start-process for ex. eimp-start-process. Trace follows:
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (file-error "Setting current directory"
> "no such file or directory" "y:/")
That's a common problem: start-process runs an external process and for
that it needs to decide what the "current working directory" of that
process should be. Elisp says that this should be the directory
specified by `default-directory'.
If your process doesn't use the current directory, then the Elisp code
that runs it should explicitly rebind `default-directory' to some "safe"
choice (e.g. (expand-file-name "~/")) around the call to start-process.
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <mailman.2237.1375282221.12400.help-gnu-emacs@gnu.org>]
* Re: apply start-process fails because of invalid current directory
[not found] ` <mailman.2237.1375282221.12400.help-gnu-emacs@gnu.org>
@ 2013-07-31 15:25 ` Pascal Quesseveur
2013-07-31 18:19 ` Stefan Monnier
[not found] ` <mailman.2253.1375306429.12400.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 12+ messages in thread
From: Pascal Quesseveur @ 2013-07-31 15:25 UTC (permalink / raw)
To: help-gnu-emacs
>"SM" == Stefan Monnier <monnier@iro.umontreal.ca> writes:
SM> That's a common problem: start-process runs an external process
SM> and for that it needs to decide what the "current working
SM> directory" of that process should be. Elisp says that this
SM> should be the directory specified by `default-directory'.
When problem occured I looked at default-directory and if I'm not
mistaken it was not set to y:/
SM> If your process doesn't use the current directory, then the
SM> Elisp code that runs it should explicitly rebind
SM> `default-directory' to some "safe" choice
SM> (e.g. (expand-file-name "~/")) around the call to start-process.
Is that not what is supposed to do start-process?
--
Pascal Quesseveur
pascal.quesseveur@free.fr
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: apply start-process fails because of invalid current directory
2013-07-31 15:25 ` Pascal Quesseveur
@ 2013-07-31 18:19 ` Stefan Monnier
[not found] ` <mailman.2253.1375306429.12400.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2013-07-31 18:19 UTC (permalink / raw)
To: help-gnu-emacs
> When problem occured I looked at default-directory and if I'm not
> mistaken it was not set to y:/
Maybe you looked in a different buffer: each buffer has its own notion
of default-directory.
SM> If your process doesn't use the current directory, then the
SM> Elisp code that runs it should explicitly rebind
SM> `default-directory' to some "safe" choice
SM> (e.g. (expand-file-name "~/")) around the call to start-process.
> Is that not what is supposed to do start-process?
It could, but that would be risky, if you do (start-process "rm -rf
foo") and Emacs decides "oh I can't find the current directory, let's
run this from $HOME instead".
So you have to do it by hand, explicitly.
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <mailman.2253.1375306429.12400.help-gnu-emacs@gnu.org>]
* Re: apply start-process fails because of invalid current directory
[not found] ` <mailman.2253.1375306429.12400.help-gnu-emacs@gnu.org>
@ 2013-08-01 6:22 ` Pascal Quesseveur
0 siblings, 0 replies; 12+ messages in thread
From: Pascal Quesseveur @ 2013-08-01 6:22 UTC (permalink / raw)
To: help-gnu-emacs
>"SM" == Stefan Monnier <monnier@iro.umontreal.ca> writes:
SM> Maybe you looked in a different buffer: each buffer has its own notion
SM> of default-directory.
SM> It could, but that would be risky, if you do (start-process "rm -rf
SM> foo") and Emacs decides "oh I can't find the current directory, let's
SM> run this from $HOME instead".
SM> So you have to do it by hand, explicitly.
Thank you for all these explanations.
--
Pascal Quesseveur
pascal.quesseveur@free.fr
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2013-08-01 6:22 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-31 7:46 apply start-process fails because of invalid current directory Pascal Quesseveur
2013-07-31 10:38 ` Juanma Barranquero
2013-07-31 12:37 ` Pascal Quesseveur
2013-07-31 14:10 ` Juanma Barranquero
2013-07-31 13:05 ` Pascal Quesseveur
2013-07-31 14:42 ` Juanma Barranquero
2013-07-31 15:18 ` Pascal Quesseveur
2013-07-31 15:21 ` Juanma Barranquero
2013-07-31 14:47 ` Stefan Monnier
[not found] ` <mailman.2237.1375282221.12400.help-gnu-emacs@gnu.org>
2013-07-31 15:25 ` Pascal Quesseveur
2013-07-31 18:19 ` Stefan Monnier
[not found] ` <mailman.2253.1375306429.12400.help-gnu-emacs@gnu.org>
2013-08-01 6:22 ` Pascal Quesseveur
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).