Subject: RE: bug#11385: 24.0.96; `image-dired-create-thumb': (file-error "Setting current directory" "no such file or directory" "$HOME/")

From: "Drew Adams" <[email-masked]>
Date: Sat, 12 May 2012 09:02:42 -0700

> I don't see the problem.  Feel free to keep debugging.

The question is whether the string passed to `call-process' is legitimate, and
if so, why it raises an error.  This is the string:

* call-process("C:/cygwin/bin/bash.exe" nil nil nil "-c" #("convert -size
100x100 \".emacs-bmk-bmenu-image-file-icon.png\" -resize \"100x100>\" -strip
jpeg:\"c:/.emacs.d/image-dired/.emacs-bmk-bmenu-image-file-icon_296198de66b39419
757fa05281dd3766.thumb.png\"" 23 59 (mouse-face highlight)))

It is the `image-dired-create-thumb' code that creates that string, not I.

Again, this is the error raised:

Debugger entered--Lisp error:
(file-error "Setting current directory" "no such file or directory"
 "c:/drews-lisp-20/$HOME/")

I don't see code in `image-dired-create-thumb' that refers to the directory, so
I don't know where that error is coming from.

But clearly either (a) the caller (whoever it is) should have converted
"c:/drews-lisp-20/$HOME/" to the value of $HOME (which is "c:/" in this case) or
(b) the consumer of "c:/drews-lisp-20/$HOME/" should itself interpret it
correctly.

IOW, something is wrong, I think, in `image-dired-create-thumb', since it seems
to be called with legitimate arguments and it raises an error.

Again, this is the call to `image-dired-create-thumb':

image-dired-create-thumb(#(".emacs-bmk-bmenu-image-file-icon.png" 0 36
(mouse-face highlight))
"c:/.emacs.d/image-dired/.emacs-bmk-bmenu-image-file-icon_296198de66b39419757fa0
5281dd3766.thumb.png")

As you can see, there is nothing here about "c:/drews-lisp-20/$HOME/".

And that function was called from this, which also seems legitimate:

image-dired-get-thumbnail-image(#(".emacs-bmk-bmenu-image-file-icon.png" 0 36
(mouse-face highlight)))

Surely `image-dired-get-thumbnail-image' should be able to return an image file
or raise its own pertinent error (which it does): (error "%s is not a valid
image file" file).  It should not be the case that some low-level code raises an
error here (and why does it?).