]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp.el (tramp-make-temp-file): New parameter FILENAME.
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 5 Mar 2007 06:41:59 +0000 (06:41 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 5 Mar 2007 06:41:59 +0000 (06:41 +0000)
Append its extension to the resulting temporary file name.
(tramp-handle-file-local-copy, tramp-handle-write-region): Apply
it.

* net/tramp-smb.el (tramp-smb-handle-file-local-copy)
(tramp-smb-handle-write-region): Apply it.

lisp/ChangeLog
lisp/net/tramp-smb.el
lisp/net/tramp.el

index ee2eb652ec4cb2d5f22c12ecbb25a940c95c6118..9918a658a138cb02706d9a2c72483107462ca1bf 100644 (file)
@@ -1,6 +1,16 @@
+2007-03-05  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-make-temp-file): New parameter FILENAME.
+       Append its extension to the resulting temporary file name.
+       (tramp-handle-file-local-copy, tramp-handle-write-region): Apply
+       it.
+
+       * net/tramp-smb.el (tramp-smb-handle-file-local-copy)
+       (tramp-smb-handle-write-region): Apply it.
+
 2007-03-05  Alin C. Soare  <alinsoar@voila.fr>  (tiny change)
 
-       * emacs-lisp/lisp-mode.el (calculate-lisp-indent): 
+       * emacs-lisp/lisp-mode.el (calculate-lisp-indent):
        Redo previous change.
 
 2007-03-04  Kevin Rodgers <kevin.d.rodgers@gmail.com>
index dfe6216043e0421d82e6d619c7492fc05573f4b9..5d5d441193deb6731e26c8b685a11905c439864a 100644 (file)
@@ -384,7 +384,7 @@ KEEP-DATE is not handled in case NEWNAME resides on an SMB server."
     (save-excursion
       (let ((share (tramp-smb-get-share localname))
            (file (tramp-smb-get-localname localname t))
-           (tmpfil (tramp-make-temp-file)))
+           (tmpfil (tramp-make-temp-file filename)))
        (unless (file-exists-p filename)
          (error "Cannot make local copy of non-existing file `%s'" filename))
        (tramp-message-for-buffer
@@ -595,7 +595,7 @@ Catches errors for shares like \"C$/\", which are common in Microsoft Windows."
            (curbuf (current-buffer))
            tmpfil)
        ;; Write region into a tmp file.
-       (setq tmpfil (tramp-make-temp-file))
+       (setq tmpfil (tramp-make-temp-file filename))
        ;; We say `no-message' here because we don't want the visited file
        ;; modtime data to be clobbered from the temp file.  We call
        ;; `set-visited-file-modtime' ourselves later on.
index 602c6d25eaa0957f0e92c3fc7336c474348f2332..7ff9b2d956b72fd1043f9930f2867743c34e776f 100644 (file)
@@ -3771,10 +3771,12 @@ This will break if COMMAND prints a newline, followed by the value of
 
 ;; File Editing.
 
-(defsubst tramp-make-temp-file ()
-  (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name)
-          (expand-file-name tramp-temp-name-prefix
-                            (tramp-temporary-file-directory))))
+(defsubst tramp-make-temp-file (filename)
+  (concat
+   (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name)
+           (expand-file-name tramp-temp-name-prefix
+                             (tramp-temporary-file-directory)))
+   (file-name-extension filename t)))
 
 (defun tramp-handle-file-local-copy (filename)
   "Like `file-local-copy' for tramp files."
@@ -3794,7 +3796,7 @@ This will break if COMMAND prints a newline, followed by the value of
       (unless (file-exists-p filename)
        (error "Cannot make local copy of non-existing file `%s'"
               filename))
-      (setq tmpfil (tramp-make-temp-file))
+      (setq tmpfil (tramp-make-temp-file filename))
 
       (cond ((tramp-method-out-of-band-p multi-method method user host)
             ;; `copy-file' handles out-of-band methods
@@ -3846,7 +3848,7 @@ This will break if COMMAND prints a newline, followed by the value of
                     (kill-buffer tmpbuf))
                 ;; If tramp-decoding-function is not defined for this
                 ;; method, we invoke tramp-decoding-command instead.
-                (let ((tmpfil2 (tramp-make-temp-file)))
+                (let ((tmpfil2 (tramp-make-temp-file filename)))
                   (write-region (point-min) (point-max) tmpfil2)
                   (tramp-message
                    6 "Decoding remote file %s with command %s..."
@@ -4053,7 +4055,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
       ;; Write region into a tmp file.  This isn't really needed if we
       ;; use an encoding function, but currently we use it always
       ;; because this makes the logic simpler.
-      (setq tmpfil (tramp-make-temp-file))
+      (setq tmpfil (tramp-make-temp-file filename))
       ;; Set current buffer.  If connection wasn't open, `file-modes' has
       ;; changed it accidently.
       (set-buffer curbuf)