emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: dired-do-rename on "." and ".."


From: Luc Teirlinck
Subject: Re: dired-do-rename on "." and ".."
Date: Mon, 9 Jun 2003 08:07:56 -0500 (CDT)

Richard Stallman wrote:

          If one has a bunch of marked files including . and .. , I am
          personally not even really sure what the result of R , C , S
          , H , and some others _ought_ to be. These commands would
          operate on different levels of the directory tree, with
          potentially confusing results.

       You are right.  It seems to me now that I never used "S" on ".".
       Sorry for the misleading remark.

   It seems pretty clear to me what these operations would do,
   including S, for example--making a link to `.' or `..' is like
   making a link to `foo'.

I originally looked at R, because that was what the original problem
was about.  I may have generalized too hastily to the other stuff.
My original idea was to undo your change, as Markus asked for, and
make R behave "as expected".  However:

We mark:

file1
.
file2
..

We rename the marked files to directory b

We now get:

b/file1 and b/. which now contains all files originally in . except
file1

./file2 is now a non-existent file in a no longer existing directory
Do we throw an error or do we update and rename b/./file2 to b/file2 ?

.. still exists, but is no longer the parent directory of .

My guess is that the user wound up marking . and .. inadvertently.  I
would throw an error from the very beginning without renaming
anything.  (Which is exactly what currently happens.)

For the other commands, I may have concluded too hastily that there
was a similar problem.  However, my guess is that in at least 90% of
the cases where this situation occurs in practice, even for the other
commands, the user wound up marking . and .. by accident, for instance
by misunderstanding * /

An alternative we could consider is to only make R throw an error when
applied to . and ..  Of course, the user could do ! mv , but the rules
for applying ! are well defined and it is the user's responsibility
that what he asks for is what he wants.  We could take the same
attitude for R except that it gives us updating problems and we would
be spending a lot of effort on something of very dubious utility.

Sincerely,

Luc.






reply via email to

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