diff options
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/ange-ftp.el | 7 | ||||
-rw-r--r-- | lisp/net/telnet.el | 2 | ||||
-rw-r--r-- | lisp/net/tramp-cache.el | 5 | ||||
-rw-r--r-- | lisp/net/tramp.el | 49 |
4 files changed, 43 insertions, 20 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index fd7f0682622..2f06344ccda 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4285,7 +4285,12 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") ;;;###autoload (defun ange-ftp-hook-function (operation &rest args) (let ((fn (get operation 'ange-ftp))) - (if fn (save-match-data (apply fn args)) + (if fn + ;; Catch also errors in process-filter. + (condition-case err + (let ((debug-on-error t)) + (save-match-data (apply fn args))) + (error (signal (car err) (cdr err)))) (ange-ftp-run-real-handler operation args)))) ;; The following code is commented out because Tramp now deals with diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index 28f7d1ddb46..ef01c96ec8e 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el @@ -248,7 +248,7 @@ There is a variable ``telnet-interrupt-string'' which is the character sent to try to stop execution of a job on the remote host. Data is sent to the remote host when RET is typed." (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) - (setq comint-use-prompt-regexp t)) + (set (make-local-variable 'comint-use-prompt-regexp) t)) ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 79b0b537837..db08fe3b6df 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -290,9 +290,8 @@ history." tramp-cache-data) res)) -;; Read persistent connection history. Applied with -;; `load-in-progress', because it shall be evaluated only once. -(when load-in-progress +;; Read persistent connection history. +(when (zerop (hash-table-count tramp-cache-data)) (condition-case err (with-temp-buffer (insert-file-contents tramp-persistency-file-name) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5285b87313a..1070d61cba6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1027,7 +1027,7 @@ The `sudo' program appears to insert a `^@' character into the prompt." "Login incorrect" "Login Incorrect" "Connection refused" - "Connection closed by foreign host." + "Connection closed" "Sorry, try again." "Name or service not known" "Host key verification failed." @@ -3581,8 +3581,11 @@ beginning of local filename are not substituted." (tramp-send-command v command) ;; We should show the output anyway. (when outbuf - (with-current-buffer outbuf - (insert-buffer-substring (tramp-get-connection-buffer v))) + (let ((output-string + (with-current-buffer (tramp-get-connection-buffer v) + (buffer-substring (point-min) (point-max))))) + (with-current-buffer outbuf + (insert output-string))) (when display (display-buffer outbuf)))) ;; When the user did interrupt, we should do it also. (error @@ -3614,12 +3617,20 @@ beginning of local filename are not substituted." (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command)) (args (split-string (substring command 0 asynchronous) " ")) (output-buffer - (or output-buffer - (if asynchronous - "*Async Shell Command*" - "*Shell Command Output*"))) + (cond + ((bufferp output-buffer) output-buffer) + ((stringp output-buffer) (get-buffer-create output-buffer)) + (output-buffer (current-buffer)) + (t (generate-new-buffer + (if asynchronous + "*Async Shell Command*" + "*Shell Command Output*"))))) + (error-buffer + (cond + ((bufferp error-buffer) error-buffer) + ((stringp error-buffer) (get-buffer-create error-buffer)))) (buffer - (if (and (not asynchronous) (bufferp error-buffer)) + (if (and (not asynchronous) error-buffer) (with-parsed-tramp-file-name default-directory nil (list output-buffer (tramp-make-tramp-temp-file v))) output-buffer))) @@ -3637,7 +3648,10 @@ beginning of local filename are not substituted." (when (listp buffer) (with-current-buffer error-buffer (insert-file-contents (cadr buffer))) - (delete-file (cadr buffer)))))) + (delete-file (buffer-file-name (cadr buffer)))) + ;; There's some output, display it. + (when (with-current-buffer output-buffer (> (point-max) (point-min))) + (display-message-or-buffer output-buffer))))) ;; File Editing. @@ -4177,8 +4191,12 @@ Falls back to normal file name handler if no tramp file name handler exists." ((and completion (zerop (length localname)) (memq operation '(file-name-as-directory))) filename) - ;; Call the backend function. - (foreign (apply foreign operation args)) + ;; Call the backend function. Set a connection property + ;; first, it will be reused for user/host name completion. + (foreign + (unless (zerop (length localname)) + (tramp-set-connection-property v "started" nil)) + (apply foreign operation args)) ;; Nothing to do for us. (t (tramp-run-real-handler operation args))))))) @@ -6116,7 +6134,8 @@ In case there is no valid Lisp expression, it raises an error" (condition-case nil (prog1 (read (current-buffer)) ;; Error handling. - (when (re-search-forward "\\S-" nil t) (error))) + (when (re-search-forward "\\S-" (tramp-line-end-position) t) + (error))) (error (tramp-error vec 'file-error "`%s' does not return a valid Lisp expression: `%s'" @@ -6125,7 +6144,7 @@ In case there is no valid Lisp expression, it raises an error" ;; It seems that Tru64 Unix does not like it if long strings are sent ;; to it in one go. (This happens when sending the Perl ;; `file-attributes' implementation, for instance.) Therefore, we -;; have this function which waits a bit at each line. +;; have this function which sends the string in chunks. (defun tramp-send-string (vec string) "Send the STRING via connection VEC. @@ -6143,7 +6162,7 @@ the remote host use line-endings as defined in the variable ;; Clean up the buffer. We cannot call `erase-buffer' because ;; narrowing might be in effect. (let (buffer-read-only) (delete-region (point-min) (point-max))) - ;; replace "\n" by `tramp-rsh-end-of-line' + ;; Replace "\n" by `tramp-rsh-end-of-line'. (setq string (mapconcat 'identity (split-string string "\n") @@ -6151,7 +6170,7 @@ the remote host use line-endings as defined in the variable (unless (or (string= string "") (string-equal (substring string -1) tramp-rsh-end-of-line)) (setq string (concat string tramp-rsh-end-of-line))) - ;; send the string + ;; Send the string. (if (and chunksize (not (zerop chunksize))) (let ((pos 0) (end (length string))) |