[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 97d7f8c737 1/2: Add new command image-dired-copy-filename-as-kill
From: |
Stefan Kangas |
Subject: |
master 97d7f8c737 1/2: Add new command image-dired-copy-filename-as-kill |
Date: |
Sun, 25 Sep 2022 06:50:42 -0400 (EDT) |
branch: master
commit 97d7f8c73720d24dd154d2de2b4a0d13bc9d4e6a
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
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 3d1af8bd6f..835fcf8bca 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 b8b16343c1..d933ccf79c 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