diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 32 |
2 files changed, 22 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4609954ff76..afec55e3f0d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-06-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-compat.el (tramp-compat-temporary-file-directory): | ||
| 4 | Avoid infloop. | ||
| 5 | |||
| 1 | 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * startup.el (argv, argi): Make lexically scoped. | 8 | * startup.el (argv, argi): Make lexically scoped. |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 3a7926980f6..5ae987f0822 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -204,21 +204,23 @@ | |||
| 204 | "Return name of directory for temporary files (compat function). | 204 | "Return name of directory for temporary files (compat function). |
| 205 | For Emacs, this is the variable `temporary-file-directory', for XEmacs | 205 | For Emacs, this is the variable `temporary-file-directory', for XEmacs |
| 206 | this is the function `temp-directory'." | 206 | this is the function `temp-directory'." |
| 207 | (cond | 207 | (let (file-name-handler-alist) |
| 208 | ((and (boundp 'temporary-file-directory) | 208 | (cond |
| 209 | (not (file-remote-p (symbol-value 'temporary-file-directory)))) | 209 | ;; We must return a local directory. If it is remote, we could |
| 210 | (symbol-value 'temporary-file-directory)) | 210 | ;; run into an infloop. |
| 211 | ((fboundp 'temp-directory) (tramp-compat-funcall 'temp-directory)) | 211 | ((boundp 'temporary-file-directory) |
| 212 | ((let ((d (getenv "TEMP"))) (and d (file-directory-p d))) | 212 | (eval (car (get 'temporary-file-directory 'standard-value)))) |
| 213 | (file-name-as-directory (getenv "TEMP"))) | 213 | ((fboundp 'temp-directory) (tramp-compat-funcall 'temp-directory)) |
| 214 | ((let ((d (getenv "TMP"))) (and d (file-directory-p d))) | 214 | ((let ((d (getenv "TEMP"))) (and d (file-directory-p d))) |
| 215 | (file-name-as-directory (getenv "TMP"))) | 215 | (file-name-as-directory (getenv "TEMP"))) |
| 216 | ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d))) | 216 | ((let ((d (getenv "TMP"))) (and d (file-directory-p d))) |
| 217 | (file-name-as-directory (getenv "TMPDIR"))) | 217 | (file-name-as-directory (getenv "TMP"))) |
| 218 | ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp")) | 218 | ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d))) |
| 219 | (t (message (concat "Neither `temporary-file-directory' nor " | 219 | (file-name-as-directory (getenv "TMPDIR"))) |
| 220 | "`temp-directory' is defined -- using /tmp.")) | 220 | ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp")) |
| 221 | (file-name-as-directory "/tmp")))) | 221 | (t (message (concat "Neither `temporary-file-directory' nor " |
| 222 | "`temp-directory' is defined -- using /tmp.")) | ||
| 223 | (file-name-as-directory "/tmp"))))) | ||
| 222 | 224 | ||
| 223 | ;; `make-temp-file' exists in Emacs only. On XEmacs, we use our own | 225 | ;; `make-temp-file' exists in Emacs only. On XEmacs, we use our own |
| 224 | ;; implementation with `make-temp-name', creating the temporary file | 226 | ;; implementation with `make-temp-name', creating the temporary file |