That's not how
dired-diff works - it does not operate on the marked files. Same thing for
These commands operate on the current-line's file and another file whose name you enter.
C-h f diredp-ediff tells you, about the file name you enter:
Try to guess a useful default value for
FILE2, as follows:
If the mark is active, use the file at mark.
Else if the file at cursor is a autosave file or a backup file, use
the corresponding base file.
Else if there is any backup file for the file at point, use the
newest backup file for it.
Else use the file at point.
This will do more or less what you want:
(defun diredp-ediff-marked-files ()
(let ((files (dired-get-marked-files)))
(unless (and (listp files) (= 2 (length files)))
(error "There are not (only) 2 marked files"))
(ediff-files (car files) (cadr files))))