From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel Subject: Re: tiny patch to ange-ftp Date: Thu, 22 Sep 2005 08:41:41 +0900 Organization: Emacsen advocacy group Message-ID: References: <877jdrnv2k.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1127346975 11578 80.91.229.2 (21 Sep 2005 23:56:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Sep 2005 23:56:15 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 22 01:56:12 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EIEQL-0005am-6R for ged-emacs-devel@m.gmane.org; Thu, 22 Sep 2005 01:54:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EIEQK-0005G5-M0 for ged-emacs-devel@m.gmane.org; Wed, 21 Sep 2005 19:54:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EIEPI-0004uU-Q3 for emacs-devel@gnu.org; Wed, 21 Sep 2005 19:53:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EIEPC-0004rd-Uc for emacs-devel@gnu.org; Wed, 21 Sep 2005 19:53:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EIEPC-0004k2-F3 for emacs-devel@gnu.org; Wed, 21 Sep 2005 19:53:38 -0400 Original-Received: from [66.225.201.13] (helo=washington.hostforweb.net) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EIEDs-0000i9-IC for emacs-devel@gnu.org; Wed, 21 Sep 2005 19:41:56 -0400 Original-Received: from localhost.servershost.net ([127.0.0.1] helo=localhost) by washington.hostforweb.net with esmtpa (Exim 4.52) id 1EIEDt-0003Ma-KD; Wed, 21 Sep 2005 18:41:57 -0500 Original-To: Stefan Monnier X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:olVBQwkq0+87VX6zk0jTZehFiCw= X-Hashcash: 1:20:050921:monnier@iro.umontreal.ca::2IHChIhsL2HyTo0P:000000000000000000000000000000000000011JQ X-Hashcash: 1:20:050921:emacs-devel@gnu.org::1NNjpV/z8M2pxF8z:0000000000000000000000000000000000000000003OAe X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43141 Archived-At: 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 (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)