diff options
| author | Kai Großjohann | 2002-10-06 19:35:59 +0000 |
|---|---|---|
| committer | Kai Großjohann | 2002-10-06 19:35:59 +0000 |
| commit | 487f4fb7953113c719bc953c059d3725bdc76c45 (patch) | |
| tree | a855c3b489adfca14ec0df1c7a1455d06db1dfc5 | |
| parent | 1c1766c7e3778b4c8a4c346496d4c8648b5fa839 (diff) | |
| download | emacs-487f4fb7953113c719bc953c059d3725bdc76c45.tar.gz emacs-487f4fb7953113c719bc953c059d3725bdc76c45.zip | |
Version 2.0.25 released.
(tramp-handle-file-truename): If it's a directory,
append slash only if result doesn't end in a slash already.
(tramp-handle-file-truename): Restructure logic. If list of steps
is nil, return "/" as the real name.
(tramp-completion-mode): Add "\\(" and "\\)". Otherwise,
`match-string' doesn't make sense. From Michael Albinus.
(tramp-host-with-port-regexp): New defcustom. Equal to previous
`tramp-host-regexp'. From Michael Albinus.
(tramp-host-regexp): Taken off hashes in host names. Otherwise,
scanning files like .rhosts would take comments as host names.
From Michael Albinus.
(tramp-file-name-structure, tramp-multi-file-name-hop-structure):
Replace `tramp-host-regexp' by `tramp-host-with-port-regexp'.
From Michael Albinus.
(tramp-action-terminal): New function.
(tramp-terminal-prompt-regexp): New variable, matches "tset"
prompts.
(tramp-actions-before-shell): Use them.
(tramp-handle-shell-command): Logic error. From Ivan
Zakharyaschev <imz@altlinux.org>.
| -rw-r--r-- | lisp/ChangeLog | 24 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 169 |
2 files changed, 124 insertions, 69 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 61a52e756a5..a15c970c790 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | 2002-10-06 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> | ||
| 2 | |||
| 3 | * net/tramp.el: Version 2.0.25 released. | ||
| 4 | (tramp-handle-file-truename): If it's a directory, | ||
| 5 | append slash only if result doesn't end in a slash already. | ||
| 6 | (tramp-handle-file-truename): Restructure logic. If list of steps | ||
| 7 | is nil, return "/" as the real name. | ||
| 8 | (tramp-completion-mode): Add "\\(" and "\\)". Otherwise, | ||
| 9 | `match-string' doesn't make sense. From Michael Albinus. | ||
| 10 | (tramp-host-with-port-regexp): New defcustom. Equal to previous | ||
| 11 | `tramp-host-regexp'. From Michael Albinus. | ||
| 12 | (tramp-host-regexp): Taken off hashes in host names. Otherwise, | ||
| 13 | scanning files like .rhosts would take comments as host names. | ||
| 14 | From Michael Albinus. | ||
| 15 | (tramp-file-name-structure, tramp-multi-file-name-hop-structure): | ||
| 16 | Replace `tramp-host-regexp' by `tramp-host-with-port-regexp'. | ||
| 17 | From Michael Albinus. | ||
| 18 | (tramp-action-terminal): New function. | ||
| 19 | (tramp-terminal-prompt-regexp): New variable, matches "tset" | ||
| 20 | prompts. | ||
| 21 | (tramp-actions-before-shell): Use them. | ||
| 22 | (tramp-handle-shell-command): Logic error. From Ivan | ||
| 23 | Zakharyaschev <imz@altlinux.org>. | ||
| 24 | |||
| 1 | 2002-10-06 Markus Holmberg <markush@acc.umu.se> (tiny change) | 25 | 2002-10-06 Markus Holmberg <markush@acc.umu.se> (tiny change) |
| 2 | 26 | ||
| 3 | * thingatpt.el (thing-at-point-uri-schemes): New variable. | 27 | * thingatpt.el (thing-at-point-uri-schemes): New variable. |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0fe395a2391..b828f8a321c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -72,7 +72,7 @@ | |||
| 72 | ;; In the Tramp CVS repository, the version numer is auto-frobbed from | 72 | ;; In the Tramp CVS repository, the version numer is auto-frobbed from |
| 73 | ;; the Makefile, so you should edit the top-level Makefile to change | 73 | ;; the Makefile, so you should edit the top-level Makefile to change |
| 74 | ;; the version number. | 74 | ;; the version number. |
| 75 | (defconst tramp-version "2.0.24" | 75 | (defconst tramp-version "2.0.25" |
| 76 | "This version of tramp.") | 76 | "This version of tramp.") |
| 77 | 77 | ||
| 78 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" | 78 | (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" |
| @@ -841,7 +841,18 @@ The regexp should match at end of buffer. | |||
| 841 | See also `tramp-yesno-prompt-regexp'." | 841 | See also `tramp-yesno-prompt-regexp'." |
| 842 | :group 'tramp | 842 | :group 'tramp |
| 843 | :type 'regexp) | 843 | :type 'regexp) |
| 844 | 844 | ||
| 845 | (defcustom tramp-terminal-prompt-regexp | ||
| 846 | (concat "\\(" | ||
| 847 | "TERM = (.*)" | ||
| 848 | "\\|" | ||
| 849 | "Terminal type\\? \\[.*\\]" | ||
| 850 | "\\)\\s-*") | ||
| 851 | "Regular expression matching all terminal setting prompts. | ||
| 852 | The regexp should match at end of buffer. | ||
| 853 | The answer will be provided by `tramp-action-terminal', which see." | ||
| 854 | :group 'tramp | ||
| 855 | :type 'regexp) | ||
| 845 | 856 | ||
| 846 | (defcustom tramp-temp-name-prefix "tramp." | 857 | (defcustom tramp-temp-name-prefix "tramp." |
| 847 | "*Prefix to use for temporary files. | 858 | "*Prefix to use for temporary files. |
| @@ -962,6 +973,12 @@ Derived from `tramp-postfix-user-format'." | |||
| 962 | :type 'regexp) | 973 | :type 'regexp) |
| 963 | 974 | ||
| 964 | (defcustom tramp-host-regexp | 975 | (defcustom tramp-host-regexp |
| 976 | "[a-zA-Z0-9_.-]*" | ||
| 977 | "*Regexp matching host names." | ||
| 978 | :group 'tramp | ||
| 979 | :type 'regexp) | ||
| 980 | |||
| 981 | (defcustom tramp-host-with-port-regexp | ||
| 965 | "[a-zA-Z0-9_.#-]*" | 982 | "[a-zA-Z0-9_.#-]*" |
| 966 | "*Regexp matching host names." | 983 | "*Regexp matching host names." |
| 967 | :group 'tramp | 984 | :group 'tramp |
| @@ -994,9 +1011,9 @@ Derived from `tramp-postfix-host-format'." | |||
| 994 | (concat | 1011 | (concat |
| 995 | tramp-prefix-regexp | 1012 | tramp-prefix-regexp |
| 996 | "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp "\\)?" | 1013 | "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp "\\)?" |
| 997 | "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?" | 1014 | "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?" |
| 998 | "\\(" tramp-host-regexp "\\)" tramp-postfix-host-regexp | 1015 | "\\(" tramp-host-with-port-regexp "\\)" tramp-postfix-host-regexp |
| 999 | "\\(" tramp-path-regexp "\\)") | 1016 | "\\(" tramp-path-regexp "\\)") |
| 1000 | 2 4 5 6) | 1017 | 2 4 5 6) |
| 1001 | 1018 | ||
| 1002 | "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \ | 1019 | "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \ |
| @@ -1127,8 +1144,8 @@ string, but I haven't actually tried what happens if it doesn't..." | |||
| 1127 | (list | 1144 | (list |
| 1128 | (concat | 1145 | (concat |
| 1129 | "\\(" tramp-method-regexp "\\)" tramp-postfix-multi-method-regexp | 1146 | "\\(" tramp-method-regexp "\\)" tramp-postfix-multi-method-regexp |
| 1130 | "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp | 1147 | "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
| 1131 | "\\(" tramp-host-regexp "\\)") | 1148 | "\\(" tramp-host-with-port-regexp "\\)") |
| 1132 | 1 2 3) | 1149 | 1 2 3) |
| 1133 | "*Describes the structure of a hop in multi files. | 1150 | "*Describes the structure of a hop in multi files. |
| 1134 | This is a list of four elements (REGEXP METHOD USER HOST). First | 1151 | This is a list of four elements (REGEXP METHOD USER HOST). First |
| @@ -1200,7 +1217,8 @@ but it might be slow on large directories." | |||
| 1200 | (tramp-shell-prompt-pattern tramp-action-succeed) | 1217 | (tramp-shell-prompt-pattern tramp-action-succeed) |
| 1201 | (tramp-wrong-passwd-regexp tramp-action-permission-denied) | 1218 | (tramp-wrong-passwd-regexp tramp-action-permission-denied) |
| 1202 | (tramp-yesno-prompt-regexp tramp-action-yesno) | 1219 | (tramp-yesno-prompt-regexp tramp-action-yesno) |
| 1203 | (tramp-yn-prompt-regexp tramp-action-yn)) | 1220 | (tramp-yn-prompt-regexp tramp-action-yn) |
| 1221 | (tramp-terminal-prompt-regexp tramp-action-terminal)) | ||
| 1204 | "List of pattern/action pairs. | 1222 | "List of pattern/action pairs. |
| 1205 | Whenever a pattern matches, the corresponding action is performed. | 1223 | Whenever a pattern matches, the corresponding action is performed. |
| 1206 | Each item looks like (PATTERN ACTION). | 1224 | Each item looks like (PATTERN ACTION). |
| @@ -1889,14 +1907,19 @@ target of the symlink differ." | |||
| 1889 | (when (>= numchase numchase-limit) | 1907 | (when (>= numchase numchase-limit) |
| 1890 | (error "Maximum number (%d) of symlinks exceeded" numchase-limit)) | 1908 | (error "Maximum number (%d) of symlinks exceeded" numchase-limit)) |
| 1891 | (setq result (reverse result)) | 1909 | (setq result (reverse result)) |
| 1910 | ;; Combine list to form string. | ||
| 1911 | (setq result | ||
| 1912 | (if result | ||
| 1913 | (mapconcat 'identity (cons "" result) "/") | ||
| 1914 | "/")) | ||
| 1915 | (when (and is-dir (or (string= "" result) | ||
| 1916 | (not (string= (substring result -1) "/")))) | ||
| 1917 | (setq result (concat result "/"))) | ||
| 1892 | (tramp-message-for-buffer | 1918 | (tramp-message-for-buffer |
| 1893 | multi-method method user host | 1919 | multi-method method user host |
| 1894 | 10 "True name of `%s' is `%s'" | 1920 | 10 "True name of `%s' is `%s'" filename result) |
| 1895 | filename (mapconcat 'identity (cons "" result) "/")) | ||
| 1896 | (tramp-make-tramp-file-name | 1921 | (tramp-make-tramp-file-name |
| 1897 | multi-method method user host | 1922 | multi-method method user host result)))) |
| 1898 | (concat (mapconcat 'identity (cons "" result) "/") | ||
| 1899 | (if is-dir "/" "")))))) | ||
| 1900 | 1923 | ||
| 1901 | ;; Basic functions. | 1924 | ;; Basic functions. |
| 1902 | 1925 | ||
| @@ -2910,60 +2933,60 @@ Doesn't do anything if the NAME does not start with a drive letter." | |||
| 2910 | "Like `shell-command' for tramp files. | 2933 | "Like `shell-command' for tramp files. |
| 2911 | This will break if COMMAND prints a newline, followed by the value of | 2934 | This will break if COMMAND prints a newline, followed by the value of |
| 2912 | `tramp-end-of-output', followed by another newline." | 2935 | `tramp-end-of-output', followed by another newline." |
| 2913 | (when (tramp-tramp-file-p default-directory) | 2936 | (if (tramp-tramp-file-p default-directory) |
| 2914 | (with-parsed-tramp-file-name default-directory nil | 2937 | (with-parsed-tramp-file-name default-directory nil |
| 2915 | (when (tramp-ange-ftp-file-name-p multi-method method user host) | 2938 | (when (tramp-ange-ftp-file-name-p multi-method method user host) |
| 2916 | (let ((default-directory (tramp-make-ange-ftp-file-name | 2939 | (let ((default-directory (tramp-make-ange-ftp-file-name |
| 2917 | user host path))) | 2940 | user host path))) |
| 2918 | (tramp-invoke-ange-ftp 'shell-command | 2941 | (tramp-invoke-ange-ftp 'shell-command |
| 2919 | command output-buffer error-buffer))) | 2942 | command output-buffer error-buffer))) |
| 2920 | (let (status) | 2943 | (let (status) |
| 2921 | (when (string-match "&[ \t]*\\'" command) | 2944 | (when (string-match "&[ \t]*\\'" command) |
| 2922 | (error "Tramp doesn't grok asynchronous shell commands, yet")) | 2945 | (error "Tramp doesn't grok asynchronous shell commands, yet")) |
| 2923 | (when error-buffer | 2946 | (when error-buffer |
| 2924 | (error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet")) | 2947 | (error "Tramp doesn't grok optional third arg ERROR-BUFFER, yet")) |
| 2925 | (save-excursion | 2948 | (save-excursion |
| 2926 | (tramp-barf-unless-okay | 2949 | (tramp-barf-unless-okay |
| 2927 | multi-method method user host | 2950 | multi-method method user host |
| 2928 | (format "cd %s" (tramp-shell-quote-argument path)) | 2951 | (format "cd %s" (tramp-shell-quote-argument path)) |
| 2929 | nil 'file-error | 2952 | nil 'file-error |
| 2930 | "tramp-handle-shell-command: Couldn't `cd %s'" | 2953 | "tramp-handle-shell-command: Couldn't `cd %s'" |
| 2931 | (tramp-shell-quote-argument path)) | 2954 | (tramp-shell-quote-argument path)) |
| 2932 | (tramp-send-command multi-method method user host | 2955 | (tramp-send-command multi-method method user host |
| 2933 | (concat command "; tramp_old_status=$?")) | 2956 | (concat command "; tramp_old_status=$?")) |
| 2934 | ;; This will break if the shell command prints "/////" | 2957 | ;; This will break if the shell command prints "/////" |
| 2935 | ;; somewhere. Let's just hope for the best... | 2958 | ;; somewhere. Let's just hope for the best... |
| 2936 | (tramp-wait-for-output)) | 2959 | (tramp-wait-for-output)) |
| 2937 | (unless output-buffer | 2960 | (unless output-buffer |
| 2938 | (setq output-buffer (get-buffer-create "*Shell Command Output*")) | 2961 | (setq output-buffer (get-buffer-create "*Shell Command Output*")) |
| 2962 | (set-buffer output-buffer) | ||
| 2963 | (erase-buffer)) | ||
| 2964 | (unless (bufferp output-buffer) | ||
| 2965 | (setq output-buffer (current-buffer))) | ||
| 2939 | (set-buffer output-buffer) | 2966 | (set-buffer output-buffer) |
| 2940 | (erase-buffer)) | 2967 | (insert-buffer (tramp-get-buffer multi-method method user host)) |
| 2941 | (unless (bufferp output-buffer) | 2968 | (save-excursion |
| 2942 | (setq output-buffer (current-buffer))) | 2969 | (tramp-send-command multi-method method user host "cd") |
| 2943 | (set-buffer output-buffer) | 2970 | (tramp-wait-for-output) |
| 2944 | (insert-buffer (tramp-get-buffer multi-method method user host)) | 2971 | (tramp-send-command |
| 2945 | (save-excursion | 2972 | multi-method method user host |
| 2946 | (tramp-send-command multi-method method user host "cd") | 2973 | (concat "tramp_set_exit_status $tramp_old_status;" |
| 2947 | (tramp-wait-for-output) | 2974 | " echo tramp_exit_status $?")) |
| 2948 | (tramp-send-command | 2975 | (tramp-wait-for-output) |
| 2949 | multi-method method user host | 2976 | (goto-char (point-max)) |
| 2950 | (concat "tramp_set_exit_status $tramp_old_status;" | 2977 | (unless (search-backward "tramp_exit_status " nil t) |
| 2951 | " echo tramp_exit_status $?")) | 2978 | (error "Couldn't find exit status of `%s'" command)) |
| 2952 | (tramp-wait-for-output) | 2979 | (skip-chars-forward "^ ") |
| 2953 | (goto-char (point-max)) | 2980 | (setq status (read (current-buffer)))) |
| 2954 | (unless (search-backward "tramp_exit_status " nil t) | 2981 | (unless (zerop (buffer-size)) |
| 2955 | (error "Couldn't find exit status of `%s'" command)) | 2982 | (pop-to-buffer output-buffer)) |
| 2956 | (skip-chars-forward "^ ") | 2983 | status)) |
| 2957 | (setq status (read (current-buffer)))) | 2984 | ;; The following is only executed if something strange was |
| 2958 | (unless (zerop (buffer-size)) | 2985 | ;; happening. Emit a helpful message and do it anyway. |
| 2959 | (pop-to-buffer output-buffer)) | 2986 | (message "tramp-handle-shell-command called with non-tramp directory: `%s'" |
| 2960 | status))) | 2987 | default-directory) |
| 2961 | ;; The following is only executed if something strange was | 2988 | (tramp-run-real-handler 'shell-command |
| 2962 | ;; happening. Emit a helpful message and do it anyway. | 2989 | (list command output-buffer error-buffer)))) |
| 2963 | (message "tramp-handle-shell-command called with non-tramp directory: `%s'" | ||
| 2964 | default-directory) | ||
| 2965 | (tramp-run-real-handler 'shell-command | ||
| 2966 | (list command output-buffer error-buffer))) | ||
| 2967 | 2990 | ||
| 2968 | ;; File Editing. | 2991 | ;; File Editing. |
| 2969 | 2992 | ||
| @@ -3578,9 +3601,8 @@ Return (nil) if arg is nil." | |||
| 3578 | ((featurep 'xemacs) t) | 3601 | ((featurep 'xemacs) t) |
| 3579 | ((string-match "^/.*:.*:$" file) nil) | 3602 | ((string-match "^/.*:.*:$" file) nil) |
| 3580 | ((string-match | 3603 | ((string-match |
| 3581 | (concat | 3604 | (concat tramp-prefix-regexp |
| 3582 | tramp-prefix-regexp | 3605 | "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp "$") |
| 3583 | tramp-method-regexp tramp-postfix-single-method-regexp "$") | ||
| 3584 | file) | 3606 | file) |
| 3585 | (member (match-string 1 file) | 3607 | (member (match-string 1 file) |
| 3586 | (cons tramp-ftp-method (mapcar 'car tramp-methods)))) | 3608 | (cons tramp-ftp-method (mapcar 'car tramp-methods)))) |
| @@ -4383,6 +4405,15 @@ See also `tramp-action-yesno'." | |||
| 4383 | (throw 'tramp-action 'permission-denied)) | 4405 | (throw 'tramp-action 'permission-denied)) |
| 4384 | (process-send-string p (concat "y" tramp-rsh-end-of-line)))) | 4406 | (process-send-string p (concat "y" tramp-rsh-end-of-line)))) |
| 4385 | 4407 | ||
| 4408 | (defun tramp-action-terminal (p multi-method method user host) | ||
| 4409 | "Tell the remote host which terminal type to use. | ||
| 4410 | The terminal type can be configured with `tramp-terminal-type'." | ||
| 4411 | (tramp-message 9 "Setting `%s' as terminal type." | ||
| 4412 | tramp-terminal-type) | ||
| 4413 | (erase-buffer) | ||
| 4414 | (process-send-string nil (concat tramp-terminal-type | ||
| 4415 | tramp-rsh-end-of-line))) | ||
| 4416 | |||
| 4386 | ;; The following functions are specifically for multi connections. | 4417 | ;; The following functions are specifically for multi connections. |
| 4387 | 4418 | ||
| 4388 | (defun tramp-multi-action-login (p method user host) | 4419 | (defun tramp-multi-action-login (p method user host) |