tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tramp (2.0.7); copy-file fails due to unsupported insert-file-co


From: Michael Shields
Subject: [PATCH] tramp (2.0.7); copy-file fails due to unsupported insert-file-contents-literally
Date: Sun, 04 Aug 2002 06:24:41 +0000
User-agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.4 (Common Lisp, i386-debian-linux)

Tramp does not have a handler for insert-file-contents-literally,
This causes copy-file to fail if the first argument is a Tramp file,
because tramp-do-copy-or-rename-via-buffer fetches the file contents
using insert-file-contents-literally.  (Copies in the other direction
work fine.)


--- ChangeLog.orig      2002-08-03 15:42:57.000000000 +0000
+++ ChangeLog   2002-08-03 21:33:54.000000000 +0000
@@ -1,3 +1,13 @@
+2002-08-03  Michael Shields  <address@hidden>
+
+       * tramp.el (tramp-file-name-handler-alist): Add handler for
+       insert-file-contents-literally.
+       (tramp-handle-insert-file-contents,
+       tramp-handle-insert-file-contents-literally): Wrappers around
+       tramp-really-handle-insert-file-contents.
+       (tramp-really-handle-insert-file-contents): New, formed from the
+       old tramp-handle-insert-file-contents.
+
 2002-08-03  Kai Großjohann  <address@hidden>
 
        Version 2.0.6 released.
--- tramp.el.orig       2002-08-03 16:06:44.000000000 +0000
+++ tramp.el    2002-08-03 21:27:09.000000000 +0000
@@ -1414,6 +1414,7 @@
     (expand-file-name . tramp-handle-expand-file-name)
     (file-local-copy . tramp-handle-file-local-copy)
     (insert-file-contents . tramp-handle-insert-file-contents)
+    (insert-file-contents-literally . 
tramp-handle-insert-file-contents-literally)
     (write-region . tramp-handle-write-region)
     (unhandled-file-name-directory . 
tramp-handle-unhandled-file-name-directory)
     (dired-call-process . tramp-handle-dired-call-process)
@@ -2846,6 +2847,18 @@
 (defun tramp-handle-insert-file-contents
   (filename &optional visit beg end replace)
   "Like `insert-file-contents' for tramp files."
+  (tramp-really-handle-insert-file-contents 'insert-file-contents
+                                           filename visit beg end replace))
+
+(defun tramp-handle-insert-file-contents-literally
+  (filename &optional visit beg end replace)
+  "Like `insert-file-contents-literally' for tramp files."
+  (tramp-really-handle-insert-file-contents 'insert-file-contents-literally
+                                           filename visit beg end replace))
+
+(defun tramp-really-handle-insert-file-contents
+  (real-handler filename &optional visit beg end replace)
+  "Like `insert-file-contents' for tramp files."
   (barf-if-buffer-read-only)
   (setq filename (expand-file-name filename))
   (with-parsed-tramp-file-name filename nil
@@ -2872,7 +2885,7 @@
         multi-method method user host
         9 "Inserting local temp file `%s'..." local-copy)
        (setq result
-             (tramp-run-real-handler 'insert-file-contents
+             (tramp-run-real-handler real-handler
                                      (list local-copy nil beg end replace)))
        ;; Now `last-coding-system-used' has right value.  Remember it.
        (when (boundp 'last-coding-system-used)




Emacs  : XEmacs 21.4 (patch 6) "Common Lisp" [Lucid] (i386-debian-linux, Mule) 
of Sat Apr  6 2002 on eeyore
Package: tramp (2.0.7)

current state:
==============
(setq
 tramp-ls-command nil
 tramp-test-groks-nt nil
 tramp-file-exists-command nil
 tramp-current-multi-method nil
 tramp-current-method nil
 tramp-current-user nil
 tramp-current-host nil
 tramp-auto-save-directory nil
 tramp-default-method "rsync"
 tramp-rsh-end-of-line "\n"
 tramp-remote-path '("/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" 
"/usr/ccs/bin" "/local/bin"
                     "/local/freeware/bin" "/local/gnu/bin" "/usr/freeware/bin" 
"/usr/pkg/bin"
                     "/usr/contrib/bin")
 tramp-login-prompt-regexp ".*ogin: *"
 tramp-password-prompt-regexp "^.*\\([pP]assword\\|passphrase.*\\):? *"
 tramp-wrong-passwd-regexp "^.*\\(?:Connection \\(?:closed\\|refused\\)\\|Host 
key verification failed\\.\\|Login \\(?:Incorrect\\|incorrect\\)\\|Name or 
service not known\\|Permission denied\\.\\|Sorry, try 
again\\.\\).*\\|^.*\\(Received signal [0-9]+\\).*"
 tramp-temp-name-prefix "tramp."
 tramp-file-name-structure 
'("\\`/\\[\\(\\([a-zA-Z0-9-]+\\)/\\)?\\(\\([-a-zA-Z0-9_#/:]+\\)@\\)?\\([-a-zA-Z0-9_#/:@.]+\\)\\]\\(.*\\)\\'"
 2 4 5 6)
 tramp-file-name-regexp "\\`/\\[.*\\]"
 tramp-multi-file-name-structure 
'("\\`/\\[\\(\\([a-z0-9]+\\)?\\)\\(\\(%s\\)+\\)\\]\\(.*\\)\\'" 2
                                   3 -1)
 tramp-multi-file-name-hop-structure 
'("/\\([a-z0-9_]+\\):\\([a-z0-9_]+\\)@\\([a-z0-9.-]+\\)" 1 2
                                       3)
 tramp-multi-methods '("multi" "multiu")
 tramp-multi-connection-function-alist '(("telnet" tramp-multi-connect-telnet 
"telnet %h%n")
                                         ("rsh" tramp-multi-connect-rlogin "rsh 
%h -l %u%n")
                                         ("ssh" tramp-multi-connect-rlogin "ssh 
%h -l %u%n")
                                         ("su" tramp-multi-connect-su "su - 
%u%n")
                                         ("sudo" tramp-multi-connect-su "sudo 
-u %u -s%n"))
 tramp-make-tramp-file-format "/[%m/address@hidden"
 tramp-end-of-output "/////"
 shell-prompt-pattern "^[^#$%>\n]*[#$%>] *"
 backup-by-copying nil
 backup-by-copying-when-linked t
 backup-by-copying-when-mismatch nil
 nil nil
 file-name-handler-alist 
'(("\\(\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'\\)\\|\\(\\.bz2\\(~\\|\\.~[0-9]+~\\)?\\'\\)\\|\\(\\.tgz\\'\\)\\|\\(\\.gz\\(~\\|\\.~[0-9]+~\\)?\\'\\)"
 . jka-compr-handler)
                           ("\\`/\\[.*\\]" . tramp-file-name-handler)
                           ("^/[^/:]+:" . remote-path-file-handler-function))
 )

-- 
Shields.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]