diff options
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/ange-ftp.el | 25 | ||||
-rw-r--r-- | lisp/net/tramp.el | 65 | ||||
-rw-r--r-- | lisp/net/trampver.el | 2 |
3 files changed, 47 insertions, 45 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 8e9d0bda5af..c1f3c0a8d52 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1014,7 +1014,7 @@ or nil meaning don't change it." (defun ange-ftp-hash-entry-exists-p (key tbl) "Return whether there is an association for KEY in TABLE." - (not (eq (gethash key tbl 'unknown) 'unknown))) + (and tbl (not (eq (gethash key tbl 'unknown) 'unknown)))) (defun ange-ftp-hash-table-keys (tbl) "Return a sorted list of all the active keys in TABLE, as strings." @@ -1771,7 +1771,7 @@ good, skip, fatal, or unknown." ange-ftp-gateway-program ange-ftp-gateway-host))) (ftp (mapconcat 'identity args " "))) - (process-kill-without-query proc) + (set-process-query-on-exit-flag proc nil) (set-process-sentinel proc 'ange-ftp-gwp-sentinel) (set-process-filter proc 'ange-ftp-gwp-filter) (save-excursion @@ -1880,7 +1880,7 @@ been queued with no result. CONT will still be called, however." (start-process " *nslookup*" " *nslookup*" ange-ftp-nslookup-program host))) (res host)) - (process-kill-without-query proc) + (set-process-query-on-exit-flag proc nil) (save-excursion (set-buffer (process-buffer proc)) (while (memq (process-status proc) '(run open)) @@ -1938,7 +1938,7 @@ on the gateway machine to do the ftp instead." (set-buffer (process-buffer proc)) (goto-char (point-max)) (set-marker (process-mark proc) (point))) - (process-kill-without-query proc) + (set-process-query-on-exit-flag proc nil) (set-process-sentinel proc 'ange-ftp-process-sentinel) (set-process-filter proc 'ange-ftp-process-filter) ;; On Windows, the standard ftp client buffers its output (because @@ -2919,11 +2919,8 @@ NO-ERROR, if a listing for DIRECTORY cannot be obtained." ;; error message. (gethash "." ent)) ;; Child lookup failed, so try the parent. - (let ((table (ange-ftp-get-files dir 'no-error))) - ;; If the dir doesn't exist, don't use it as a hash table. - (and table - (ange-ftp-hash-entry-exists-p file - table))))))) + (ange-ftp-hash-entry-exists-p + file (ange-ftp-get-files dir 'no-error)))))) (defun ange-ftp-get-file-entry (name) "Given NAME, return the given file entry. @@ -3374,11 +3371,11 @@ system TYPE.") (setq file (ange-ftp-expand-file-name file)) (if (ange-ftp-ftp-name file) (condition-case nil - (let ((file-ent - (gethash - (ange-ftp-get-file-part file) - (ange-ftp-get-files (file-name-directory file))))) - (and (stringp file-ent) file-ent)) + (let ((ent (ange-ftp-get-files (file-name-directory file)))) + (and ent + (stringp (setq ent + (gethash (ange-ftp-get-file-part file) ent))) + ent)) ;; If we can't read the parent directory, just assume ;; this file is not a symlink. ;; This makes it possible to access a directory that diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 02b076483c1..cda0d41fd8d 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2055,7 +2055,7 @@ target of the symlink differ." (defun tramp-handle-file-truename (filename &optional counter prev-dirs) "Like `file-truename' for tramp files." - (with-parsed-tramp-file-name filename nil + (with-parsed-tramp-file-name (expand-file-name filename) nil (let* ((steps (tramp-split-string localname "/")) (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs (file-name-as-directory localname))) @@ -2299,32 +2299,33 @@ If it doesn't exist, generate a new one." (unless (buffer-file-name) (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file" (buffer-name))) - (when time-list - (tramp-run-real-handler 'set-visited-file-modtime (list time-list))) - (let ((f (buffer-file-name)) - (coding-system-used nil)) - (with-parsed-tramp-file-name f nil - (let* ((attr (file-attributes f)) - (modtime (nth 5 attr))) - ;; We use '(0 0) as a don't-know value. See also - ;; `tramp-handle-file-attributes-with-ls'. - (when (boundp 'last-coding-system-used) - (setq coding-system-used last-coding-system-used)) - (if (not (equal modtime '(0 0))) - (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) - (save-excursion - (tramp-send-command - multi-method method user host - (format "%s -ild %s" - (tramp-get-ls-command multi-method method user host) - (tramp-shell-quote-argument localname))) - (tramp-wait-for-output) - (setq attr (buffer-substring (point) - (progn (end-of-line) (point))))) - (setq tramp-buffer-file-attributes attr)) - (when (boundp 'last-coding-system-used) - (setq last-coding-system-used coding-system-used)) - nil)))) + (if time-list + (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) + (let ((f (buffer-file-name)) + (coding-system-used nil)) + (with-parsed-tramp-file-name f nil + (let* ((attr (file-attributes f)) + ;; '(-1 65535) means file doesn't exists yet. + (modtime (or (nth 5 attr) '(-1 65535)))) + ;; We use '(0 0) as a don't-know value. See also + ;; `tramp-handle-file-attributes-with-ls'. + (when (boundp 'last-coding-system-used) + (setq coding-system-used last-coding-system-used)) + (if (not (equal modtime '(0 0))) + (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) + (save-excursion + (tramp-send-command + multi-method method user host + (format "%s -ild %s" + (tramp-get-ls-command multi-method method user host) + (tramp-shell-quote-argument localname))) + (tramp-wait-for-output) + (setq attr (buffer-substring (point) + (progn (end-of-line) (point))))) + (setq tramp-buffer-file-attributes attr)) + (when (boundp 'last-coding-system-used) + (setq last-coding-system-used coding-system-used)) + nil))))) ;; CCC continue here @@ -3811,8 +3812,11 @@ This will break if COMMAND prints a newline, followed by the value of (unless (equal curbuf (current-buffer)) (error "Buffer has changed from `%s' to `%s'" curbuf (current-buffer))) - (when (eq visit t) - (set-visited-file-modtime)) + (when (or (eq visit t) (stringp visit)) + (set-visited-file-modtime + ;; We must pass modtime explicitely, because filename can be different + ;; from (buffer-file-name), f.e. if `file-precious-flag' is set. + (nth 5 (file-attributes filename)))) ;; Make `last-coding-system-used' have the right value. (when (boundp 'last-coding-system-used) (setq last-coding-system-used coding-system-used)) @@ -5847,7 +5851,8 @@ locale to C and sets up the remote shell search path." multi-method method user host (concat "tramp_file_attributes () {\n" tramp-remote-perl - " -e '" tramp-perl-file-attributes "' $1 $2 2>/dev/null\n" + " -e '" tramp-perl-file-attributes "'" + " \"$1\" \"$2\" 2>/dev/null\n" "}")) (tramp-wait-for-output) (unless (tramp-method-out-of-band-p multi-method method user host) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index b3223d7a46e..46b33b2d50f 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -30,7 +30,7 @@ ;; are auto-frobbed from configure.ac, so you should edit that file and run ;; "autoconf && ./configure" to change them. -(defconst tramp-version "2.0.39" +(defconst tramp-version "2.0.44" "This version of Tramp.") (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" |