[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tramp (2.0.12); ange-ftp doesn't work
From: |
Michael Albinus |
Subject: |
Re: tramp (2.0.12); ange-ftp doesn't work |
Date: |
08 Aug 2002 17:26:13 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
Michael Albinus <address@hidden> writes:
> address@hidden (Kai =?iso-8859-15?q?Gro=DFjohann?=) writes:
>
> > I've made (yet another) change to tramp.el in the CVS. Could you try
> > that?
>
> Much better now; it works for both Emacs 20.7 and 21.2. Thanx a lot!
Hi,
I've been a little bit too rash with my statement. There are still
problems in the cooperation with ange-ftp, f.e. saving a file, or
running commands like dired-do-chmod or dired-do-rename over files
accessed via tramp/ange-ftp.
I've prepared a small patch which fixes these problems. Since Kai is
busy next time, he has suggested to announce it here in the
list. Maybe one you having write access to CVS can commit it. It's
based on the recent CVS files (and tramp 2.0.12). I've tested it with
both Emacs 20.7 and 21.2.
cd ~/src/tramp/lisp/
diff -c /home/albinus/src/tramp/lisp/ChangeLog.orig
/home/albinus/src/tramp/lisp/ChangeLog
*** /home/albinus/src/tramp/lisp/ChangeLog.orig Wed Aug 7 16:50:52 2002
--- /home/albinus/src/tramp/lisp/ChangeLog Thu Aug 8 16:31:43 2002
***************
*** 1,3 ****
--- 1,17 ----
+ 2002-08-08 Michael Albinus <address@hidden>
+
+ * tramp.el (tramp-do-copy-or-rename-file): Don't pass KEEP-DATE to
+ tramp-invoke-ange-ftp 'rename.
+ (tramp-handle-write-region): Don't pass LOCKNAME and CONFIRM to
+ tramp-invoke-ange-ftp 'write-region.
+ (tramp-handle-set-file-modes): Change order of FILENAME and MODE
+ passing to tramp-invoke-ange-ftp 'set-file-modes.
+ (tramp-flatten-list): New function. Maybe this functionality does
+ exist already elsewhere in the libraries.
+ (tramp-invoke-ange-ftp): Apply `tramp-flatten-list' to parameter
+ list in order to avoid nested lists, f.e. when invoked from
+ `tramp-handle-dired-call-process'.
+
2002-08-07 Kai Großjohann <address@hidden>
Version 2.0.12 released.
Diff finished at Thu Aug 8 17:11:34
cd ~/src/tramp/lisp/
diff -c /home/albinus/src/tramp/lisp/tramp.el.orig
/home/albinus/src/tramp/lisp/tramp.el
*** /home/albinus/src/tramp/lisp/tramp.el.orig Wed Aug 7 16:51:45 2002
--- /home/albinus/src/tramp/lisp/tramp.el Thu Aug 8 16:10:22 2002
***************
*** 1938,1944 ****
"Like `set-file-modes' for tramp files."
(with-parsed-tramp-file-name filename nil
(when (tramp-ange-ftp-file-name-p multi-method method)
! (tramp-invoke-ange-ftp 'set-file-modes filename mode))
(save-excursion
(unless (zerop (tramp-send-command-and-check
multi-method method user host
--- 1938,1944 ----
"Like `set-file-modes' for tramp files."
(with-parsed-tramp-file-name filename nil
(when (tramp-ange-ftp-file-name-p multi-method method)
! (tramp-invoke-ange-ftp 'set-file-modes mode filename))
(save-excursion
(unless (zerop (tramp-send-command-and-check
multi-method method user host
***************
*** 2337,2345 ****
;; Possibly invoke Ange-FTP.
(when (and (tramp-ange-ftp-file-name-p v1-multi-method v1-method)
(tramp-ange-ftp-file-name-p v2-multi-method v2-method))
! (tramp-invoke-ange-ftp
! (if (eq op 'copy) 'copy-file 'rename-file)
! filename newname ok-if-already-exists keep-date))
;; Check if we can use a shortcut.
(if (and (equal v1-multi-method v2-multi-method)
(equal v1-method v2-method)
--- 2337,2347 ----
;; Possibly invoke Ange-FTP.
(when (and (tramp-ange-ftp-file-name-p v1-multi-method v1-method)
(tramp-ange-ftp-file-name-p v2-multi-method v2-method))
! (if (eq op 'copy)
! (tramp-invoke-ange-ftp
! 'copy-file filename newname ok-if-already-exists keep-date)
! (tramp-invoke-ange-ftp
! 'rename-file filename newname ok-if-already-exists)))
;; Check if we can use a shortcut.
(if (and (equal v1-multi-method v2-multi-method)
(equal v1-method v2-method)
***************
*** 2919,2925 ****
(with-parsed-tramp-file-name filename nil
(when (tramp-ange-ftp-file-name-p multi-method method)
(tramp-invoke-ange-ftp 'write-region
! start end filename append visit lockname confirm))
(let ((curbuf (current-buffer))
(rcp-program (tramp-get-rcp-program multi-method method))
(rcp-args (tramp-get-rcp-args multi-method method))
--- 2921,2927 ----
(with-parsed-tramp-file-name filename nil
(when (tramp-ange-ftp-file-name-p multi-method method)
(tramp-invoke-ange-ftp 'write-region
! start end filename append visit))
(let ((curbuf (current-buffer))
(rcp-program (tramp-get-rcp-program multi-method method))
(rcp-args (tramp-get-rcp-args multi-method method))
***************
*** 3189,3194 ****
--- 3191,3209 ----
(cons jka (delete jka file-name-handler-alist))))))
(tramp-repair-jka-compr)
+ (defun tramp-flatten-list (arg)
+ "Expands all lists inside ARG to a sequential list. Return (nil) if arg is
nil."
+ (let ((car (car arg))
+ (cdr (cdr arg)))
+ (cond
+ ((eq arg nil) '(nil))
+ ((listp car)
+ (if (null cdr)
+ (tramp-flatten-list car)
+ (append (tramp-flatten-list car) (tramp-flatten-list cdr))))
+ ((null cdr) (list car))
+ (t (cons car (tramp-flatten-list cdr))))))
+
(defun tramp-invoke-ange-ftp (operation &rest args)
"Invoke the Ange-FTP handler function and throw."
(or (boundp 'ange-ftp-name-format) (require 'ange-ftp))
***************
*** 3198,3205 ****
(nth 2 tramp-file-name-structure)
(nth 4 tramp-file-name-structure))))
(throw 'tramp-forward-to-ange-ftp
! (tramp-run-real-handler 'ange-ftp-hook-function
! (cons operation args)))))
(defun tramp-ange-ftp-file-name-p (multi-method method)
"Check if it's a filename that should be forwarded to Ange-FTP."
--- 3213,3221 ----
(nth 2 tramp-file-name-structure)
(nth 4 tramp-file-name-structure))))
(throw 'tramp-forward-to-ange-ftp
! (tramp-run-real-handler
! 'ange-ftp-hook-function
! (tramp-flatten-list (cons operation args))))))
(defun tramp-ange-ftp-file-name-p (multi-method method)
"Check if it's a filename that should be forwarded to Ange-FTP."
Diff finished at Thu Aug 8 17:12:37
> > kai
Best regards, Michael.