top | item 34594113

(no title)

kyberias | 3 years ago

I'm not an Emacs user so what I'm about to say may be based on totally incorrect information.

Seems to be that Wdired is just a hack that represents file and directory metadata in a textual format (in a buffer in Emacs parlance). It's not obvious to anyone that editing a filename in this buffer actually goes to the file system and changes the name of the file. It's even less obvious that removing rows removes files or directories. It actually sounds rather dangerous to use.

This is not functionality that emerges from some elegant design of Emacs, it seems it's just a hack.

discuss

order

a_e_k|3 years ago

First, Wdired is not the normal mode for Dired. You have to hit a key to activate that mode.

Second, it doesn't actually make any changes to the file system until you hit the key combo to commit them. And the files aren't deleted immediately, even when you do commit; they're just flagged for deletion in the standard Dired interface. You'll have to hit a button to actually "expunge" them from there, and that asks for confirmation again before doing so.

Think of Wdired more as a convenient way to build up a transaction of FS changes.

And since everything is a buffer, undo works just fine until you commit it. Or you can load up fresh Dired view of the original metadata in another buffer and ediff them to verify your changes before you commit. :-)

trocado|3 years ago

It's very obvious because you have to activate the wdired mode, and then accept the changes.