Subject: bug#14030: 24.3; expand-file-name expands remote file name on Windows incorrectly

From: Wolfgang Jenkner <[email-masked]>
Date: Wed, 27 Mar 2013 01:11:13 +0100

On Mon, Mar 25 2013, Michael Albinus wrote:

> I have the impression, that there is a byte-compiler optimization, which
> throws away the call of `tramp-drop-volume-letter' in
> `tramp-sh-handle-expand-file-name'. As I have said earlier,
> (tramp-drop-volume-letter "c:/something") still works correctly.
>
> How could I avoid this eager optimization?

Perhaps like this?

Wolfgang

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index e63acb6..0e4117a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -28,6 +28,12 @@
 
 (eval-when-compile (require 'cl))	; ignore-errors
 (require 'tramp)
+(eval-when-compile
+  ;; Prevent the compiler from inlining the symbol's function
+  ;; definition, which depends on the load-time `system-type', see
+  ;; bug#14030.
+  (fmakunbound 'tramp-drop-volume-letter)
+  (declare-function tramp-drop-volume-letter "tramp" (name)))
 
 ;; Pacify byte-compiler.  The function is needed on XEmacs only.  I'm
 ;; not sure at all that this is the right way to do it, but let's hope