Juri Linkov writes: >> Also, attached is an updated version of the patch which reflects the >> fact that the "default" variable actually was unused before, only >> "defaults" was used. >> [...] >> - (default (and dired-one-file >> - (not dired-dwim-target) ; Bug#25609 > > Removing these lines breaks dired-tests added > in the same commit 841e3e377c97 for Bug#25609 above. Ah, sorry, I guess I forgot to run dired-tests. But this is great news, this means this code is covered by at least one test. The real issue in bug#25609 is that the minibuffer default didn't have the correct value when dired-dwim-target is non-nil. From my analysis of the code, the default should always be the same as the initial input in the minibuffer (TARGET-DIR), but that wasn't happening with non-nil dired-dwim-target. With my change, this is fixed easily enough by just making sure TARGET-DIR is the first element of the defaults list. This doesn't change observable behavior because read-file-name explicitly handles the case where the initial input matches the first default: ;; When the first default in `minibuffer-default' ;; duplicates initial input `insdef', ;; reset `minibuffer-default' to nil. (when (equal (or (car-safe insdef) insdef) (or (car-safe minibuffer-default) minibuffer-default)) (setq minibuffer-default (cdr-safe minibuffer-default))) This also fixes bug#25609, with even less code, and dired-tests and dired-aux-tests both once again all pass. This version of the patch also extends the change to dired-compare-directories, so it gets the abbreviate-file-name benefits too.