/[emacs]/emacs/lisp/net/tramp.el
ViewVC logotype

Diff of /emacs/lisp/net/tramp.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34.2.10 by miles, Fri Jul 23 04:42:20 2004 UTC revision 1.34.2.11 by miles, Sat Sep 4 09:22:56 2004 UTC
# Line 2055  target of the symlink differ." Line 2055  target of the symlink differ."
2055    
2056  (defun tramp-handle-file-truename (filename &optional counter prev-dirs)  (defun tramp-handle-file-truename (filename &optional counter prev-dirs)
2057    "Like `file-truename' for tramp files."    "Like `file-truename' for tramp files."
2058    (with-parsed-tramp-file-name filename nil    (with-parsed-tramp-file-name (expand-file-name filename) nil
2059      (let* ((steps        (tramp-split-string localname "/"))      (let* ((steps        (tramp-split-string localname "/"))
2060             (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs             (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs
2061                             (file-name-as-directory localname)))                             (file-name-as-directory localname)))
# Line 2299  If it doesn't exist, generate a new one. Line 2299  If it doesn't exist, generate a new one.
2299    (unless (buffer-file-name)    (unless (buffer-file-name)
2300      (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file"      (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file"
2301             (buffer-name)))             (buffer-name)))
2302    (when time-list    (if time-list
2303      (tramp-run-real-handler 'set-visited-file-modtime (list time-list)))        (tramp-run-real-handler 'set-visited-file-modtime (list time-list))
2304    (let ((f (buffer-file-name))      (let ((f (buffer-file-name))
2305          (coding-system-used nil))            (coding-system-used nil))
2306      (with-parsed-tramp-file-name f nil        (with-parsed-tramp-file-name f nil
2307        (let* ((attr (file-attributes f))          (let* ((attr (file-attributes f))
2308               (modtime (nth 5 attr)))                 ;; '(-1 65535) means file doesn't exists yet.
2309          ;; We use '(0 0) as a don't-know value.  See also                 (modtime (or (nth 5 attr) '(-1 65535))))
2310          ;; `tramp-handle-file-attributes-with-ls'.            ;; We use '(0 0) as a don't-know value.  See also
2311          (when (boundp 'last-coding-system-used)            ;; `tramp-handle-file-attributes-with-ls'.
2312            (setq coding-system-used last-coding-system-used))            (when (boundp 'last-coding-system-used)
2313          (if (not (equal modtime '(0 0)))              (setq coding-system-used last-coding-system-used))
2314              (tramp-run-real-handler 'set-visited-file-modtime (list modtime))            (if (not (equal modtime '(0 0)))
2315            (save-excursion                (tramp-run-real-handler 'set-visited-file-modtime (list modtime))
2316              (tramp-send-command              (save-excursion
2317               multi-method method user host                (tramp-send-command
2318               (format "%s -ild %s"                 multi-method method user host
2319                       (tramp-get-ls-command multi-method method user host)                 (format "%s -ild %s"
2320                       (tramp-shell-quote-argument localname)))                         (tramp-get-ls-command multi-method method user host)
2321              (tramp-wait-for-output)                         (tramp-shell-quote-argument localname)))
2322              (setq attr (buffer-substring (point)                (tramp-wait-for-output)
2323                                           (progn (end-of-line) (point)))))                (setq attr (buffer-substring (point)
2324            (setq tramp-buffer-file-attributes attr))                                             (progn (end-of-line) (point)))))
2325          (when (boundp 'last-coding-system-used)              (setq tramp-buffer-file-attributes attr))
2326            (setq last-coding-system-used coding-system-used))            (when (boundp 'last-coding-system-used)
2327          nil))))              (setq last-coding-system-used coding-system-used))
2328            nil)))))
2329    
2330  ;; CCC continue here  ;; CCC continue here
2331    
# Line 3811  This will break if COMMAND prints a newl Line 3812  This will break if COMMAND prints a newl
3812        (unless (equal curbuf (current-buffer))        (unless (equal curbuf (current-buffer))
3813          (error "Buffer has changed from `%s' to `%s'"          (error "Buffer has changed from `%s' to `%s'"
3814                 curbuf (current-buffer)))                 curbuf (current-buffer)))
3815        (when (eq visit t)        (when (or (eq visit t) (stringp visit))
3816          (set-visited-file-modtime))          (set-visited-file-modtime
3817             ;; We must pass modtime explicitely, because filename can be different
3818             ;; from (buffer-file-name), f.e. if `file-precious-flag' is set.
3819             (nth 5 (file-attributes filename))))
3820        ;; Make `last-coding-system-used' have the right value.        ;; Make `last-coding-system-used' have the right value.
3821        (when (boundp 'last-coding-system-used)        (when (boundp 'last-coding-system-used)
3822          (setq last-coding-system-used coding-system-used))          (setq last-coding-system-used coding-system-used))
# Line 5847  locale to C and sets up the remote shell Line 5851  locale to C and sets up the remote shell
5851           multi-method method user host           multi-method method user host
5852           (concat "tramp_file_attributes () {\n"           (concat "tramp_file_attributes () {\n"
5853                   tramp-remote-perl                   tramp-remote-perl
5854                   " -e '" tramp-perl-file-attributes "' $1 $2 2>/dev/null\n"                   " -e '" tramp-perl-file-attributes "'"
5855                     " \"$1\" \"$2\" 2>/dev/null\n"
5856                   "}"))                   "}"))
5857          (tramp-wait-for-output)          (tramp-wait-for-output)
5858          (unless (tramp-method-out-of-band-p multi-method method user host)          (unless (tramp-method-out-of-band-p multi-method method user host)

Legend:
Removed from v.1.34.2.10  
changed lines
  Added in v.1.34.2.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26