

What does it do? It lets you use an arbitrary Lisp sexp as a predicate to determine which files or directories get marked. You would think that a command with two key bindings would be known more, but this one even has this amusing 4-year commentary in the source code: Does anyone use this? - lrd 6/29/93. How about command ‘dired-mark-sexp’, bound to ` M-(’ and ` * (’. The EmacsManual is really a gold mine and I plan to buy a printed version so that I can read a page each night when I go to bed. The section about renaming is Transforming File Names. I’ll leave it up to you to read the rest. If the old file names are ` Foo' and ` bar', Rename each of the selected files to a lower-case name If the old file names are ` Foo' and ` bar', the Rename each of the selected files to an upper-case name I’ll rip the text straight from the EmacsManual:

Which I have to say is quite good too.īut right now I noticed some cool commands that can do all of the above. Operations like make the filenames lowercase or uppercase, prefixing or suffixing files with a string was hard and I usually did it by recording a macro. You can read more about this at Marks vs Flags Renaming Files and Directoriesīefore library wdired.el (see WDired) came to life a while ago I thought that renaming files in dired was a pain. This assumes that no files were already marked with ` t'.
EMACS DIRED HOW TO
To illustrate the power of this command, here is how to put ` D'įlags on all the files that have no marks, while unflagging all Unmarked files if NEW-MARKCHAR is a space, then the command OLD-MARKCHAR is a space (` '), then the command operates on all This command, to distinguish various classes of files. You can use almost any character as a mark character by means of The arguments are single characters-do not use to ThisĬommand is the primary way to create or use marks other than ` *' That use the character NEW-MARKCHAR (` dired-change-marks'). Replace all marks that use the character OLD-MARKCHAR with marks

For example, try this command: * c OLD-MARKCHAR NEW-MARKCHAR Yes, I know, this should really be placed under Emacs nifty features, but I did not want to SPAM that page… :) – Alex says: Don’t worry, that page should be ripped appart and redistributed over the wiki!! Dired Marks vs Dired FlagsĪlso something I did not know: you can flag a file with almost any character, not just ‘D’ and ‘*’ which you are probably used to. Today I decided to read up on dired as I thought that there are surely a lot of power below the surface that I never use. It pays to browse the Emacs documentation now and then, just for fun (well, some of us actually think it is fun).
