diff options
| author | Michael Albinus | 2009-01-03 14:58:15 +0000 |
|---|---|---|
| committer | Michael Albinus | 2009-01-03 14:58:15 +0000 |
| commit | b96e689991dc192612fbe3bcccaa641aae7c1f92 (patch) | |
| tree | 650999d4377050a957d27fc9d63da9288b360d24 | |
| parent | d665fff055b1da90e5b7636e145b55a2cd0d68da (diff) | |
| download | emacs-b96e689991dc192612fbe3bcccaa641aae7c1f92.tar.gz emacs-b96e689991dc192612fbe3bcccaa641aae7c1f92.zip | |
* net/tramp.el (tramp-local-host-regexp)
(tramp-prefix-domain-format)
(tramp-prefix-domain-regexp, tramp-domain-regexp)
(tramp-user-with-domain-regexp, tramp-prefix-ipv6-format)
(tramp-prefix-ipv6-regexp, tramp-ipv6-regexp)
(tramp-postfix-ipv6-format, tramp-postfix-ipv6-regexp): New
defconst.
(tramp-file-name-structure, tramp-file-name-regexp-unified)
(tramp-completion-dissect-file-name, tramp-parse-hosts-group)
(tramp-dissect-file-name, tramp-make-tramp-file-name)
(tramp-completion-make-tramp-file-name): Handle IPv6 addresses.
(tramp-handle-insert-file-contents): Fix setting of
`buffer-read-only'.
(tramp-compute-multi-hops, tramp-local-host-p): Use
`tramp-local-host-regexp'.
(tramp-file-name-real-user, tramp-file-name-domain): Use
`tramp-user-with-domain-regexp'.
| -rw-r--r-- | lisp/net/tramp.el | 157 |
1 files changed, 130 insertions, 27 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 7e364a174ff..e1c61fc12af 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; tramp.el --- Transparent Remote Access, Multiple Protocol | 1 | ;;; tramp.el --- Transparent Remote Access, Multiple Protocol |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 4 | ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; (copyright statements below in code to be updated with the above notice) | 6 | ;; (copyright statements below in code to be updated with the above notice) |
| 7 | 7 | ||
| @@ -758,6 +758,11 @@ matching HOST or USER, respectively." | |||
| 758 | (regexp :tag "User regexp") | 758 | (regexp :tag "User regexp") |
| 759 | (string :tag "Proxy remote name")))) | 759 | (string :tag "Proxy remote name")))) |
| 760 | 760 | ||
| 761 | (defconst tramp-local-host-regexp | ||
| 762 | (concat | ||
| 763 | "^" (regexp-opt (list "localhost" (system-name) "127\.0\.0\.1" "::1") t) "$") | ||
| 764 | "*Host names which are regarded as local host.") | ||
| 765 | |||
| 761 | (defconst tramp-completion-function-alist-rsh | 766 | (defconst tramp-completion-function-alist-rsh |
| 762 | '((tramp-parse-rhosts "/etc/hosts.equiv") | 767 | '((tramp-parse-rhosts "/etc/hosts.equiv") |
| 763 | (tramp-parse-rhosts "~/.rhosts")) | 768 | (tramp-parse-rhosts "~/.rhosts")) |
| @@ -1163,6 +1168,24 @@ Derived from `tramp-postfix-method-format'.") | |||
| 1163 | "[^:/ \t]+" | 1168 | "[^:/ \t]+" |
| 1164 | "*Regexp matching user names.") | 1169 | "*Regexp matching user names.") |
| 1165 | 1170 | ||
| 1171 | (defconst tramp-prefix-domain-format "%" | ||
| 1172 | "*String matching delimeter between user and domain names.") | ||
| 1173 | |||
| 1174 | (defconst tramp-prefix-domain-regexp | ||
| 1175 | (regexp-quote tramp-prefix-domain-format) | ||
| 1176 | "*Regexp matching delimeter between user and domain names. | ||
| 1177 | Derived from `tramp-prefix-domain-format'.") | ||
| 1178 | |||
| 1179 | (defconst tramp-domain-regexp | ||
| 1180 | "[a-zA-Z0-9]+" | ||
| 1181 | "*Regexp matching domain names.") | ||
| 1182 | |||
| 1183 | (defconst tramp-user-with-domain-regexp | ||
| 1184 | (concat "\\(" tramp-user-regexp "\\)" | ||
| 1185 | tramp-prefix-domain-regexp | ||
| 1186 | "\\(" tramp-domain-regexp "\\)") | ||
| 1187 | "*Regexp matching user names with domain names.") | ||
| 1188 | |||
| 1166 | (defconst tramp-postfix-user-format | 1189 | (defconst tramp-postfix-user-format |
| 1167 | "@" | 1190 | "@" |
| 1168 | "*String matching delimeter between user and host names. | 1191 | "*String matching delimeter between user and host names. |
| @@ -1177,6 +1200,37 @@ Derived from `tramp-postfix-user-format'.") | |||
| 1177 | "[a-zA-Z0-9_.-]+" | 1200 | "[a-zA-Z0-9_.-]+" |
| 1178 | "*Regexp matching host names.") | 1201 | "*Regexp matching host names.") |
| 1179 | 1202 | ||
| 1203 | (defconst tramp-prefix-ipv6-format | ||
| 1204 | (cond ((equal tramp-syntax 'ftp) "[") | ||
| 1205 | ((equal tramp-syntax 'sep) "") | ||
| 1206 | ((equal tramp-syntax 'url) "[") | ||
| 1207 | (t (error "Wrong `tramp-syntax' defined"))) | ||
| 1208 | "*String matching left hand side of IPv6 addresses. | ||
| 1209 | Used in `tramp-make-tramp-file-name'.") | ||
| 1210 | |||
| 1211 | (defconst tramp-prefix-ipv6-regexp | ||
| 1212 | (regexp-quote tramp-prefix-ipv6-format) | ||
| 1213 | "*Regexp matching left hand side of IPv6 addresses. | ||
| 1214 | Derived from `tramp-prefix-ipv6-format'.") | ||
| 1215 | |||
| 1216 | ;; The following regexp is a bit sloppy. But it shall serve our purposes. | ||
| 1217 | (defconst tramp-ipv6-regexp | ||
| 1218 | "\\(?:\\(?:[a-zA-Z0-9]+\\)?:\\)+[a-zA-Z0-9]+" | ||
| 1219 | "*Regexp matching IPv6 addresses.") | ||
| 1220 | |||
| 1221 | (defconst tramp-postfix-ipv6-format | ||
| 1222 | (cond ((equal tramp-syntax 'ftp) "]") | ||
| 1223 | ((equal tramp-syntax 'sep) "") | ||
| 1224 | ((equal tramp-syntax 'url) "]") | ||
| 1225 | (t (error "Wrong `tramp-syntax' defined"))) | ||
| 1226 | "*String matching right hand side of IPv6 addresses. | ||
| 1227 | Used in `tramp-make-tramp-file-name'.") | ||
| 1228 | |||
| 1229 | (defconst tramp-postfix-ipv6-regexp | ||
| 1230 | (regexp-quote tramp-postfix-ipv6-format) | ||
| 1231 | "*Regexp matching right hand side of IPv6 addresses. | ||
| 1232 | Derived from `tramp-postfix-ipv6-format'.") | ||
| 1233 | |||
| 1180 | (defconst tramp-prefix-port-format | 1234 | (defconst tramp-prefix-port-format |
| 1181 | (cond ((equal tramp-syntax 'ftp) "#") | 1235 | (cond ((equal tramp-syntax 'ftp) "#") |
| 1182 | ((equal tramp-syntax 'sep) "#") | 1236 | ((equal tramp-syntax 'sep) "#") |
| @@ -1224,11 +1278,14 @@ Derived from `tramp-postfix-host-format'.") | |||
| 1224 | tramp-prefix-regexp | 1278 | tramp-prefix-regexp |
| 1225 | "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp "\\)?" | 1279 | "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp "\\)?" |
| 1226 | "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?" | 1280 | "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?" |
| 1227 | "\\(" tramp-host-regexp | 1281 | "\\(" "\\(" tramp-host-regexp |
| 1228 | "\\(" tramp-prefix-port-regexp tramp-port-regexp "\\)?" "\\)?" | 1282 | "\\|" |
| 1283 | tramp-prefix-ipv6-regexp tramp-ipv6-regexp | ||
| 1284 | tramp-postfix-ipv6-regexp "\\)" | ||
| 1285 | "\\(" tramp-prefix-port-regexp tramp-port-regexp "\\)?" "\\)?" | ||
| 1229 | tramp-postfix-host-regexp | 1286 | tramp-postfix-host-regexp |
| 1230 | "\\(" tramp-localname-regexp "\\)") | 1287 | "\\(" tramp-localname-regexp "\\)") |
| 1231 | 2 4 5 7) | 1288 | 2 4 5 8) |
| 1232 | 1289 | ||
| 1233 | "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \ | 1290 | "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \ |
| 1234 | the Tramp file name structure. | 1291 | the Tramp file name structure. |
| @@ -1248,7 +1305,7 @@ See also `tramp-file-name-regexp'.") | |||
| 1248 | 1305 | ||
| 1249 | ;;;###autoload | 1306 | ;;;###autoload |
| 1250 | (defconst tramp-file-name-regexp-unified | 1307 | (defconst tramp-file-name-regexp-unified |
| 1251 | "\\`/[^/:]+:" | 1308 | "\\`/\\([^[/:]+\\|[^/]+]\\):" |
| 1252 | "Value for `tramp-file-name-regexp' for unified remoting. | 1309 | "Value for `tramp-file-name-regexp' for unified remoting. |
| 1253 | Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and | 1310 | Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and |
| 1254 | Tramp. See `tramp-file-name-structure' for more explanations.") | 1311 | Tramp. See `tramp-file-name-structure' for more explanations.") |
| @@ -4093,7 +4150,7 @@ coding system might not be determined. This function repairs it." | |||
| 4093 | (set 'last-coding-system-used coding-system-used)))) | 4150 | (set 'last-coding-system-used coding-system-used)))) |
| 4094 | 4151 | ||
| 4095 | (when visit | 4152 | (when visit |
| 4096 | (setq buffer-read-only (file-writable-p filename)) | 4153 | (setq buffer-read-only (not (file-writable-p filename))) |
| 4097 | (setq buffer-file-name filename) | 4154 | (setq buffer-file-name filename) |
| 4098 | (set-visited-file-modtime) | 4155 | (set-visited-file-modtime) |
| 4099 | (set-buffer-modified-p nil)) | 4156 | (set-buffer-modified-p nil)) |
| @@ -4874,6 +4931,12 @@ They are collected by `tramp-completion-dissect-file-name1'." | |||
| 4874 | 4931 | ||
| 4875 | (let* ((result) | 4932 | (let* ((result) |
| 4876 | (x-nil "\\|\\(\\)") | 4933 | (x-nil "\\|\\(\\)") |
| 4934 | (tramp-completion-ipv6-regexp | ||
| 4935 | (format | ||
| 4936 | "[^%s]*" | ||
| 4937 | (if (zerop (length tramp-postfix-ipv6-format)) | ||
| 4938 | tramp-postfix-host-format | ||
| 4939 | tramp-postfix-ipv6-format))) | ||
| 4877 | ;; "/method" "/[method" | 4940 | ;; "/method" "/[method" |
| 4878 | (tramp-completion-file-name-structure1 | 4941 | (tramp-completion-file-name-structure1 |
| 4879 | (list (concat tramp-prefix-regexp "\\(" tramp-method-regexp x-nil "\\)$") | 4942 | (list (concat tramp-prefix-regexp "\\(" tramp-method-regexp x-nil "\\)$") |
| @@ -4886,33 +4949,61 @@ They are collected by `tramp-completion-dissect-file-name1'." | |||
| 4886 | (tramp-completion-file-name-structure3 | 4949 | (tramp-completion-file-name-structure3 |
| 4887 | (list (concat tramp-prefix-regexp "\\(" tramp-host-regexp x-nil "\\)$") | 4950 | (list (concat tramp-prefix-regexp "\\(" tramp-host-regexp x-nil "\\)$") |
| 4888 | nil nil 1 nil)) | 4951 | nil nil 1 nil)) |
| 4889 | ;; "/user@host" "/[user@host" | 4952 | ;; "/[ipv6" "/[ipv6" |
| 4890 | (tramp-completion-file-name-structure4 | 4953 | (tramp-completion-file-name-structure4 |
| 4891 | (list (concat tramp-prefix-regexp | 4954 | (list (concat tramp-prefix-regexp |
| 4955 | tramp-prefix-ipv6-regexp | ||
| 4956 | "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") | ||
| 4957 | nil nil 1 nil)) | ||
| 4958 | ;; "/user@host" "/[user@host" | ||
| 4959 | (tramp-completion-file-name-structure5 | ||
| 4960 | (list (concat tramp-prefix-regexp | ||
| 4892 | "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp | 4961 | "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
| 4893 | "\\(" tramp-host-regexp x-nil "\\)$") | 4962 | "\\(" tramp-host-regexp x-nil "\\)$") |
| 4894 | nil 1 2 nil)) | 4963 | nil 1 2 nil)) |
| 4964 | ;; "/user@[ipv6" "/[user@ipv6" | ||
| 4965 | (tramp-completion-file-name-structure6 | ||
| 4966 | (list (concat tramp-prefix-regexp | ||
| 4967 | "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp | ||
| 4968 | tramp-prefix-ipv6-regexp | ||
| 4969 | "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") | ||
| 4970 | nil 1 2 nil)) | ||
| 4895 | ;; "/method:user" "/[method/user" "/method://user" | 4971 | ;; "/method:user" "/[method/user" "/method://user" |
| 4896 | (tramp-completion-file-name-structure5 | 4972 | (tramp-completion-file-name-structure7 |
| 4897 | (list (concat tramp-prefix-regexp | 4973 | (list (concat tramp-prefix-regexp |
| 4898 | "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp | 4974 | "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
| 4899 | "\\(" tramp-user-regexp x-nil "\\)$") | 4975 | "\\(" tramp-user-regexp x-nil "\\)$") |
| 4900 | 1 2 nil nil)) | 4976 | 1 2 nil nil)) |
| 4901 | ;; "/method:host" "/[method/host" "/method://host" | 4977 | ;; "/method:host" "/[method/host" "/method://host" |
| 4902 | (tramp-completion-file-name-structure6 | 4978 | (tramp-completion-file-name-structure8 |
| 4903 | (list (concat tramp-prefix-regexp | 4979 | (list (concat tramp-prefix-regexp |
| 4904 | "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp | 4980 | "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
| 4905 | "\\(" tramp-host-regexp x-nil "\\)$") | 4981 | "\\(" tramp-host-regexp x-nil "\\)$") |
| 4906 | 1 nil 2 nil)) | 4982 | 1 nil 2 nil)) |
| 4983 | ;; "/method:[ipv6" "/[method/ipv6" "/method://[ipv6" | ||
| 4984 | (tramp-completion-file-name-structure9 | ||
| 4985 | (list (concat tramp-prefix-regexp | ||
| 4986 | "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp | ||
| 4987 | tramp-prefix-ipv6-regexp | ||
| 4988 | "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") | ||
| 4989 | 1 nil 2 nil)) | ||
| 4907 | ;; "/method:user@host" "/[method/user@host" "/method://user@host" | 4990 | ;; "/method:user@host" "/[method/user@host" "/method://user@host" |
| 4908 | (tramp-completion-file-name-structure7 | 4991 | (tramp-completion-file-name-structure10 |
| 4909 | (list (concat tramp-prefix-regexp | 4992 | (list (concat tramp-prefix-regexp |
| 4910 | "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp | 4993 | "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
| 4911 | "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp | 4994 | "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
| 4912 | "\\(" tramp-host-regexp x-nil "\\)$") | 4995 | "\\(" tramp-host-regexp x-nil "\\)$") |
| 4913 | 1 2 3 nil)) | 4996 | 1 2 3 nil)) |
| 4997 | ;; "/method:user@[ipv6" "/[method/user@ipv6" "/method://user@[ipv6" | ||
| 4998 | (tramp-completion-file-name-structure11 | ||
| 4999 | (list (concat tramp-prefix-regexp | ||
| 5000 | "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp | ||
| 5001 | "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp | ||
| 5002 | tramp-prefix-ipv6-regexp | ||
| 5003 | "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") | ||
| 5004 | 1 2 3 nil)) | ||
| 4914 | ;; "/method: "/method:/" | 5005 | ;; "/method: "/method:/" |
| 4915 | (tramp-completion-file-name-structure8 | 5006 | (tramp-completion-file-name-structure12 |
| 4916 | (list | 5007 | (list |
| 4917 | (if (equal tramp-syntax 'url) | 5008 | (if (equal tramp-syntax 'url) |
| 4918 | (concat tramp-prefix-regexp | 5009 | (concat tramp-prefix-regexp |
| @@ -4924,7 +5015,7 @@ They are collected by `tramp-completion-dissect-file-name1'." | |||
| 4924 | (concat tramp-prefix-regexp "/$")) | 5015 | (concat tramp-prefix-regexp "/$")) |
| 4925 | 1 3 nil nil)) | 5016 | 1 3 nil nil)) |
| 4926 | ;; "/method: "/method:/" | 5017 | ;; "/method: "/method:/" |
| 4927 | (tramp-completion-file-name-structure9 | 5018 | (tramp-completion-file-name-structure13 |
| 4928 | (list | 5019 | (list |
| 4929 | (if (equal tramp-syntax 'url) | 5020 | (if (equal tramp-syntax 'url) |
| 4930 | (concat tramp-prefix-regexp | 5021 | (concat tramp-prefix-regexp |
| @@ -4949,6 +5040,10 @@ They are collected by `tramp-completion-dissect-file-name1'." | |||
| 4949 | tramp-completion-file-name-structure7 | 5040 | tramp-completion-file-name-structure7 |
| 4950 | tramp-completion-file-name-structure8 | 5041 | tramp-completion-file-name-structure8 |
| 4951 | tramp-completion-file-name-structure9 | 5042 | tramp-completion-file-name-structure9 |
| 5043 | tramp-completion-file-name-structure10 | ||
| 5044 | tramp-completion-file-name-structure11 | ||
| 5045 | tramp-completion-file-name-structure12 | ||
| 5046 | tramp-completion-file-name-structure13 | ||
| 4952 | tramp-file-name-structure)) | 5047 | tramp-file-name-structure)) |
| 4953 | 5048 | ||
| 4954 | (delq nil result))) | 5049 | (delq nil result))) |
| @@ -5151,11 +5246,11 @@ User is always nil." | |||
| 5151 | "Return a (user host) tuple allowed to access. | 5246 | "Return a (user host) tuple allowed to access. |
| 5152 | User is always nil." | 5247 | User is always nil." |
| 5153 | (let ((result) | 5248 | (let ((result) |
| 5154 | (regexp (concat "^\\(" tramp-host-regexp "\\)"))) | 5249 | (regexp |
| 5250 | (concat "^\\(" tramp-ipv6-regexp "\\|" tramp-host-regexp "\\)"))) | ||
| 5155 | (narrow-to-region (point) (tramp-compat-line-end-position)) | 5251 | (narrow-to-region (point) (tramp-compat-line-end-position)) |
| 5156 | (when (re-search-forward regexp nil t) | 5252 | (when (re-search-forward regexp nil t) |
| 5157 | (unless (char-equal (or (char-after) ?\n) ?:) ; no IPv6 | 5253 | (setq result (list nil (match-string 1)))) |
| 5158 | (setq result (list nil (match-string 1))))) | ||
| 5159 | (widen) | 5254 | (widen) |
| 5160 | (or | 5255 | (or |
| 5161 | (> (skip-chars-forward " \t") 0) | 5256 | (> (skip-chars-forward " \t") 0) |
| @@ -6247,9 +6342,7 @@ Gateway hops are already opened." | |||
| 6247 | '("%h") (tramp-get-method-parameter method 'tramp-login-args)) | 6342 | '("%h") (tramp-get-method-parameter method 'tramp-login-args)) |
| 6248 | ;; The host is local. We cannot use `tramp-local-host-p' | 6343 | ;; The host is local. We cannot use `tramp-local-host-p' |
| 6249 | ;; here, because it opens a connection as well. | 6344 | ;; here, because it opens a connection as well. |
| 6250 | (string-match | 6345 | (string-match tramp-local-host-regexp host)) |
| 6251 | (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$") | ||
| 6252 | host)) | ||
| 6253 | (tramp-error | 6346 | (tramp-error |
| 6254 | v 'file-error | 6347 | v 'file-error |
| 6255 | "Host `%s' looks like a remote host, `%s' can only use the local host" | 6348 | "Host `%s' looks like a remote host, `%s' can only use the local host" |
| @@ -6797,12 +6890,12 @@ Not actually used. Use `(format \"%o\" i)' instead?" | |||
| 6797 | (and (tramp-file-name-p vec) (aref vec 3))) | 6890 | (and (tramp-file-name-p vec) (aref vec 3))) |
| 6798 | 6891 | ||
| 6799 | ;; The user part of a Tramp file name vector can be of kind | 6892 | ;; The user part of a Tramp file name vector can be of kind |
| 6800 | ;; "user%domain#port". Sometimes, we must extract these parts. | 6893 | ;; "user%domain". Sometimes, we must extract these parts. |
| 6801 | (defun tramp-file-name-real-user (vec) | 6894 | (defun tramp-file-name-real-user (vec) |
| 6802 | "Return the user name of VEC without domain." | 6895 | "Return the user name of VEC without domain." |
| 6803 | (let ((user (tramp-file-name-user vec))) | 6896 | (let ((user (tramp-file-name-user vec))) |
| 6804 | (if (and (stringp user) | 6897 | (if (and (stringp user) |
| 6805 | (string-match "\\(.+\\)%\\(.+\\)" user)) | 6898 | (string-match tramp-user-with-domain-regexp user)) |
| 6806 | (match-string 1 user) | 6899 | (match-string 1 user) |
| 6807 | user))) | 6900 | user))) |
| 6808 | 6901 | ||
| @@ -6810,7 +6903,7 @@ Not actually used. Use `(format \"%o\" i)' instead?" | |||
| 6810 | "Return the domain name of VEC." | 6903 | "Return the domain name of VEC." |
| 6811 | (let ((user (tramp-file-name-user vec))) | 6904 | (let ((user (tramp-file-name-user vec))) |
| 6812 | (and (stringp user) | 6905 | (and (stringp user) |
| 6813 | (string-match "\\(.+\\)%\\(.+\\)" user) | 6906 | (string-match tramp-user-with-domain-regexp user) |
| 6814 | (match-string 2 user)))) | 6907 | (match-string 2 user)))) |
| 6815 | 6908 | ||
| 6816 | ;; The host part of a Tramp file name vector can be of kind | 6909 | ;; The host part of a Tramp file name vector can be of kind |
| @@ -6890,6 +6983,11 @@ values." | |||
| 6890 | (error | 6983 | (error |
| 6891 | "`%s' method is no longer supported, see (info \"(tramp)Multi-hops\")" | 6984 | "`%s' method is no longer supported, see (info \"(tramp)Multi-hops\")" |
| 6892 | method)) | 6985 | method)) |
| 6986 | (when host | ||
| 6987 | (when (string-match tramp-prefix-ipv6-regexp host) | ||
| 6988 | (setq host (replace-match "" nil t host))) | ||
| 6989 | (when (string-match tramp-postfix-ipv6-regexp host) | ||
| 6990 | (setq host (replace-match "" nil t host)))) | ||
| 6893 | (if nodefault | 6991 | (if nodefault |
| 6894 | (vector method user host localname) | 6992 | (vector method user host localname) |
| 6895 | (vector | 6993 | (vector |
| @@ -6923,7 +7021,11 @@ would yield `t'. On the other hand, the following check results in nil: | |||
| 6923 | (concat method tramp-postfix-method-format)) | 7021 | (concat method tramp-postfix-method-format)) |
| 6924 | (when (not (zerop (length user))) | 7022 | (when (not (zerop (length user))) |
| 6925 | (concat user tramp-postfix-user-format)) | 7023 | (concat user tramp-postfix-user-format)) |
| 6926 | (when host host) tramp-postfix-host-format | 7024 | (when host |
| 7025 | (if (string-match tramp-ipv6-regexp host) | ||
| 7026 | (concat tramp-prefix-ipv6-format host tramp-postfix-ipv6-format) | ||
| 7027 | host)) | ||
| 7028 | tramp-postfix-host-format | ||
| 6927 | (when localname localname))) | 7029 | (when localname localname))) |
| 6928 | 7030 | ||
| 6929 | (defun tramp-completion-make-tramp-file-name (method user host localname) | 7031 | (defun tramp-completion-make-tramp-file-name (method user host localname) |
| @@ -6936,7 +7038,11 @@ necessary only. This function will be used in file name completion." | |||
| 6936 | (when (not (zerop (length user))) | 7038 | (when (not (zerop (length user))) |
| 6937 | (concat user tramp-postfix-user-format)) | 7039 | (concat user tramp-postfix-user-format)) |
| 6938 | (when (not (zerop (length host))) | 7040 | (when (not (zerop (length host))) |
| 6939 | (concat host tramp-postfix-host-format)) | 7041 | (concat |
| 7042 | (if (string-match tramp-ipv6-regexp host) | ||
| 7043 | (concat tramp-prefix-ipv6-format host tramp-postfix-ipv6-format) | ||
| 7044 | host) | ||
| 7045 | tramp-postfix-host-format)) | ||
| 6940 | (when localname localname))) | 7046 | (when localname localname))) |
| 6941 | 7047 | ||
| 6942 | (defun tramp-make-copy-program-file-name (vec) | 7048 | (defun tramp-make-copy-program-file-name (vec) |
| @@ -6960,8 +7066,7 @@ necessary only. This function will be used in file name completion." | |||
| 6960 | (let ((host (tramp-file-name-host vec))) | 7066 | (let ((host (tramp-file-name-host vec))) |
| 6961 | (and | 7067 | (and |
| 6962 | (stringp host) | 7068 | (stringp host) |
| 6963 | (string-match | 7069 | (string-match tramp-local-host-regexp host) |
| 6964 | (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$") host) | ||
| 6965 | ;; The local temp directory must be writable for the other user. | 7070 | ;; The local temp directory must be writable for the other user. |
| 6966 | (file-writable-p | 7071 | (file-writable-p |
| 6967 | (tramp-make-tramp-file-name | 7072 | (tramp-make-tramp-file-name |
| @@ -7591,8 +7696,6 @@ Only works for Bourne-like shells." | |||
| 7591 | ;; SSH instance, would correctly be propagated to the remote process | 7696 | ;; SSH instance, would correctly be propagated to the remote process |
| 7592 | ;; automatically; possibly SSH would have to be started with | 7697 | ;; automatically; possibly SSH would have to be started with |
| 7593 | ;; "-t". (Markus Triska) | 7698 | ;; "-t". (Markus Triska) |
| 7594 | ;; * Support IPv6 hostnames. Use "/[some:ip:v6:address:for:tramp]:/", | ||
| 7595 | ;; which is the syntax used on web browsers. (Óscar Fuentes) | ||
| 7596 | ;; * Add gvfs support. | 7699 | ;; * Add gvfs support. |
| 7597 | ;; * Set `tramp-copy-size-limit' to 0, when there is no remote | 7700 | ;; * Set `tramp-copy-size-limit' to 0, when there is no remote |
| 7598 | ;; encoding routine. | 7701 | ;; encoding routine. |