Eli Zaretskii writes: > > The code wants to do this in `dired-rename-subdir-1': > > > > (if (equal dir default-directory) > > ;; if top level directory was renamed, lots of things have to be > > ;; updated: > > > > DIR is the old directory name. But the `equality' test fails simply > > because default-directory is "~/test/" but DIR has the tilde expanded. > > So all we need to do is call expand-file-name on both of them? Or do > we need also to call file-truename? A sign of life with intermediate results: Turns out this is a difficult and not even the only question (see below). It looks to me like this branch of the code (after the always failing test) was never in use, or only a very long time ago. Because that unreachable branch is broken in several ways. I needed to add a `file-name-as-directory' wrapper, else dired wouldn't recognize the new directory as a directory and treats the file name as a wildcard instead. I would also add `abbreviate-file-name' calls so that the format of the file names is like before (abbreviated). Finally I don't understand why the existing code computes `default-directory' and `dired-directory' differently, so I reduced that to one computation for now, but also see below for more. This took me to this first actually working version for the simplest case: