2017-08-04 15:44 GMT+02:00 Tino Calancha : > > > On Fri, 4 Aug 2017, Fabrice Popineau wrote: > > (with-temp-file (expand-file-name "b.txt" dir2)) >> - (setq buf (dired (expand-file-name "dir*/*.txt" dir))) >> + (setq buf (dired (cons dir (file-expand-wildcards >> "dir*/*.txt")))) >> (dired-toggle-marks) >> (should (cdr (dired-get-marked-files)))) >> (delete-directory dir 'recursive) >> >> Am I wrong thinking that `expand-file-name' is not supposed to expand >> "dir*/*.txt"? >> > Well we are using expand for 2 different things. > > 2) Expand shell wildcards. > (dired (expand-file-name "lis*/*file" source-directory)) > > This doesn't work here. I have : c:/tmp/dir1/foo.txt c:/tmp/dir2/bar.txt and: (expand-file-name "dir*/*.txt" "c:/tmp/") "c:/tmp/dir*/*.txt" Moreover, as far as I can read it, `expand-file-name' documentation says nothing about expanding wildcards. And last, `dired' maybe fed with a list, but the first argument needs to be the directory and the next ones, the files you want in the dired buffer, so I doubt that `dired' will accomodate the return value(s?) of `expand-file-name'? -> In other words: I don't understand how this should work :-) Fabrice Shows a dired buffer with 3 files: > lispref/Makefile > lispintro/Makefile > lisp/Makefile >