From 89051e74a6ec620f7615ca9ddbf4db479b9cf4f9 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 31 Aug 2011 10:18:20 +0200 Subject: [PATCH] * net/tramp.el (tramp-root-regexp): Remove. (tramp-completion-file-name-regexp-unified) (tramp-completion-file-name-regexp-separate) (tramp-completion-file-name-regexp-url): Don't use leading volume letter on win32 systems. (Bug#5303, Bug#9311) (tramp-drop-volume-letter): Simplify definition. Suggested by Stefan Monnier . --- lisp/ChangeLog | 10 ++++++++++ lisp/net/tramp.el | 24 +++++++----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 946b51b70c9..c15ad742982 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2011-08-31 Michael Albinus + + * net/tramp.el (tramp-root-regexp): Remove. + (tramp-completion-file-name-regexp-unified) + (tramp-completion-file-name-regexp-separate) + (tramp-completion-file-name-regexp-url): Don't use leading volume + letter on win32 systems. (Bug#5303, Bug#9311) + (tramp-drop-volume-letter): Simplify definition. Suggested by + Stefan Monnier . + 2011-08-30 Stefan Monnier * subr.el (event-modifiers): Fix "missing modifier" part of docstring diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 9b11ef58eab..274bc72391b 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -861,19 +861,9 @@ updated after changing this variable. 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'.") - -;;;###autoload (defconst tramp-completion-file-name-regexp-unified (if (memq system-type '(cygwin windows-nt)) - (concat tramp-root-regexp "[^/]\\{2,\\}\\'") - (concat tramp-root-regexp "[^/]*\\'")) + "\\`/[^/]\\{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. @@ -882,14 +872,14 @@ On W32 systems, the volume letter must be ignored.") ;;;###autoload (defconst tramp-completion-file-name-regexp-separate - (concat tramp-root-regexp "\\([[][^]]*\\)?\\'") + "\\`/\\([[][^]]*\\)?\\'" "Value for `tramp-completion-file-name-regexp' for separate remoting. XEmacs uses a separate filename syntax for Tramp and EFS. See `tramp-file-name-structure' for more explanations.") ;;;###autoload (defconst tramp-completion-file-name-regexp-url - (concat tramp-root-regexp "[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?\\'") + "\\`/[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?\\'" "Value for `tramp-completion-file-name-regexp' for URL-like remoting. See `tramp-file-name-structure' for more explanations.") @@ -1494,20 +1484,20 @@ progress reporter." (tramp-compat-font-lock-add-keywords 'emacs-lisp-mode '("\\")) -(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 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))) - (defalias 'tramp-drop-volume-letter 'identity))) + 'identity)) ;;; Config Manipulation Functions: -- 2.11.4.GIT