From 97d7f8c73720d24dd154d2de2b4a0d13bc9d4e6a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 25 Sep 2022 00:37:40 +0200 Subject: [PATCH] Add new command image-dired-copy-filename-as-kill * lisp/image/image-dired.el (image-dired-copy-filename-as-kill): New command. (image-dired-thumbnail-mode-map): Bind above new command to "w". --- etc/NEWS | 5 +++++ lisp/image/image-dired.el | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 3d1af8bd6fe..835fcf8bcaf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2098,6 +2098,11 @@ It removes all marks from all files in the thumbnail and the associated Dired buffer, and is bound to 'U' in the thumbnail and display buffer. +--- +*** New command 'image-dired-copy-filename-as-kill'. +It copies the name of the marked or current image to the kill ring, +and is bound to "w" in the thumbnail buffer. + --- *** New command 'image-dired-wallpaper-set'. This command sets the desktop background to the image at point in the diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index b8b16343c12..d933ccf79c3 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -924,6 +924,7 @@ You probably want to use this together with "SPC" #'image-dired-display-next-thumbnail-original "DEL" #'image-dired-display-previous-thumbnail-original "c" #'image-dired-comment-thumbnail + "w" #'image-dired-copy-filename-as-kill "W" #'image-dired-wallpaper-set ;; Mouse @@ -1278,6 +1279,13 @@ overwritten. This confirmation can be turned off using (image-dired-update-property 'comment comment)) (image-dired--update-header-line)) +(defun image-dired-copy-filename-as-kill (&optional arg) + "Copy names of marked (or next ARG) files into the kill ring. +This works as `dired-copy-filename-as-kill' (which see)." + (interactive "P" image-dired-thumbnail-mode) + (image-dired--with-dired-buffer + (dired-copy-filename-as-kill arg))) + ;;; Mouse support -- 2.39.2