]> git.eshelyaron.com Git - emacs.git/commitdiff
Add new command image-dired-copy-filename-as-kill
authorStefan Kangas <stefankangas@gmail.com>
Sat, 24 Sep 2022 22:37:40 +0000 (00:37 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Sun, 25 Sep 2022 10:50:12 +0000 (12:50 +0200)
* 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
lisp/image/image-dired.el

index 3d1af8bd6fe7241765447828c66516e5b8fca9bb..835fcf8bcaf6e5c64b4996fce7ee81a09d07807b 100644 (file)
--- 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
index b8b16343c12792216499a90f66944ea59bb2d0a9..d933ccf79c399c379f2c82135b7bf673a918e814 100644 (file)
@@ -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)))
+
 \f
 ;;; Mouse support