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: Mon, 03 Oct 2005 20:04:44 +0900 Message-ID: References: <877jdrnv2k.fsf-monnier+emacs@gnu.org> <878xxpxhvc.fsf-monnier+emacs@gnu.org> <87k6gyi7vo.fsf-monnier+emacs@gnu.org> <87ll1chs0h.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 1128338106 11546 80.91.229.2 (3 Oct 2005 11:15:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Oct 2005 11:15:06 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 03 13:15:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMOGy-0008PC-Qd for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 13:14:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMOGw-0002qx-7w for ged-emacs-devel@m.gmane.org; Mon, 03 Oct 2005 07:14:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EMOAk-00013S-8m for emacs-devel@gnu.org; Mon, 03 Oct 2005 07:07:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EMOAi-00012p-U6 for emacs-devel@gnu.org; Mon, 03 Oct 2005 07:07:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EMO7p-000831-3Z for emacs-devel@gnu.org; Mon, 03 Oct 2005 07:04:53 -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 1EMO7o-0003d0-LM for emacs-devel@gnu.org; Mon, 03 Oct 2005 07:04:52 -0400 Original-Received: from yahoobb218118002085.bbtec.net ([218.118.2.85]:64685 helo=) by washington.hostforweb.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52) id 1EMO7m-0001ma-V3; Mon, 03 Oct 2005 06:04:51 -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:w0vg4a3aJujBNFXqvVTg2DpnqdM= 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:43486 Archived-At: >>>>> In <87ll1chs0h.fsf-monnier+emacs@gnu.org> >>>>> Stefan Monnier wrote: > I've just installed a patch which should fix it. Does it work for you? Thanks! It works fine, but I prefer the second patch... > Although the patch works (it fixes the symlink-following code), in reality, > I see no reason why we should follow symlinks at all. The normal code for > insert-directory doesn't follow symlinks, so why should the ange-ftp > version of it do it? It seems to be asking for trouble, especially in the > present case: what if dired wants to refresh a single line that contains > a symlink? > The change to follow symlinks has sadly no explanation: > revision 1.20 > date: 2001/12/29 02:50:34; author: rms; state: Exp; lines: +12 -6 > (ange-ftp-insert-directory): Explicitly follow symlinks. > In the ChangeLog file, we get a tiny bit more info: > * net/ange-ftp.el (ange-ftp-allow-child-lookup): Always return nil. > This fixes a bug that treated all files as directories. > (ange-ftp-insert-directory): Explicitly follow symlinks. > But it's still not clear why we'd want to follow symlinks. My suspicion is > that at that time, it was necessary to follow symlinks in order for the > ange-ftp-ls command to give us a listing of a directory rather than just the > single-line listing of a symlink. In that case, this is not a problem any > more since ange-ftp-ls now does "cd foo; ls" rather than "ls foo". So I'd > be happy to install the second patch. I tried the second patch. I think it is much better, and I can agree that to follow symlinks there is meaningless. > To see one of the problems with the idea of following symlinks, try > something like > (insert-directory "/ftp@ftp.gnu.org:/pub" "-lFd") > Of course, there's also the problem where the symlink points to itself. > And also the problem that > (insert-directory "/ftp@ftp.gnu.org:/pub/gnu/winboard" "-lFd") > will not list > lrwxrwxrwx 1 0 0 15 Nov 21 2003 winboard -> xboard/winboard > but > drwxrwxr-x 2 0 1003 4096 Nov 29 2003 winboard/ > Contrary to what it would have done if we were working locally. > Stefan I think concealing of file's identity is needless and unhelpful. > --- ange-ftp.el 02 oct 2005 11:37:24 -0400 1.74 > +++ ange-ftp.el 02 oct 2005 11:38:44 -0400 > @@ -4481,14 +4481,6 @@ > (defun ange-ftp-insert-directory (file switches &optional wildcard full) > (if (not (ange-ftp-ftp-name (expand-file-name file))) > (ange-ftp-real-insert-directory file switches wildcard full) > - ;; Follow symlinks. > - (let (tem) > - (while (and (not wildcard) > - (stringp (setq tem (file-symlink-p > - (directory-file-name file))))) > - (setq file > - (ange-ftp-expand-symlink > - tem (file-name-directory (directory-file-name file)))))) > (insert > (cond > (wildcard