By default, dired only deletes empty directories. You know the drill. Put your point on the directory,
y (yes), “file-error Removing directory directory not empty,” (slam fist on table). Doh!
Fortunately, dired supports deleting directories recursively. Add this to your
(setq dired-recursive-deletes 'top)
dired-recursive-deletes variable decides whether recursive deletes are allowed. This particular setting will prompt with confirmation for each directory at the top level but delete all subdirectories without asking. Other possible values include:
nilmeans no recursive deletes. (default)
'topmeans ask for each directory at the top level but delete subdirectories without asking.
'alwaysmeans delete recursively without asking. Warning: The Surgeon General has determined that this may be hazardous to your health.
- Anything else means ask for each directory (including subdirectories).
C-h v dired-recursive-deletes for the full low-down.