title: Emacs elisp expand-file-name behaviour on windows
body: <p>I encountered strange behaviour of expand-file-name function on windows during installation of last cedet using el-get. The issue is related to generation of autoloads.</p>
  
  <p>The autoload.el on last emacs 24.1.50 contains the following function:</p>
  
  <pre><code>(defun autoload-generated-file ()
    (expand-file-name generated-autoload-file
                  ;; File-local settings of generated-autoload-file should
                  ;; be interpreted relative to the file's location,
                  ;; of course.
                  (if (not (local-variable-p 'generated-autoload-file))
                      (expand-file-name "lisp" source-directory))))
  </code></pre>
  
  <p>In my case generated-autoload-file is:</p>
  
  <pre><code>"/home/ngulyamov/.emacs.d/el-get/cedet/lisp/cedet/srecode/loaddefs.el" 
  </code></pre>
  
  <p>as I have $HOME$ environment variable pointed to C:/home/ngulyamov. In this case above function returns:</p>
  
  <pre><code>"d:/home/ngulyamov/.emacs.d/el-get/cedet/lisp/cedet/srecode/loaddefs.el" 
  </code></pre>
  
  <p>due to source-directory contains:</p>
  
  <pre><code>"d:/devel/emacs/emacs-bzr/trunk_jenkins/".
  </code></pre>
  
  <p>As you can see it changes drive letter from C: to D:.
  At the same time on emacs 23.3 this function returns semi-correct value as source-directory contains value:</p>
  
  <pre><code>"c:/Users/Sean/Downloads/emacs-23.3/".
  </code></pre>
  
  <p>According to expand-file-name function description:</p>
  
  <p><i>
  (expand-file-name NAME &amp;optional DEFAULT-DIRECTORY)</p>
  
  <p>Convert filename NAME to absolute, and canonicalize it.
  Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative
  <b>(does not start with slash or tilde)</b>; if DEFAULT-DIRECTORY is nil or missing,
  the current buffer's value of `default-directory' is used.
  </i></p>
  
  <p>The paths on Windows never start from slash or tilde.</p>
  
  <p>Now my questions:
  1. Does expand-file-name function behaviour correct on Windows?
  2. Why source-directory contains value of developers paths?</p>
  
  <p>Could we consider expand-file-name as buggy on windows? Or it is just wrongly used in autoload.el?</p>
  
  <p>Thank you in advance.</p>