I open a buffer in emacs dired and select some files. How would I go about selecting files with the same name in another buffer? Ex: I select files a.txt, k.txt and z.txt in folder A. I then open a folder B in dired...how could I mark the files with the same names in folder B?
The following elisp code worked for me with buffers dired1
and dired2
.
(progn
(switch-to-buffer "dired1")
(dlet ((files (mapcar (lambda (path) (car (last (split-string path "/"))))
(dired-get-marked-files))))
(switch-to-buffer "dired2")
(dired-mark-sexp '(member name files))))