# HG changeset patch # User Michael Albinus # Date 1173076919 0 # Node ID 9e77507716d4067b23859287fb2d5399269ac959 # Parent e967fc3cfb4f54da56a1525f93a61d99ed9a4187 * 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. diff -r e967fc3cfb4f -r 9e77507716d4 lisp/ChangeLog --- a/lisp/ChangeLog Mon Mar 05 03:21:41 2007 +0000 +++ b/lisp/ChangeLog Mon Mar 05 06:41:59 2007 +0000 @@ -1,6 +1,16 @@ +2007-03-05 Michael Albinus + + * 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 (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 diff -r e967fc3cfb4f -r 9e77507716d4 lisp/net/tramp-smb.el --- a/lisp/net/tramp-smb.el Mon Mar 05 03:21:41 2007 +0000 +++ b/lisp/net/tramp-smb.el Mon Mar 05 06:41:59 2007 +0000 @@ -384,7 +384,7 @@ (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 @@ (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. diff -r e967fc3cfb4f -r 9e77507716d4 lisp/net/tramp.el --- a/lisp/net/tramp.el Mon Mar 05 03:21:41 2007 +0000 +++ b/lisp/net/tramp.el Mon Mar 05 06:41:59 2007 +0000 @@ -3771,10 +3771,12 @@ ;; 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 @@ (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 @@ (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 @@ ;; 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)