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

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 08 Feb 2013 01:15:01 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
11385: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11385
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#11385: 24.0.96; `image-dired-create-thumb': (file-error "Setting current directory" "no such file or directory" "$HOME/")
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Thu, 07 Feb 2013 20:14:47 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

"Drew Adams" wrote:

>> You need to find out who ever sets default-directory to
>> "c:/drews-lisp-20/$HOME/".
>
> Yes, it is my code that (mistakenly) does that.
[...]
> If you don't think so, feel free to close the bug.

Subject: 24.0.96; `image-dired-create-thumb': (file-error "Setting current directory" "no such file or directory" "$HOME/")
From: "Drew Adams" <[email-masked]>
To: <[email-masked]>
Date: Mon, 30 Apr 2012 10:30:46 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

I do not have a recipe from emacs -Q
 
However, I debugged the code that leads to the problem a bit, hoping it
will help. This is from the debugger, just before the error:
 
* 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_028631bce981005b8fb0ffc7b6a1a0f9.thumb.png
\""
   23 59 (mouse-face highlight)))
* image-dired-create-thumb(#(".emacs.png"
   0 36 (mouse-face highlight))
   "c:/.emacs.d/image-dired/.emacs_028631bce981005b8fb0ffc7b6a1a0f9.thumb.png")
* image-dired-get-thumbnail-image(#(".emacs.png"
   0 36 (mouse-face highlight)))
 
In the minibuffer, which is where the current directory is being picked up, I
have this: c:/foo/bar/$HOME/.  My value of env var $HOME is "c:\\".
 
I am not using vanilla Emacs completion.  At the time the debugger was
entered (because I placed `(debug)' in the code), the completion
candidates are displayed in *Completions*, and they are (correctly)
all of the files in c:/.
 
I'm using code that, to display the candidates in *Completions*,
checks whether each is an image file, and if so optionally
displays a thumbnail of the image in *Completions*.  It is this code
that calls `image-dired-get-thumbnail':
 
(when (and (require 'image-dired nil t)
           (string-match-p (image-file-name-regexp) image-file))
  (let ((thumb-img  (append (image-dired-get-thumbnail-image image-file)
                                                             '(:margin 2)))

Debugging shows that (image-dired-thumb-name ".emacs.png") returns
"c:/foo/bar/$HOME/.emacs.png".  Eventually, `image-dired-create-thumb' is
called, and it calls `call-process' as shown above.

In GNU Emacs 24.0.96.1 (i386-mingw-nt5.1.2600)
 of 2012-04-28 on MARVIN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.6) --no-opt --enable-checking --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include'