VL
Size: a a a
VL
VL
PG
(defun my-dired-copy-filename-as-kill (&optional arg)
"ARG."
(interactive "P")
(let ((string
(or (dired-get-subdir)
(mapconcat #'shell-quote-argument
(cond ((null arg)
(dired-get-marked-files 'no-dir))
((zerop (prefix-numeric-value arg))
(dired-get-marked-files))
((consp arg)
(dired-get-marked-files t))
(t
(dired-get-marked-files 'no-dir (prefix-numeric-value arg))))
" "))))
(unless (string= string "")
(if (eq last-command 'kill-region)
(kill-append string nil)
(kill-new string))
(message "%s" string))))
VL
PG
PG
DL
VL
PG
VL
" "
DL
DL
VL
DL
DL
(dired-get-marked-files)
?DL
VL
VL
VL