changeset 100857:51f12f881f02

* net/tramp-smb.el (top): Use `tramp-prefix-domain-regexp'. (tramp-smb-maybe-open-connection): Use `tramp-file-name-*' methods.
author Michael Albinus <michael.albinus@gmx.de>
date Sat, 03 Jan 2009 14:59:12 +0000
parents 49bc8bb7a597
children 676cda349ee9
files lisp/net/tramp-smb.el
diffstat 1 files changed, 10 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/tramp-smb.el	Sat Jan 03 14:58:15 2009 +0000
+++ b/lisp/net/tramp-smb.el	Sat Jan 03 14:59:12 2009 +0000
@@ -1,7 +1,7 @@
 ;;; tramp-smb.el --- Tramp access functions for SMB servers
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;;   2009 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -44,7 +44,7 @@
 ;; Add a default for `tramp-default-method-alist'. Rule: If there is
 ;; a domain in USER, it must be the SMB method.
 (add-to-list 'tramp-default-method-alist
-	     `(nil "%" ,tramp-smb-method))
+	     `(nil ,tramp-prefix-domain-regexp ,tramp-smb-method))
 
 ;; Add a default for `tramp-default-user-alist'. Rule: For the SMB method,
 ;; the anonymous user is chosen.
@@ -905,20 +905,13 @@
 		  (executable-find tramp-smb-program))
 	  (error "Cannot find command %s in %s" tramp-smb-program exec-path))
 
-	(let* ((user (tramp-file-name-user vec))
-	       (host (tramp-file-name-host vec))
-	       (real-user user)
-	       (real-host host)
-	       domain port args)
-
-	  ;; Check for domain ("user%domain") and port ("host#port").
-	  (when (and user (string-match "\\(.+\\)%\\(.+\\)" user))
-	    (setq real-user (or (match-string 1 user) user)
-		  domain (match-string 2 user)))
-
-	  (when (and host (string-match "\\(.+\\)#\\(.+\\)" host))
-	    (setq real-host (or (match-string 1 host) host)
-		  port (match-string 2 host)))
+	(let* ((user      (tramp-file-name-user vec))
+	       (host      (tramp-file-name-host vec))
+	       (real-user (tramp-file-name-real-user vec))
+	       (real-host (tramp-file-name-real-host vec))
+	       (domain    (tramp-file-name-domain vec))
+	       (port      (tramp-file-name-port vec))
+	       args)
 
 	  (if share
 	      (setq args (list (concat "//" real-host "/" share)))