all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
Cc: emacs-devel@gnu.org
Subject: Re: tiny patch to ange-ftp
Date: Mon, 03 Oct 2005 20:04:44 +0900	[thread overview]
Message-ID: <b4mslvi97zn.fsf@jpl.org> (raw)
In-Reply-To: 87ll1chs0h.fsf-monnier+emacs@gnu.org

>>>>> In <87ll1chs0h.fsf-monnier+emacs@gnu.org>
>>>>>	Stefan Monnier <monnier@iro.umontreal.ca> 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

      reply	other threads:[~2005-10-03 11:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b4mhde4fno0.fsf@jpl.org>
     [not found] ` <m1br46adb8.fsf-monnier+emacs@gnu.org>
     [not found]   ` <b4mr7d2o3j1.fsf@jpl.org>
     [not found]     ` <b4mbr46t4o1.fsf@jpl.org>
     [not found]       ` <b4mslxi3sp8.fsf@jpl.org>
     [not found]         ` <b4mu0hxp3h9.fsf@jpl.org>
     [not found]           ` <m17jer7ikd.fsf-monnier+emacs@gnu.org>
     [not found]             ` <b4m1x4zeiw6.fsf@jpl.org>
     [not found]               ` <m18xz761ro.fsf-monnier+emacs@gnu.org>
     [not found]                 ` <b4m1x4zuwmj.fsf@jpl.org>
     [not found]                   ` <b4miry7ptpu.fsf@jpl.org>
     [not found]                     ` <b4moe7yr42b.fsf@jpl.org>
     [not found]                       ` <b4mmzninzyb.fsf@jpl.org>
     [not found]                         ` <jwvek88ju9q.fsf-monnier+emacs@gnu.org>
     [not found]                           ` <b4mbr3cs7vg.fsf@jpl.org>
2005-09-02 14:14                             ` tiny patch to ange-ftp Stefan Monnier
2005-09-08  3:57                               ` Katsumi Yamaoka
2005-09-08  4:46                                 ` Katsumi Yamaoka
2005-09-08 20:50                                   ` Stefan Monnier
2005-09-21 23:41                                     ` Katsumi Yamaoka
2005-09-22 15:06                                       ` Stefan Monnier
2005-09-29  0:00                                         ` Katsumi Yamaoka
2005-09-30 21:05                                           ` Stefan Monnier
2005-10-01 12:23                                             ` Katsumi Yamaoka
2005-10-02 16:04                                               ` Stefan Monnier
2005-10-03 11:04                                                 ` Katsumi Yamaoka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mslvi97zn.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.