713 |
"*Alist of methods for remote files. |
"*Alist of methods for remote files. |
714 |
This is a list of entries of the form (NAME PAIR1 PAIR2 ...). |
This is a list of entries of the form (NAME PAIR1 PAIR2 ...). |
715 |
Each NAME stands for a remote access method. Each PAIR is of the form |
Each NAME stands for a remote access method. Each PAIR is of the form |
716 |
(FUNCTION FILE). FUNCTION is responsible to extract user names and host |
\(FUNCTION FILE). FUNCTION is responsible to extract user names and host |
717 |
names from FILE for completion. The following predefined FUNCTIONs exists: |
names from FILE for completion. The following predefined FUNCTIONs exists: |
718 |
|
|
719 |
* `tramp-parse-rhosts' for \".rhosts\" like files, |
* `tramp-parse-rhosts' for \".rhosts\" like files, |
934 |
:type 'regexp) |
:type 'regexp) |
935 |
|
|
936 |
(defcustom tramp-user-regexp |
(defcustom tramp-user-regexp |
937 |
"[^:@/]+" |
"[^:@/]*" |
938 |
"*Regexp matching user names." |
"*Regexp matching user names." |
939 |
:group 'tramp |
:group 'tramp |
940 |
:type 'regexp) |
:type 'regexp) |
954 |
:type 'regexp) |
:type 'regexp) |
955 |
|
|
956 |
(defcustom tramp-host-regexp |
(defcustom tramp-host-regexp |
957 |
"[a-zA-Z0-9_.-]+" |
"[a-zA-Z0-9_.-]*" |
958 |
"*Regexp matching host names." |
"*Regexp matching host names." |
959 |
:group 'tramp |
:group 'tramp |
960 |
:type 'regexp) |
:type 'regexp) |
3079 |
;; Now `last-coding-system-used' has right value. Remember it. |
;; Now `last-coding-system-used' has right value. Remember it. |
3080 |
(when (boundp 'last-coding-system-used) |
(when (boundp 'last-coding-system-used) |
3081 |
(setq coding-system-used last-coding-system-used)) |
(setq coding-system-used last-coding-system-used)) |
3082 |
(tramp-message 9 "Inserting local temp file `%s'...done" local-copy) |
(tramp-message-for-buffer |
3083 |
|
multi-method method user host |
3084 |
|
9 "Inserting local temp file `%s'...done" local-copy) |
3085 |
(delete-file local-copy) |
(delete-file local-copy) |
3086 |
(when (boundp 'last-coding-system-used) |
(when (boundp 'last-coding-system-used) |
3087 |
(setq last-coding-system-used coding-system-used)) |
(setq last-coding-system-used coding-system-used)) |
4514 |
(when multi-method |
(when multi-method |
4515 |
(error "Cannot multi-connect using rsh connection method")) |
(error "Cannot multi-connect using rsh connection method")) |
4516 |
(tramp-pre-connection multi-method method user host) |
(tramp-pre-connection multi-method method user host) |
4517 |
(if user |
(if (and user (not (string= user ""))) |
4518 |
(tramp-message 7 "Opening connection for %s@%s using %s..." |
(tramp-message 7 "Opening connection for %s@%s using %s..." |
4519 |
user host method) |
user host method) |
4520 |
(tramp-message 7 "Opening connection at %s using %s..." host method)) |
(tramp-message 7 "Opening connection at %s using %s..." host method)) |
4536 |
(coding-system-for-read (unless (and (not (featurep 'xemacs)) |
(coding-system-for-read (unless (and (not (featurep 'xemacs)) |
4537 |
(> emacs-major-version 20)) |
(> emacs-major-version 20)) |
4538 |
tramp-dos-coding-system)) |
tramp-dos-coding-system)) |
4539 |
(p (if user |
(p (if (and user (not (string= user ""))) |
4540 |
(apply #'start-process bufnam buf rsh-program |
(apply #'start-process bufnam buf rsh-program |
4541 |
host "-l" user rsh-args) |
host "-l" user rsh-args) |
4542 |
(apply #'start-process bufnam buf rsh-program |
(apply #'start-process bufnam buf rsh-program |
4570 |
method)) |
method)) |
4571 |
(unless (or (string-match (concat "^" (regexp-quote host)) |
(unless (or (string-match (concat "^" (regexp-quote host)) |
4572 |
(system-name)) |
(system-name)) |
4573 |
(string= "localhost" host)) |
(string= "localhost" host) |
4574 |
|
(string= "" host)) |
4575 |
(error |
(error |
4576 |
"Cannot connect to different host `%s' with `su' connection method" |
"Cannot connect to different host `%s' with `su' connection method" |
4577 |
host)) |
host)) |
|
(when (not user) |
|
|
(setq user "root")) |
|
4578 |
(tramp-pre-connection multi-method method user host) |
(tramp-pre-connection multi-method method user host) |
4579 |
(tramp-message 7 "Opening connection for `%s' using `%s'..." user method) |
(tramp-message 7 "Opening connection for `%s' using `%s'..." |
4580 |
|
(or user "<root>") method) |
4581 |
(let ((process-environment (copy-sequence process-environment))) |
(let ((process-environment (copy-sequence process-environment))) |
4582 |
(setenv "TERM" tramp-terminal-type) |
(setenv "TERM" tramp-terminal-type) |
4583 |
(let* ((default-directory (tramp-temporary-file-directory)) |
(let* ((default-directory (tramp-temporary-file-directory)) |
4593 |
(tramp-get-su-program multi-method method) |
(tramp-get-su-program multi-method method) |
4594 |
(mapcar |
(mapcar |
4595 |
'(lambda (x) |
'(lambda (x) |
4596 |
(format-spec x `((?u . ,user)))) |
(format-spec x `((?u . ,(or user "root"))))) |
4597 |
(tramp-get-su-args multi-method method)))) |
(tramp-get-su-args multi-method method)))) |
4598 |
(found nil) |
(found nil) |
4599 |
(pw nil)) |
(pw nil)) |