annotate lisp/net/tramp-util.el @ 51603:978e262c8f3a

Version 2.0.35 of Tramp released. * net/tramp.el (tramp-password-end-of-line): Use "xy" with plink. (tramp-completion-function-alist): Add completion function for "remcp", "remsh" and "plink1". Factor out the `regular' file name handling via a remote shell of some sort into a specific function. Intent is to later put that part of Tramp into a special file, so that the Tramp `core' is just a dispatcher that dispatches to various handlers. (tramp-sh-file-name-handler): New function. (tramp-foreign-file-name-handler-alist): New default value. Call tramp-sh-file-name-handler as default case. (tramp-file-name-handler): Do not invoke the old remote-shell handler. (tramp-find-foreign-file-name-handler): Return after first match is found. From Francis Litterio <franl@world.std.com>. (tramp-handle-file-newer-than-file-p): `tramp-time-diff' returns integer, not list. Do not apply `car' to the return value of `tramp-time-diff'. Reported by David D. Smith <ultrasoul@ultrasoul.com>. (tramp-time-diff): Convert return value of subtract-time to a number of seconds in a correct manner, by applying float-time or time-to-seconds. Also correct compat code accordingly. The XEmacs branch for itimer-time-difference didn't need correction, it returned a float already. Reported by David D. Smith <ultrasoul@ultrasoul.com>. (tramp-handle-insert-file-contents): When calling `file-local-copy', let-bind `inhibit-file-name-operation' accordingly. This makes sure that jka-compr is not called when `insert-file-contents-literally' is invoked. From Katsumi Yamaoka <yamaoka@jpl.org>. (tramp-do-copy-or-rename-via-buffer): Avoid calling jka-compr when writing the target file. (tramp-foreign-file-name-handler-alist): Add comment about default value having to come last. (tramp-handle-file-local-copy, tramp-handle-write-region): Add the "-p" hack. (tramp-handle-copy-file): Set file modes of target file. (tramp-handle-file-local-copy) (tramp-do-copy-or-rename-via-buffer): Use binary coding system, instead of no-conversion. They are the same on Emacs but different on XEmacs. (tramp-shell-prompt-pattern): Allow multiple escape sequences (each with optional trailing space). * net/tramp-uu.el: * net/tramp-util.el: * net/tramp-efs.el: Use iso-2022-7bit encoding with coding cookie for XEmacs compatibility.
author Kai Großjohann <kgrossjo@eu.uu.net>
date Tue, 17 Jun 2003 14:03:58 +0000
parents 09acf3f65bb5
children 695cf19ef79e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
51603
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 48973
diff changeset
1 ;;; -*- coding: iso-2022-7bit; -*-
48973
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2 ;;; tramp-util.el --- Misc utility functions to use with Tramp
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4 ;; Copyright (C) 2001 Free Software Foundation, Inc.
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5
51603
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 48973
diff changeset
6 ;; Author: Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
48973
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7 ;; Keywords: comm, extensions, processes
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
8
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
9 ;; This file is free software; you can redistribute it and/or modify
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
12 ;; any later version.
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
13
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
14 ;; This file is distributed in the hope that it will be useful,
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
17 ;; GNU General Public License for more details.
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
18
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
21 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
23
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
24 ;;; Commentary:
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
25
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
26 ;; Some misc. utility functions that might go nicely with Tramp.
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
27 ;; Mostly, these are kluges awaiting real solutions later on.
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
28
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
29 ;;; Code:
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
30
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
31 (eval-when-compile (require 'cl))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
32 (require 'compile)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
33 (require 'tramp)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
34
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
35 (defun tramp-compile (command)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
36 "Compile on remote host."
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
37 (interactive
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
38 (if (or compilation-read-command current-prefix-arg)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
39 (list (read-from-minibuffer "Compile command: "
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
40 compile-command nil nil
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
41 '(compile-history . 1)))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
42 (list compile-command)))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
43 (setq compile-command command)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
44 (save-some-buffers (not compilation-ask-about-save) nil)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
45 (let ((d default-directory))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
46 (save-excursion
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
47 (pop-to-buffer (get-buffer-create "*Compilation*") t)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
48 (erase-buffer)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
49 (setq default-directory d)))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
50 (tramp-handle-shell-command command (get-buffer "*Compilation*"))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
51 (pop-to-buffer (get-buffer "*Compilation*"))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
52 (compilation-minor-mode 1))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
53
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
54 (provide 'tramp-util)
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
55 ;;; tramp-util.el ends here