]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid errors in 'image-dired-tag-thumbnail'
authorEli Zaretskii <eliz@gnu.org>
Wed, 8 May 2024 13:13:27 +0000 (16:13 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sun, 12 May 2024 15:47:39 +0000 (17:47 +0200)
* lisp/image/image-dired.el (image-dired-tag-thumbnail)
(image-dired-tag-thumbnail-remove): Move here from
image-dired-tags.el.  (Bug#70821)

(cherry picked from commit 3d65d4306b98efba59ffabe86d8c99e6f37cd8d2)

lisp/image/image-dired-tags.el
lisp/image/image-dired.el

index 2b5248cb14bfe7c6fe9d81e46ba5945f5b121c64..54595adc14730eb67bf679d53531659ba73660e4 100644 (file)
@@ -32,8 +32,6 @@
 
 (require 'image-dired-util)
 
-(declare-function image-dired--with-marked "image-dired")
-
 (defvar image-dired-dir)
 (defvar image-dired-thumbnail-storage)
 (defvar image-dired-tags-db-file)
@@ -156,18 +154,6 @@ With prefix ARG, tag the file at point."
         (cons x tag))
       files))))
 
-(defun image-dired-tag-thumbnail ()
-  "Tag current or marked thumbnails."
-  (interactive nil image-dired-thumbnail-mode)
-  (let ((tag (completing-read
-              "Tags to add (separate tags with a semicolon): "
-              image-dired-tag-history nil nil nil 'image-dired-tag-history)))
-    (image-dired--with-marked
-     (image-dired-write-tags
-      (list (cons (image-dired-original-file-name) tag)))
-     (image-dired-update-property
-      'tags (image-dired-list-tags (image-dired-original-file-name))))))
-
 ;;;###autoload
 (defun image-dired-delete-tag (arg)
   "Remove tag for selected file(s).
@@ -181,16 +167,6 @@ With prefix argument ARG, remove tag from file at point."
       (setq files (dired-get-marked-files)))
     (image-dired-remove-tag files tag)))
 
-(defun image-dired-tag-thumbnail-remove ()
-  "Remove tag from current or marked thumbnails."
-  (interactive nil image-dired-thumbnail-mode)
-  (let ((tag (completing-read "Tag to remove: " image-dired-tag-history
-                              nil nil nil 'image-dired-tag-history)))
-    (image-dired--with-marked
-     (image-dired-remove-tag (image-dired-original-file-name) tag)
-     (image-dired-update-property
-      'tags (image-dired-list-tags (image-dired-original-file-name))))))
-
 (defun image-dired-write-comments (file-comments)
   "Write file comments specified by FILE-COMMENTS comments to database.
 FILE-COMMENTS is an alist on the following form:
index 9eb68e240fef524dfcbe6701f3c1807ba97ec683..ca808bcb5ab8ec69e011225cbeb8e30c9c148752 100644 (file)
@@ -1757,6 +1757,28 @@ Dired."
                   (cons (list tag file) (cdr image-dired-tag-file-list))))
       (setq image-dired-tag-file-list (list (list tag file))))))
 
+(defun image-dired-tag-thumbnail-remove ()
+  "Remove tag from current or marked thumbnails."
+  (interactive nil image-dired-thumbnail-mode)
+  (let ((tag (completing-read "Tag to remove: " image-dired-tag-history
+                              nil nil nil 'image-dired-tag-history)))
+    (image-dired--with-marked
+     (image-dired-remove-tag (image-dired-original-file-name) tag)
+     (image-dired-update-property
+      'tags (image-dired-list-tags (image-dired-original-file-name))))))
+
+(defun image-dired-tag-thumbnail ()
+  "Tag current or marked thumbnails."
+  (interactive nil image-dired-thumbnail-mode)
+  (let ((tag (completing-read
+              "Tags to add (separate tags with a semicolon): "
+              image-dired-tag-history nil nil nil 'image-dired-tag-history)))
+    (image-dired--with-marked
+     (image-dired-write-tags
+      (list (cons (image-dired-original-file-name) tag)))
+     (image-dired-update-property
+      'tags (image-dired-list-tags (image-dired-original-file-name))))))
+
 (defvar image-dired-slideshow-count 0
   "Keeping track on number of images in slideshow.")
 (make-obsolete-variable 'image-dired-slideshow-count "no longer used." "29.1")