[Top][All Lists]

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

-I switch to ls and dired.

From: Luc Teirlinck
Subject: -I switch to ls and dired.
Date: Tue, 8 Jun 2004 22:42:45 -0500 (CDT)

Using both the -R switch (to ls) and the -I switch with a pattern
containing R in dired can cause trouble.

Make sure to have a file with an "R" in its name, say "aRa", in a
subdir, say "subdir" of ~/.  Make sure that "subdir" contains other
files, say myfile1 and myfile2.  Then do `C-u C-x d RET -al -I *R* RET
RET, then do 'i' on subdir.  Note that not only "aRa" is not listed
(clearly it should not), but also myfile{1,2} are not listed.

The reason for this is that dired and dired-aux systematically check
whether the "R" switch has been used by just checking whether the
string passed as switches to ls contains _some_ "R" _anywhere_ and if
for some reason the "R" switch needs to be removed, _all_ R's in the
string are removed.  Thus the shell pattern `*R* becomes `**' matching
anything (except `.' and `..' for technical reasons).

There is no telling what pattern the user might want to ignore with
-I.  There is no reason why that pattern could not contain "R". 

What do we do with the above?  Completely ignore it?  Just document
it?  Fix it?  Fixing it unconditionally might be difficult, but fixing
it modulo some (to be documented) conventions seems very feasible.
Conventions making things easy would be to always use -I instead of
the long --ignore= option (that is what people would do anyway) and, if
one is going to use both the -R switch and -I *R*, use the R switch
_before_ the -I switch (that again is what people would probably do




reply via email to

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