[Top][All Lists]

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

dired should clear marks after most operations, or something

From: Michael John Downes
Subject: dired should clear marks after most operations, or something
Date: Wed, 11 Apr 2001 11:49:50 -0400 (EDT)

In GNU Emacs 20.7.1 (sparc-sun-solaris2.7, X toolkit)
 of Thu Sep 21 2000 on thor
configured using `configure  --with-x'

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

I marked several directories for changing the permissions. And I changed
them. Then I put the cursor on another directory that I wanted to
remove, along with its subdirectories. I would have done a normal "d"
for delete but I "knew" that dired delete won't delete nonempty
directories. So

  !rm -rf<RET>

But wait! Me fool! I was in a hurry and pressed RET before I noticed
that Emacs was showing me a list of all those OTHER directories that
were still marked and that Emacs intended to apply the shell command

Good-bye, directory BAR. Good-bye, directory FOO. Good-bye, directory
GLUB. ... Alas. I did manage to save some of them by hasty resorting to
C-g. But I lost a big chunk of files. Good thing there was still a copy
of this material on another machine so I didn't have to crawl to the
sysadmins and beg for a restore from backup and nobody but me found
out how really stupid a blunder I made.

So why a bug report? Because I realized this is only the latest instance
of such a mistake that I have made many times in dired. I thought I was
going to operate on the file under the cursor but Emacs still wanted to
operate on the list of marked files that I had marked for a preceding,
now finished, operation.

I'm not sure what to suggest but it seems clear to me at least that the
current strategy of leaving the marks marked makes it *too* easy for
people to shoot themselves in the foot. One possibility would be to
automatically clear marks after every multi-file operation but provide
an easy way to put back the same marks with one or two keystrokes.

If I thought I were extraordinarily much more blunder-prone than most
users I would say "my problem" and not send a bug report. But if
something like this can happen to me through a moment of inattention
then I think it is probably happening to a lot of other users as well.
Therefore, I think that persistent dired marks should not be the default
dired behavior, although they could be an option for power users.

It would also help if there were a transparent way in Dired for
"delete" to do the right thing when applied to a directory---there may
be different opinions about what is the "right thing" but I would say

---either delete dir & subdirs with a suitable amount of prompting for

---or else forbear to delete them but give a message explaining what is
the alternative command for deleting a directory when that is really
what the user wants to do.

Documentation bug: The emacs:Dired:Deletion node doesn't give any
information about deleting directories. Info search for
"delete.*director" only turned up the delete-directory command, which
only handles empty directories.

Recent input:
... ! r m SPC - r f return C-g C-g C-g g f6 r e p o r return

Recent messages:
Loading emacsbug...
Loading emacsbug...done

reply via email to

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