all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Christopher Howard <christopher@librehacker.com>
Cc: 70821@debbugs.gnu.org
Subject: bug#70821: 29.3; image-dired: tagging in thumbnail buffer
Date: Tue, 07 May 2024 21:29:31 +0300	[thread overview]
Message-ID: <86o79ha31w.fsf@gnu.org> (raw)
In-Reply-To: <87ikzpimqd.fsf@librehacker.com> (message from Christopher Howard on Tue, 07 May 2024 08:57:14 -0800)

> From: Christopher Howard <christopher@librehacker.com>
> Date: Tue, 07 May 2024 08:57:14 -0800
> 
> 
> I'm trying to follow instructions in the Emacs reference manual for tagging image thumbnails, but am getting errors. Here is an error I get if I try to tag them from within the thumbnail buffer.
> 
> emacs -Q
> M-! (setq debug-on-error t)
> M-x image-dired ~/Pictures/tanana_20230713
> t t myphoto
> 
> ```
> Debugger entered--Lisp error: (invalid-function image-dired--with-marked)
>   image-dired--with-marked(nil nil)
>   image-dired-tag-thumbnail()
>   funcall-interactively(image-dired-tag-thumbnail)
>   command-execute(image-dired-tag-thumbnail)
> ```

Thanks.  Does the patch below help to resolve the issue?

diff --git a/lisp/image/image-dired-tags.el b/lisp/image/image-dired-tags.el
index 2b5248c..54595ad 100644
--- a/lisp/image/image-dired-tags.el
+++ b/lisp/image/image-dired-tags.el
@@ -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 @@ image-dired-tag-files
         (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 @@ image-dired-delete-tag
       (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:
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index 26d5811..00dc8e3 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -1714,6 +1714,28 @@ image-dired-add-to-tag-file-list
                   (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")





  reply	other threads:[~2024-05-07 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 16:57 bug#70821: 29.3; image-dired: tagging in thumbnail buffer Christopher Howard
2024-05-07 18:29 ` Eli Zaretskii [this message]
2024-05-07 19:58   ` Christopher Howard
2024-05-08 13:15     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86o79ha31w.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70821@debbugs.gnu.org \
    --cc=christopher@librehacker.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.