aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2007-08-07 20:04:27 +0000
committerMichael Albinus2007-08-07 20:04:27 +0000
commitd62c9a33c4504b7d9dca54e387c48d41ce8b4e52 (patch)
treeb6e7f4f559920c7c7985698fb8c94830353cf2bf
parentcbaa22f40ac9b66b7ebf4b288751738228f468de (diff)
downloademacs-d62c9a33c4504b7d9dca54e387c48d41ce8b4e52.tar.gz
emacs-d62c9a33c4504b7d9dca54e387c48d41ce8b4e52.zip
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
parameters IDENTIFICATION and CONNECTED. (tramp-handle-insert-file-contents): VISIT must be handled after insertion of the local copy. Reported by Peter Gordon <peter@pg-consultants.com>. (tramp-file-name-handler): No special handling for `expand-file-name'. But for `file-name-as-directory'. (tramp-find-shell, tramp-open-connection-telnet) (tramp-open-connection-rsh, tramp-open-connection-su) (tramp-open-connection-multi) (tramp-open-connection-setup-interactive-shell): Guard against $PROMPT_COMMAND shell var. Reported by Steve Youngs <steve@sxemacs.org>. (tramp-append-tramp-buffers): Replace "sensible" by "sensitive" in the hint. * net/trampver.el: Update release number.
-rw-r--r--lisp/ChangeLog20
-rw-r--r--lisp/net/tramp.el54
-rw-r--r--lisp/net/trampver.el2
3 files changed, 56 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8d25f687b2b..381092c8e60 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,23 @@
12007-08-07 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-handle-file-remote-p): Handle optional
4 parameters IDENTIFICATION and CONNECTED.
5 (tramp-handle-insert-file-contents): VISIT must be handled after
6 insertion of the local copy. Reported by Peter Gordon
7 <peter@pg-consultants.com>.
8 (tramp-file-name-handler): No special handling for
9 `expand-file-name'. But for `file-name-as-directory'.
10 (tramp-find-shell, tramp-open-connection-telnet)
11 (tramp-open-connection-rsh, tramp-open-connection-su)
12 (tramp-open-connection-multi)
13 (tramp-open-connection-setup-interactive-shell): Guard against
14 $PROMPT_COMMAND shell var. Reported by Steve Youngs
15 <steve@sxemacs.org>.
16 (tramp-append-tramp-buffers): Replace "sensible" by "sensitive" in
17 the hint.
18
19 * net/trampver.el: Update release number.
20
12007-08-07 Tom Tromey <tromey@redhat.com> 212007-08-07 Tom Tromey <tromey@redhat.com>
2 22
3 * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level): 23 * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level):
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 9f665ca4707..09167d674eb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3868,11 +3868,20 @@ This will break if COMMAND prints a newline, followed by the value of
3868 (t (error "Wrong method specification for `%s'" method))) 3868 (t (error "Wrong method specification for `%s'" method)))
3869 tmpfil))) 3869 tmpfil)))
3870 3870
3871(defun tramp-handle-file-remote-p (filename) 3871(defun tramp-handle-file-remote-p (filename &optional identification connected)
3872 "Like `file-remote-p' for tramp files." 3872 "Like `file-remote-p' for Tramp files."
3873 (when (tramp-tramp-file-p filename) 3873 (when (tramp-tramp-file-p filename)
3874 (with-parsed-tramp-file-name filename nil 3874 (with-parsed-tramp-file-name filename nil
3875 (tramp-make-tramp-file-name multi-method method user host "")))) 3875 (and (or (not connected)
3876 (let ((p (get-buffer-process
3877 (tramp-get-buffer multi-method method user host))))
3878 (and p (processp p) (memq (process-status p) '(run open)))))
3879 (cond
3880 ((eq identification 'method) method)
3881 ((eq identification 'user) user)
3882 ((eq identification 'host) host)
3883 (t (tramp-make-tramp-file-name
3884 multi-method method user host "")))))))
3876 3885
3877(defun tramp-handle-insert-file-contents 3886(defun tramp-handle-insert-file-contents
3878 (filename &optional visit beg end replace) 3887 (filename &optional visit beg end replace)
@@ -3899,14 +3908,14 @@ This will break if COMMAND prints a newline, followed by the value of
3899 'file-local-copy))) 3908 'file-local-copy)))
3900 (file-local-copy filename))) 3909 (file-local-copy filename)))
3901 coding-system-used result) 3910 coding-system-used result)
3902 (when visit
3903 (setq buffer-file-name filename)
3904 (set-visited-file-modtime)
3905 (set-buffer-modified-p nil))
3906 (tramp-message-for-buffer 3911 (tramp-message-for-buffer
3907 multi-method method user host 3912 multi-method method user host
3908 9 "Inserting local temp file `%s'..." local-copy) 3913 9 "Inserting local temp file `%s'..." local-copy)
3909 (setq result (insert-file-contents local-copy nil beg end replace)) 3914 (setq result (insert-file-contents local-copy nil beg end replace))
3915 (when visit
3916 (setq buffer-file-name filename)
3917 (set-visited-file-modtime)
3918 (set-buffer-modified-p nil))
3910 ;; Now `last-coding-system-used' has right value. Remember it. 3919 ;; Now `last-coding-system-used' has right value. Remember it.
3911 (when (boundp 'last-coding-system-used) 3920 (when (boundp 'last-coding-system-used)
3912 (setq coding-system-used (symbol-value 'last-coding-system-used))) 3921 (setq coding-system-used (symbol-value 'last-coding-system-used)))
@@ -4354,11 +4363,12 @@ Falls back to normal file name handler if no tramp file name handler exists."
4354 (cond 4363 (cond
4355 ;; When we are in completion mode, some operations shouldn' be 4364 ;; When we are in completion mode, some operations shouldn' be
4356 ;; handled by backend. 4365 ;; handled by backend.
4357 ((and completion (memq operation '(expand-file-name)))
4358 (tramp-run-real-handler operation args))
4359 ((and completion (zerop (length localname)) 4366 ((and completion (zerop (length localname))
4360 (memq operation '(file-exists-p file-directory-p))) 4367 (memq operation '(file-exists-p file-directory-p)))
4361 t) 4368 t)
4369 ((and completion (zerop (length localname))
4370 (memq operation '(file-name-as-directory)))
4371 filename)
4362 ;; Call the backend function. 4372 ;; Call the backend function.
4363 (foreign (apply foreign operation args)) 4373 (foreign (apply foreign operation args))
4364 ;; Nothing to do for us. 4374 ;; Nothing to do for us.
@@ -5351,7 +5361,7 @@ file exists and nonzero exit status otherwise."
5351 5 "Starting remote shell `%s' for tilde expansion..." shell) 5361 5 "Starting remote shell `%s' for tilde expansion..." shell)
5352 (tramp-send-command 5362 (tramp-send-command
5353 multi-method method user host 5363 multi-method method user host
5354 (concat "PS1='$ ' exec " shell)) ; 5364 (concat "PROMPT_COMMAND='' PS1='$ ' exec " shell)) ;
5355 (tramp-barf-if-no-shell-prompt 5365 (tramp-barf-if-no-shell-prompt
5356 (get-buffer-process (current-buffer)) 5366 (get-buffer-process (current-buffer))
5357 60 "Couldn't find remote `%s' prompt" shell) 5367 60 "Couldn't find remote `%s' prompt" shell)
@@ -5361,11 +5371,12 @@ file exists and nonzero exit status otherwise."
5361 ;; must use "\n" here, not tramp-rsh-end-of-line. Kai left the 5371 ;; must use "\n" here, not tramp-rsh-end-of-line. Kai left the
5362 ;; last tramp-rsh-end-of-line, Douglas wanted to replace that, 5372 ;; last tramp-rsh-end-of-line, Douglas wanted to replace that,
5363 ;; as well. 5373 ;; as well.
5364 (process-send-string nil (format "PS1='%s%s%s'; PS2=''; PS3=''%s" 5374 (process-send-string
5365 tramp-rsh-end-of-line 5375 nil (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''%s"
5366 tramp-end-of-output 5376 tramp-rsh-end-of-line
5367 tramp-rsh-end-of-line 5377 tramp-end-of-output
5368 tramp-rsh-end-of-line)) 5378 tramp-rsh-end-of-line
5379 tramp-rsh-end-of-line))
5369 (tramp-wait-for-output) 5380 (tramp-wait-for-output)
5370 (tramp-message 5381 (tramp-message
5371 9 "Setting remote shell prompt...done") 5382 9 "Setting remote shell prompt...done")
@@ -5690,6 +5701,7 @@ Maybe the different regular expressions need to be tuned.
5690 (or user (user-login-name)) host method) 5701 (or user (user-login-name)) host method)
5691 (let ((process-environment (copy-sequence process-environment))) 5702 (let ((process-environment (copy-sequence process-environment)))
5692 (setenv "TERM" tramp-terminal-type) 5703 (setenv "TERM" tramp-terminal-type)
5704 (setenv "PROMPT_COMMAND")
5693 (setenv "PS1" "$ ") 5705 (setenv "PS1" "$ ")
5694 (let* ((default-directory (tramp-temporary-file-directory)) 5706 (let* ((default-directory (tramp-temporary-file-directory))
5695 ;; If we omit the conditional here, then we would use 5707 ;; If we omit the conditional here, then we would use
@@ -5771,6 +5783,7 @@ arguments, and xx will be used as the host name to connect to.
5771 (setq login-args (cons "-p" (cons (match-string 2 host) login-args))) 5783 (setq login-args (cons "-p" (cons (match-string 2 host) login-args)))
5772 (setq real-host (match-string 1 host))) 5784 (setq real-host (match-string 1 host)))
5773 (setenv "TERM" tramp-terminal-type) 5785 (setenv "TERM" tramp-terminal-type)
5786 (setenv "PROMPT_COMMAND")
5774 (setenv "PS1" "$ ") 5787 (setenv "PS1" "$ ")
5775 (let* ((default-directory (tramp-temporary-file-directory)) 5788 (let* ((default-directory (tramp-temporary-file-directory))
5776 ;; If we omit the conditional, we would use 5789 ;; If we omit the conditional, we would use
@@ -5823,6 +5836,7 @@ prompt than you do, so it is not at all unlikely that the variable
5823 (or user "<root>") method) 5836 (or user "<root>") method)
5824 (let ((process-environment (copy-sequence process-environment))) 5837 (let ((process-environment (copy-sequence process-environment)))
5825 (setenv "TERM" tramp-terminal-type) 5838 (setenv "TERM" tramp-terminal-type)
5839 (setenv "PROMPT_COMMAND")
5826 (setenv "PS1" "$ ") 5840 (setenv "PS1" "$ ")
5827 (let* ((default-directory (tramp-temporary-file-directory)) 5841 (let* ((default-directory (tramp-temporary-file-directory))
5828 ;; If we omit the conditional, we use `undecided-dos' in 5842 ;; If we omit the conditional, we use `undecided-dos' in
@@ -5888,6 +5902,7 @@ log in as u2 to h2."
5888 (tramp-message 7 "Opening `%s' connection..." multi-method) 5902 (tramp-message 7 "Opening `%s' connection..." multi-method)
5889 (let ((process-environment (copy-sequence process-environment))) 5903 (let ((process-environment (copy-sequence process-environment)))
5890 (setenv "TERM" tramp-terminal-type) 5904 (setenv "TERM" tramp-terminal-type)
5905 (setenv "PROMPT_COMMAND")
5891 (setenv "PS1" "$ ") 5906 (setenv "PS1" "$ ")
5892 (let* ((default-directory (tramp-temporary-file-directory)) 5907 (let* ((default-directory (tramp-temporary-file-directory))
5893 ;; If we omit the conditional, we use `undecided-dos' in 5908 ;; If we omit the conditional, we use `undecided-dos' in
@@ -6127,10 +6142,11 @@ to set up. METHOD, USER and HOST specify the connection."
6127 ;; makes it work under `rc', too. We also unset the variable $ENV 6142 ;; makes it work under `rc', too. We also unset the variable $ENV
6128 ;; because that is read by some sh implementations (eg, bash when 6143 ;; because that is read by some sh implementations (eg, bash when
6129 ;; called as sh) on startup; this way, we avoid the startup file 6144 ;; called as sh) on startup; this way, we avoid the startup file
6130 ;; clobbering $PS1. 6145 ;; clobbering $PS1. $PROMP_COMMAND is another way to set the prompt
6146 ;; in /bin/bash, it must be discarded as well.
6131 (tramp-send-command-internal 6147 (tramp-send-command-internal
6132 multi-method method user host 6148 multi-method method user host
6133 (format "exec env 'ENV=' 'PS1=$ ' %s" 6149 (format "exec env 'ENV=' 'PROMPT_COMMAND=' 'PS1=$ ' %s"
6134 (tramp-get-method-parameter 6150 (tramp-get-method-parameter
6135 multi-method method user host 'tramp-remote-sh)) 6151 multi-method method user host 'tramp-remote-sh))
6136 (format "remote `%s' to come up" 6152 (format "remote `%s' to come up"
@@ -6227,7 +6243,7 @@ to set up. METHOD, USER and HOST specify the connection."
6227 (setq tramp-last-cmd-time (current-time)) 6243 (setq tramp-last-cmd-time (current-time))
6228 (tramp-send-command 6244 (tramp-send-command
6229 multi-method method user host 6245 multi-method method user host
6230 (format "PS1='%s%s%s'; PS2=''; PS3=''" 6246 (format "PROMPT_COMMAND=''; PS1='%s%s%s'; PS2=''; PS3=''"
6231 tramp-rsh-end-of-line 6247 tramp-rsh-end-of-line
6232 tramp-end-of-output 6248 tramp-end-of-output
6233 tramp-rsh-end-of-line)) 6249 tramp-rsh-end-of-line))
@@ -7713,7 +7729,7 @@ Used for non-7bit chars in strings."
7713 (kill-region start (point))))) 7729 (kill-region start (point)))))
7714 (insert " 7730 (insert "
7715The buffer(s) above will be appended to this message. If you don't want 7731The buffer(s) above will be appended to this message. If you don't want
7716to append a buffer because it contains sensible data, or because the buffer 7732to append a buffer because it contains sensitive data, or because the buffer
7717is too large, you should delete the respective buffer. The buffer(s) will 7733is too large, you should delete the respective buffer. The buffer(s) will
7718contain user and host names. Passwords will never be included there.") 7734contain user and host names. Passwords will never be included there.")
7719 7735
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index d265fa5393b..5734b5c9138 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -30,7 +30,7 @@
30;; are auto-frobbed from configure.ac, so you should edit that file and run 30;; are auto-frobbed from configure.ac, so you should edit that file and run
31;; "autoconf && ./configure" to change them. 31;; "autoconf && ./configure" to change them.
32 32
33(defconst tramp-version "2.0.56" 33(defconst tramp-version "2.0.57-pre"
34 "This version of Tramp.") 34 "This version of Tramp.")
35 35
36(defconst tramp-bug-report-address "tramp-devel@gnu.org" 36(defconst tramp-bug-report-address "tramp-devel@gnu.org"