Subject: Re: bug#13921: 24.2; Misbehavior of expand-file-name on Cygwin with Emacs 24.2

From: Barry OReilly <[email-masked]>
Date: Tue, 12 Mar 2013 20:45:45 -0400

I tried the following at the Cygwin shell:

epich@laptop02 ~/sw/cedet/lisp/cedet $  emacs -batch --no-site-file --eval
'(setq debug-on-error t)' -l "../../cedet-remove-builtin.el" -L . --eval
'(progn (require (quote cedet-compat)) (require (quote mode-local)))' -L
../eieio/ -L ./ -L ./ --eval '(progn  (setq generated-autoload-file
"/home/epich/sw/cedet/lisp/cedet/loaddefs.el") (message "DEBUG: expanded
file name is %s source-directory is %s" (expand-file-name
"/home/epich/sw/cedet/lisp/cedet") source-directory))' -f
batch-update-autoloads /home/epich/sw/cedet/lisp/cedet
DEBUG: expanded file name is c:/home/epich/sw/cedet/lisp/cedet
source-directory is d:/devel/emacs/release/emacs24/emacs-24.2/
Debugger entered--Lisp error: (file-error "Opening output file" "no such
file or directory" "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
  write-region(";;; loaddefs.el --- automatically extracted
autoloads\n;;\n;;; Code:\n\n\f\n(provide 'loaddefs)\n;; Local
Variables:\n;; version-control: never\n;; no-byte-compile: t\n;;
no-update-autoloads: t\n;; coding: utf-8\n;; End:\n;;; loaddefs.el ends
here\n" nil "d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")

autoload-ensure-default-file("d:/home/epich/sw/cedet/lisp/cedet/loaddefs.el")
  autoload-find-generated-file()
  update-directory-autoloads("/home/epich/sw/cedet/lisp/cedet")
  apply(update-directory-autoloads "/home/epich/sw/cedet/lisp/cedet")
  batch-update-autoloads()
  command-line-1(("--eval" "(setq debug-on-error t)" "-l"
"../../cedet-remove-builtin.el" "-L" "." "--eval" "(progn (require (quote
cedet-compat)) (require (quote mode-local)))" "-L" "../eieio/" "-L" "./"
"-L" "./" "--eval" "(progn  (setq generated-autoload-file
\"/home/epich/sw/cedet/lisp/cedet/loaddefs.el\") (message \"DEBUG: expanded
file name is %s source-directory is %s\" (expand-file-name
\"/home/epich/sw/cedet/lisp/cedet\") source-directory))" "-f"
"batch-update-autoloads" "/home/epich/sw/cedet/lisp/cedet"))
  command-line()
  normal-top-level()

This shows c: and d: prefixes in the same message evaluation.

I haven't mentioned yet that I don't have a D drive mounted at all.

I tried C-h v source-directory in a running Emacs and found:

   source-directory is a variable defined in `lread.c'.
   Its value is "d:/devel/emacs/release/emacs24/emacs-24.2/"

   Documentation:
   Directory in which Emacs sources were found when Emacs was built.
   You cannot count on them to still be there!

I did not find this /devel/emacs/release/emacs24/emacs-24.2/ on my system,
nor is it the kind of path I would create.  My emacs is at
C:\Users\epich\sw\emacs-24.2 which appears in Cygwin at ~/sw/emacs-24.2
because ~/sw symlinks (MS console command mklink /d) to
/cygdrive/c/Users/epich/sw .

I actually launch Emacs from the Quick Launch on Windows 7, so the C-h v
evaluation has Cygwin out of the equation.  I merely use Cygwin to byte
compile.