emacs-devel
[Top][All Lists]
Advanced

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

Re: tiny patch to ange-ftp


From: Katsumi Yamaoka
Subject: Re: tiny patch to ange-ftp
Date: Thu, 22 Sep 2005 08:41:41 +0900
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Hi,

Could you apply the patch to ange-ftp.el?  I hope it is widely
tested by people who update-build Emacs everyday.  It enables at
least me to upload files to remote hosts smoothly and I believe
it doesn't worsen things than now.

2005-09-21  Katsumi Yamaoka  <address@hidden>  (tiny change)

        * net/ange-ftp.el (ange-ftp-insert-directory): Work with a single
        file listing.

*** ange-ftp.el~        Wed Sep 14 21:52:07 2005
--- ange-ftp.el Wed Sep 21 23:39:58 2005
***************
*** 2324,2339 ****
        ;; This works around a misfeature of some versions of netbsd ftpd
        ;; where `ls' can only take one argument: either one set of flags
        ;; or a file/directory name.
-       ;; FIXME: if we're trying to `ls' a single file, this fails since we
-       ;; can't cd to a file.  We can't fix this problem here, tho, because
-       ;; at this point we don't know whether the argument is a file or
-       ;; a directory.  Such an `ls' is only every used (apparently) from
-       ;; `insert-directory' when the `full-directory-p' argument is nil
-       ;; (which seems to only be used by dired when updating its display
-       ;; after operating on a set of files).  We should change
-       ;; ange-ftp-insert-directory so that this case is handled by getting
-       ;; a full listing of the directory and extracting the line
-       ;; corresponding to the requested file.
        (unless (equal cmd1 ".")
          (setq result (ange-ftp-cd host user (nth 1 cmd) 'noerror)))
        (setq cmd1 cmd3)))
--- 2324,2329 ----
***************
*** 4489,4495 ****
           (if wildcard
               (let ((default-directory (file-name-directory file)))
                 (ange-ftp-ls (file-name-nondirectory file) switches nil nil t))
!            (ange-ftp-ls file switches full))))
        (ange-ftp-real-insert-directory file switches wildcard full))))
  
  (defun ange-ftp-dired-uncache (dir)
--- 4479,4501 ----
           (if wildcard
               (let ((default-directory (file-name-directory file)))
                 (ange-ftp-ls (file-name-nondirectory file) switches nil nil t))
!            ;; That `full' is nil means we're going to do `ls' for
!            ;; a single file in the current directory.
!            (if full
!                (ange-ftp-ls file switches full)
!              ;; Get a full listing of the current directory and
!              ;; extract the line corresponding to `file'.
!              (when (string-match "d\\'" switches)
!                ;; Remove "d" which dired added to `switches'.
!                (setq switches (substring switches 0 (match-beginning 0))))
!              (setq tem (ange-ftp-ls "." switches nil))
!              (let ((case-fold-search nil))
!                ;; Assume the file name which a single space precedes
!                ;; appears at the end of a line.
!                (if (string-match (concat "^.+[^ ] " (regexp-quote file) "$")
!                                  tem)
!                    (concat (match-string 0 tem) "\n")
!                  ""))))))
        (ange-ftp-real-insert-directory file switches wildcard full))))
  
  (defun ange-ftp-dired-uncache (dir)




reply via email to

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