From 8982b23153305ada35825abfb6bbf0e9e3c9e985 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Mon, 27 Jun 2011 17:30:37 -0400 Subject: [PATCH] * lisp/net/ange-ftp.el: Allow loading .gz files (Bug#6923). (ange-ftp-make-tmp-name): New arg. (ange-ftp-file-local-copy): Use it. --- lisp/ChangeLog | 6 ++++++ lisp/net/ange-ftp.el | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9da037d06b0..170939cfc4b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-06-27 Katsumi Yamaoka + + * net/ange-ftp.el: Allow loading .gz files (Bug#6923). + (ange-ftp-make-tmp-name): New arg. + (ange-ftp-file-local-copy): Use it. + 2011-06-27 Jambunathan K * tar-mode.el (tar-untar-buffer): Set coding-system-for-write to diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 1282f86d503..41716dbdacd 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1723,11 +1723,12 @@ good, skip, fatal, or unknown." ;;; Temporary file location and deletion... ;;; ------------------------------------------------------------ -(defun ange-ftp-make-tmp-name (host) +(defun ange-ftp-make-tmp-name (host &optional suffix) "This routine will return the name of a new file." (make-temp-file (if (ange-ftp-use-gateway-p host) ange-ftp-gateway-tmp-name-template - ange-ftp-tmp-name-template))) + ange-ftp-tmp-name-template) + nil suffix)) (defun ange-ftp-del-tmp-name (filename) "Force to delete temporary file." @@ -4139,7 +4140,8 @@ directory, so that Emacs will know its current contents." (let* ((fn1 (expand-file-name file)) (pa1 (ange-ftp-ftp-name fn1))) (if pa1 - (let ((tmp1 (ange-ftp-make-tmp-name (car pa1)))) + (let ((tmp1 (ange-ftp-make-tmp-name (car pa1) + (file-name-extension file t)))) (ange-ftp-copy-file-internal fn1 tmp1 t nil (format "Getting %s" fn1)) tmp1)))) -- 2.39.2