]> git.eshelyaron.com Git - emacs.git/commitdiff
Sync with Tramp 2.0.44.
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 10 Aug 2004 21:18:38 +0000 (21:18 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 10 Aug 2004 21:18:38 +0000 (21:18 +0000)
lisp/ChangeLog
lisp/net/tramp.el
lisp/net/trampver.el
man/ChangeLog
man/trampver.texi

index 6a2e7118049b551e2502a2145bfdce8277679aa3..8321253666aaef9198731c444d60bab43579bf4a 100644 (file)
@@ -1,3 +1,30 @@
+2004-08-10  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.0.44.
+
+       * net/tramp.el (tramp-post-connection): Quote $1 and $2 of shell
+       function "tramp_file_attributes".  Otherwise, file names
+       containing spaces are misinterpreted.  Reported by Magnus Henoch
+       <mange@freemail.hu>.
+       (tramp-handle-file-truename): FILENAME must be expanded first.
+       Otherwise, parameters like "/ssh:deego@gnufans.net:~" will return
+       obscure results.  Reported by D. Goel <deego@gnufans.org>.
+       (tramp-handle-verify-visited-file-modtime): If file does not
+       exist, say it is not modified if and only if that agrees with the
+       buffer's record.  Check whether a file is visiting the buffer, or
+       the buffer has no recorded last modification time.  Return t in
+       case the visiting file doesn't exist.  Suggested by Luc Teirlinck
+       <teirllm@auburn.edu>.
+       (tramp-handle-write-region): Pass modtime explicitely to
+       `set-visited-file-modtime', because filename can be different
+       from (buffer-file-name) if `file-precious-flag' is set.
+       `set-visited-file-modtime' must be called always when `visit' is t
+       or a string.  Suggested by Luc Teirlinck <teirllm@auburn.edu>.
+       (tramp-handle-set-visited-file-modtime): If `time-list' is not
+       nil, don't apply the whole body.  If the file doesn't exists, set
+       modtime to '(-1 65535).  Suggested by Luc Teirlinck
+       <teirllm@auburn.edu>.
+
 2004-08-09  Luc Teirlinck  <teirllm@auburn.edu>
 
        * help.el (describe-bindings): Doc fix.
index 02b076483c12755a0744673fc9d0f08d6d7303a3..cda0d41fd8df12c91e6dd7f8dd8c1d4f90369778 100644 (file)
@@ -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)
index b3223d7a46e68fd9e7dc2aa9391c7b5886056485..46b33b2d50f49dc4051ee66e950a1303374a1e1b 100644 (file)
@@ -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"
index 4f2ce160de68faf96c8a1201c6dc7201bfa3db3c..d6e105977fc9cbbf2dfad13790101cc0fc5e3076 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-10  Michael Albinus  <michael.albinus@gmx.de>
+
+       Sync with Tramp 2.0.44.
+
 2004-08-05  Lars Hansen  <larsh@math.ku.dk>
 
        * widget.texi (User Interface): Update how to separate the
index 32ab2349241a438aab9603c84b1aa0878152832a..a5cc874b3fb2cc13044780acf70a52a90004f734 100644 (file)
@@ -4,7 +4,7 @@
 @c In the Tramp CVS, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
-@set trampver 2.0.43
+@set trampver 2.0.44
 
 @c Other flags from configuration
 @set prefix /usr/local