Mercurial > emacs
annotate lisp/net/tramp-compat.el @ 102686:6ff0334666aa
Jari Aalto <jari.aalto at cante.net>
(display-time-default-load-average): Doc fix.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 21 Mar 2009 18:53:14 +0000 |
parents | a9dc0e7c3f2b |
children | 83914fa17916 |
rev | line source |
---|---|
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
1 ;;; tramp-compat.el --- Tramp compatibility functions |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
2 |
100908 | 3 ;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
4 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
5 ;; Author: Michael Albinus <michael.albinus@gmx.de> |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
6 ;; Keywords: comm, processes |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
7 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
8 ;; This file is part of GNU Emacs. |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
9 |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94402
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
11 ;; it under the terms of the GNU General Public License as published by |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94402
diff
changeset
|
12 ;; the Free Software Foundation, either version 3 of the License, or |
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94402
diff
changeset
|
13 ;; (at your option) any later version. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
14 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
15 ;; GNU Emacs is distributed in the hope that it will be useful, |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
18 ;; GNU General Public License for more details. |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
19 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94402
diff
changeset
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
22 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
23 ;;; Commentary: |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
24 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
25 ;; Tramp's main Emacs version for development is GNU Emacs 23. This |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
26 ;; package provides compatibility functions for GNU Emacs 21, GNU |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
27 ;; Emacs 22 and XEmacs 21.4+. |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
28 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
29 ;;; Code: |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
30 |
87322
e99e230d7eb3
* files.el (cd-absolute): Set `list-buffers-directory' in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
31 (eval-when-compile |
e99e230d7eb3
* files.el (cd-absolute): Set `list-buffers-directory' in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
32 |
e99e230d7eb3
* files.el (cd-absolute): Set `list-buffers-directory' in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
33 ;; Pacify byte-compiler. |
e99e230d7eb3
* files.el (cd-absolute): Set `list-buffers-directory' in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
34 (require 'cl)) |
e99e230d7eb3
* files.el (cd-absolute): Set `list-buffers-directory' in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
35 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
36 (eval-and-compile |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
37 |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
38 (require 'custom) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
39 |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
40 ;; Load the appropriate timer package. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
41 (if (featurep 'xemacs) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
42 (require 'timer-funcs) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
43 (require 'timer)) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
44 |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
45 ;; tramp-util offers integration into other (X)Emacs packages like |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
46 ;; compile.el, gud.el etc. Not necessary in Emacs 23. |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
47 (eval-after-load "tramp" |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
48 ;; We check whether `start-file-process' is an alias. |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
49 '(when (or (not (fboundp 'start-file-process)) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
50 (symbolp (symbol-function 'start-file-process))) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
51 (require 'tramp-util) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
52 (add-hook 'tramp-unload-hook |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
53 '(lambda () |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
54 (when (featurep 'tramp-util) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
55 (unload-feature 'tramp-util 'force)))))) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
56 |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
57 ;; Make sure that we get integration with the VC package. When it |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
58 ;; is loaded, we need to pull in the integration module. Not |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
59 ;; necessary in Emacs 23. |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
60 (eval-after-load "vc" |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
61 (eval-after-load "tramp" |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
62 ;; We check whether `start-file-process' is an alias. |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
63 '(when (or (not (fboundp 'start-file-process)) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
64 (symbolp (symbol-function 'start-file-process))) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
65 (require 'tramp-vc) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
66 (add-hook 'tramp-unload-hook |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
67 '(lambda () |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
68 (when (featurep 'tramp-vc) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
69 (unload-feature 'tramp-vc 'force))))))) |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
70 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
71 ;; Avoid byte-compiler warnings if the byte-compiler supports this. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
72 ;; Currently, XEmacs supports this. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
73 (when (featurep 'xemacs) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
74 (unless (boundp 'byte-compile-default-warnings) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
75 (defvar byte-compile-default-warnings nil)) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
76 (delq 'unused-vars byte-compile-default-warnings)) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
77 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
78 ;; `last-coding-system-used' is unknown in XEmacs. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
79 (unless (boundp 'last-coding-system-used) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
80 (defvar last-coding-system-used nil)) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
81 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
82 ;; `directory-sep-char' is an obsolete variable in Emacs. But it is |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
83 ;; used in XEmacs, so we set it here and there. The following is |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
84 ;; needed to pacify Emacs byte-compiler. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
85 (unless (boundp 'byte-compile-not-obsolete-var) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
86 (defvar byte-compile-not-obsolete-var nil)) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
87 (setq byte-compile-not-obsolete-var 'directory-sep-char) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
88 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
89 ;; `with-temp-message' does not exists in XEmacs. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
90 (condition-case nil |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
91 (with-temp-message (current-message) nil) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
92 (error (defmacro with-temp-message (message &rest body) `(progn ,@body)))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
93 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
94 ;; `set-buffer-multibyte' comes from Emacs Leim. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
95 (unless (fboundp 'set-buffer-multibyte) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
96 (defalias 'set-buffer-multibyte 'ignore)) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
97 |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
98 ;; `font-lock-add-keywords' does not exist in XEmacs. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
99 (unless (fboundp 'font-lock-add-keywords) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
100 (defalias 'font-lock-add-keywords 'ignore)) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
101 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
102 ;; `file-remote-p' has been introduced with Emacs 22. The version |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
103 ;; of XEmacs is not a magic file name function (yet); this is |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
104 ;; corrected in tramp-util.el. Here it is sufficient if the |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
105 ;; function exists. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
106 (unless (fboundp 'file-remote-p) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
107 (defalias 'file-remote-p 'tramp-handle-file-remote-p)) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
108 |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
109 ;; `process-file' exists since Emacs 22. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
110 (unless (fboundp 'process-file) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
111 (defalias 'process-file 'tramp-handle-process-file)) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
112 |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
113 ;; `start-file-process' is new in Emacs 23. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
114 (unless (fboundp 'start-file-process) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
115 (defalias 'start-file-process 'tramp-handle-start-file-process)) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
116 |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
117 ;; `set-file-times' is also new in Emacs 23. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
118 (unless (fboundp 'set-file-times) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
119 (defalias 'set-file-times 'tramp-handle-set-file-times))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
120 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
121 (defsubst tramp-compat-line-end-position () |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
122 "Return point at end of line (compat function). |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
123 Calls `line-end-position' or `point-at-eol' if defined, else |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
124 own implementation." |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
125 (cond |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
126 ((fboundp 'line-end-position) (funcall (symbol-function 'line-end-position))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
127 ((fboundp 'point-at-eol) (funcall (symbol-function 'point-at-eol))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
128 (t (save-excursion (end-of-line) (point))))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
129 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
130 (defsubst tramp-compat-temporary-file-directory () |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
131 "Return name of directory for temporary files (compat function). |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
132 For Emacs, this is the variable `temporary-file-directory', for XEmacs |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
133 this is the function `temp-directory'." |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
134 (cond |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
135 ((boundp 'temporary-file-directory) (symbol-value 'temporary-file-directory)) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
136 ((fboundp 'temp-directory) (funcall (symbol-function 'temp-directory))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
137 ((let ((d (getenv "TEMP"))) (and d (file-directory-p d))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
138 (file-name-as-directory (getenv "TEMP"))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
139 ((let ((d (getenv "TMP"))) (and d (file-directory-p d))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
140 (file-name-as-directory (getenv "TMP"))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
141 ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
142 (file-name-as-directory (getenv "TMPDIR"))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
143 ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp")) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
144 (t (message (concat "Neither `temporary-file-directory' nor " |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
145 "`temp-directory' is defined -- using /tmp.")) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
146 (file-name-as-directory "/tmp")))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
147 |
85041
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
148 ;; `make-temp-file' exists in Emacs only. The third parameter SUFFIX |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
149 ;; has been introduced with Emacs 22. We try it, if it fails, we fall |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
150 ;; back to `make-temp-name', creating the temporary file immediately |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
151 ;; in order to avoid a security hole. |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
152 (defsubst tramp-compat-make-temp-file (filename) |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
153 "Create a temporary file (compat function). |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
154 Add the extension of FILENAME, if existing." |
94402
2faa99de7eef
* net/tramp.el (tramp-handle-make-symbolic-link)
Michael Albinus <michael.albinus@gmx.de>
parents:
92981
diff
changeset
|
155 (let* (file-name-handler-alist |
2faa99de7eef
* net/tramp.el (tramp-handle-make-symbolic-link)
Michael Albinus <michael.albinus@gmx.de>
parents:
92981
diff
changeset
|
156 (prefix (expand-file-name |
2faa99de7eef
* net/tramp.el (tramp-handle-make-symbolic-link)
Michael Albinus <michael.albinus@gmx.de>
parents:
92981
diff
changeset
|
157 (symbol-value 'tramp-temp-name-prefix) |
2faa99de7eef
* net/tramp.el (tramp-handle-make-symbolic-link)
Michael Albinus <michael.albinus@gmx.de>
parents:
92981
diff
changeset
|
158 (tramp-compat-temporary-file-directory))) |
2faa99de7eef
* net/tramp.el (tramp-handle-make-symbolic-link)
Michael Albinus <michael.albinus@gmx.de>
parents:
92981
diff
changeset
|
159 (extension (file-name-extension filename t)) |
2faa99de7eef
* net/tramp.el (tramp-handle-make-symbolic-link)
Michael Albinus <michael.albinus@gmx.de>
parents:
92981
diff
changeset
|
160 result) |
85041
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
161 (condition-case nil |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
162 (setq result |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
163 (funcall (symbol-function 'make-temp-file) prefix nil extension)) |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
164 (error |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
165 ;; We use our own implementation, taken from files.el. |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
166 (while |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
167 (condition-case () |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
168 (progn |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
169 (setq result (concat (make-temp-name prefix) extension)) |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
170 (write-region |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
171 "" nil result nil 'silent nil |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
172 ;; 7th parameter is MUSTBENEW in Emacs, and |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
173 ;; CODING-SYSTEM in XEmacs. It is not a security |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
174 ;; hole in XEmacs if we cannot use this parameter, |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
175 ;; because XEmacs uses a user-specific subdirectory |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
176 ;; with 0700 permissions. |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
177 (when (not (featurep 'xemacs)) 'excl)) |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
178 nil) |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
179 (file-already-exists t)) |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
180 ;; The file was somehow created by someone else between |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
181 ;; `make-temp-name' and `write-region', let's try again. |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
182 nil))) |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
183 result)) |
a42b8750a992
* net/tramp.el (tramp-make-temp-file): Move to tramp-compat.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
85024
diff
changeset
|
184 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
185 ;; `most-positive-fixnum' arrived in Emacs 22. Before, and in XEmacs, |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
186 ;; it is a fixed value. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
187 (defsubst tramp-compat-most-positive-fixnum () |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
188 "Return largest positive integer value (compat function)." |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
189 (cond |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
190 ((boundp 'most-positive-fixnum) (symbol-value 'most-positive-fixnum)) |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
191 ;; Default value in XEmacs and Emacs 21. |
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
192 (t 134217727))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
193 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
194 ;; ID-FORMAT exists since Emacs 22. |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
195 (defun tramp-compat-file-attributes (filename &optional id-format) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
196 "Like `file-attributes' for Tramp files (compat function)." |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
197 (cond |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
198 ((or (null id-format) (eq id-format 'integer)) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
199 (file-attributes filename)) |
91790
c568e49dbbc5
(tramp-compat-file-attributes): Add comment.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87665
diff
changeset
|
200 ;; FIXME: shouldn't that be tramp-file-p or somesuch? |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
201 ((file-remote-p filename) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
202 (funcall (symbol-function 'tramp-handle-file-attributes) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
203 filename id-format)) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
204 (t (condition-case nil |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
205 (funcall (symbol-function 'file-attributes) filename id-format) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
206 (error (file-attributes filename)))))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
207 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
208 ;; PRESERVE-UID-GID has been introduced with Emacs 23. It does not |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
209 ;; hurt to ignore it for other (X)Emacs versions. |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
210 (defun tramp-compat-copy-file |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
211 (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
212 "Like `copy-file' for Tramp files (compat function)." |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
213 (if preserve-uid-gid |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
214 (funcall |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
215 (symbol-function 'copy-file) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
216 filename newname ok-if-already-exists keep-date preserve-uid-gid) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
217 (copy-file filename newname ok-if-already-exists keep-date))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
218 |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
219 ;; `copy-tree' is a built-in function in XEmacs. In Emacs 21, it is |
92981
9ee1ca8ab653
*** empty log message ***
Michael Albinus <michael.albinus@gmx.de>
parents:
91790
diff
changeset
|
220 ;; an autoloaded function in cl-extra.el. Since Emacs 22, it is part |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
221 ;; of subr.el. There are problems when autoloading, therefore we test |
92981
9ee1ca8ab653
*** empty log message ***
Michael Albinus <michael.albinus@gmx.de>
parents:
91790
diff
changeset
|
222 ;; for `subrp' and `symbol-file'. Implementation is taken from Emacs23. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
223 (defun tramp-compat-copy-tree (tree) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
224 "Make a copy of TREE (compat function)." |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84992
diff
changeset
|
225 (if (or (subrp 'copy-tree) (symbol-file 'copy-tree)) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
226 (funcall (symbol-function 'copy-tree) tree) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
227 (let (result) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
228 (while (consp tree) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
229 (let ((newcar (car tree))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
230 (if (consp (car tree)) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
231 (setq newcar (tramp-compat-copy-tree (car tree)))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
232 (push newcar result)) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
233 (setq tree (cdr tree))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
234 (nconc (nreverse result) tree)))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
235 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
236 (provide 'tramp-compat) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
237 |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
238 ;;; TODO: |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
239 |
84992 | 240 ;; arch-tag: 0e724b18-6699-4f87-ad96-640b272e5c85 |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
241 ;;; tramp-compat.el ends here |