unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Kazuhiro Ito <kzhr@d1.dion.ne.jp>, 9311@debbugs.gnu.org
Subject: bug#9311: 23.3.50; Can't load some byte-compiled files on Windows
Date: Tue, 30 Aug 2011 12:31:05 -0400	[thread overview]
Message-ID: <jwvippe7ts2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87r542or81.fsf@gmx.de> (Michael Albinus's message of "Tue, 30 Aug 2011 17:26:38 +0200")

> In order to let Tramp continue its work, we have accepted remote file
> names with a leading volume letter, which are removed by Tramp
> then. This worked almost OK, except such cases as discussed in the
> current (and earlier) bug reports.
> Eli did suggest to remove this hack from Tramp, and to see during the
> test where the unexpected volume letter prefix happens. Problems shall
> be fixed there.

Sounds good.  We should fix it right instead of using the current workaround.

> @@ -861,13 +861,8 @@
>  Also see `tramp-file-name-structure'.")
 
>  ;;;###autoload
> -(defconst tramp-root-regexp
> -  (if (memq system-type '(cygwin windows-nt))
> -      "\\`\\([a-zA-Z]:\\)?/"
> -    "\\`/")
> -  "Beginning of an incomplete Tramp file name.
> -Usually, it is just \"\\\\`/\".  On W32 systems, there might be a
> -volume letter, which will be removed by `tramp-drop-volume-letter'.")
> +(defconst tramp-root-regexp "\\`/"
> +  "Beginning of an incomplete Tramp file name.")

Looks OK.

> @@ -1503,7 +1498,7 @@
>  but the remote system is Unix, this introduces a superfluous drive
>  letter into the file name.  This function removes it."
>  	(save-match-data
> -	  (if (string-match tramp-root-regexp name)
> +	  (if (string-match "\\`[a-zA-Z]:/" name)
>  	      (replace-match "/" nil t name)
>  	    name)))
 
Shouldn't tramp-drop-volume-letter disappear completely?


        Stefan


PS: by the way, here's a tiny informational patch about common
subexpression elimination and about how to silence the compiler
without a hack.


=== modified file 'lisp/net/tramp.el'
--- lisp/net/tramp.el	2011-07-24 14:57:37 +0000
+++ lisp/net/tramp.el	2011-08-30 16:27:59 +0000
@@ -871,9 +871,8 @@
 
 ;;;###autoload
 (defconst tramp-completion-file-name-regexp-unified
-  (if (memq system-type '(cygwin windows-nt))
-      (concat tramp-root-regexp "[^/]\\{2,\\}\\'")
-    (concat tramp-root-regexp "[^/]*\\'"))
+  (concat tramp-root-regexp (if (memq system-type '(cygwin windows-nt))
+                                "[^/]\\{2,\\}\\'" "[^/]*\\'"))
   "Value for `tramp-completion-file-name-regexp' for unified remoting.
 GNU Emacs uses a unified filename syntax for Tramp and Ange-FTP.
 See `tramp-file-name-structure' for more explanations.
@@ -1494,9 +1493,9 @@
 (tramp-compat-font-lock-add-keywords
  'emacs-lisp-mode '("\\<tramp-with-progress-reporter\\>"))
 
-(eval-and-compile			;; Silence compiler.
+(defalias 'tramp-drop-volume-letter
   (if (memq system-type '(cygwin windows-nt))
-      (defun tramp-drop-volume-letter (name)
+      (lambda (name)
 	"Cut off unnecessary drive letter from file NAME.
 The functions `tramp-*-handle-expand-file-name' call `expand-file-name'
 locally on a remote file name.  When the local system is a W32 system
@@ -1506,8 +1505,7 @@
 	  (if (string-match tramp-root-regexp name)
 	      (replace-match "/" nil t name)
 	    name)))
-
-    (defalias 'tramp-drop-volume-letter 'identity)))
+    #'identity))
 
 ;;; Config Manipulation Functions:
 






  reply	other threads:[~2011-08-30 16:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17  0:24 bug#9311: 23.3.50; Can't load some byte-compiled files on Windows Kazuhiro Ito
2011-08-17  8:55 ` Eli Zaretskii
2011-08-30 13:45   ` Michael Albinus
2011-08-30 14:33     ` Stefan Monnier
2011-08-30 15:26       ` Michael Albinus
2011-08-30 16:31         ` Stefan Monnier [this message]
2011-08-31  9:56           ` Michael Albinus
2011-08-30 17:54         ` Eli Zaretskii
2011-08-17 12:50 ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvippe7ts2.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=9311@debbugs.gnu.org \
    --cc=kzhr@d1.dion.ne.jp \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).