Switch to recommended form of GPLv3 permissions notice.
[bpt/emacs.git] / lisp / net / tramp-compat.el
index 19d25f4..161c40d 100644 (file)
@@ -1,16 +1,16 @@
 ;;; tramp-compat.el --- Tramp compatibility functions
 
-;; Copyright (C) 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +18,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, see
-;; <http://www.gnu.org/licenses/>.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 
 ;;; Code:
 
-(eval-and-compile
+(eval-when-compile
 
   ;; Pacify byte-compiler.
-  (require 'cl)
+  (require 'cl))
+
+(eval-and-compile
+
   (require 'custom)
 
   ;; Load the appropriate timer package.
@@ -150,11 +152,12 @@ this is the function `temp-directory'."
 (defsubst tramp-compat-make-temp-file (filename)
   "Create a temporary file (compat function).
 Add the extension of FILENAME, if existing."
-  (let ((prefix (expand-file-name
-                (symbol-value 'tramp-temp-name-prefix)
-                (tramp-compat-temporary-file-directory)))
-       (extension (file-name-extension filename t))
-       result)
+  (let* (file-name-handler-alist
+        (prefix (expand-file-name
+                 (symbol-value 'tramp-temp-name-prefix)
+                 (tramp-compat-temporary-file-directory)))
+        (extension (file-name-extension filename t))
+        result)
     (condition-case nil
        (setq result
              (funcall (symbol-function 'make-temp-file) prefix nil extension))
@@ -194,6 +197,7 @@ Add the extension of FILENAME, if existing."
   (cond
    ((or (null id-format) (eq id-format 'integer))
     (file-attributes filename))
+   ;; FIXME: shouldn't that be tramp-file-p or somesuch?
    ((file-remote-p filename)
     (funcall (symbol-function 'tramp-handle-file-attributes)
             filename id-format))
@@ -213,9 +217,9 @@ Add the extension of FILENAME, if existing."
     (copy-file filename newname ok-if-already-exists keep-date)))
 
 ;; `copy-tree' is a built-in function in XEmacs.  In Emacs 21, it is
-;; an auoloaded function in cl-extra.el.  Since Emacs 22, it is part
+;; an autoloaded function in cl-extra.el.  Since Emacs 22, it is part
 ;; of subr.el.  There are problems when autoloading, therefore we test
-;; for for `subrp' and `symbol-file'.  Implementation is taken from Emacs23.
+;; for `subrp' and `symbol-file'.  Implementation is taken from Emacs23.
 (defun tramp-compat-copy-tree (tree)
   "Make a copy of TREE (compat function)."
   (if (or (subrp 'copy-tree) (symbol-file 'copy-tree))