GNU bug report logs - #61394
30.0.50; [PATCH] Image-dired thumb name based on content

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Thu, 9 Feb 2023 19:08:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #122 received at 61394 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: contovob <at> tcd.ie, stefankangas <at> gmail.com, 61394 <at> debbugs.gnu.org
Subject: Re: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on
 content
Date: Thu, 03 Aug 2023 14:38:14 +0300
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: stefankangas <at> gmail.com,  contovob <at> tcd.ie,  61394 <at> debbugs.gnu.org
> Date: Thu, 03 Aug 2023 13:10:43 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Yes.  First I had a test about the method around the call to
> >> 'image-dired-update-thumbnail-at-point' but then I realize that nothing
> >> will be done for others methods as I'm doing a test on the thumb name
> >> change:
> >>         ... (unless (string= thumb old-thumb) ...
> >
> > This at least warrants a comment, so that others won't have to be
> > bothered by the same questions.
> 
> What about this one?  I've also permuted some instructions to avoid a
> flicker when updating the thumbnail.

Thanks, a few minor comments below:

> +(defun image-dired-update-thumbnail-at-point ()
> +  "Update the thumbnail at point if the original image file has been
> +modified.  Take care of uncaching and removing the old thumbnail
> +file."

The first line of the doc string should be a single complete sentence.
(Just move the "modified" part to the first line, I think there's
enough space there.)

> +  (when (image-dired-image-at-point-p)
> +    (let* ((file (image-dired-original-file-name))
> +           (thumb (expand-file-name (image-dired-thumb-name file)))
> +           (image (get-text-property (point) 'display)))
> +      (when image
> +        (let ((old-thumb (plist-get (cdr image) :file)))
> +          ;; If 'thumb' and 'old-thumb' are the same file names, do
> +          ;; nothing.  This would be the case when
> +          ;; 'image-dired-thumb-naming' is set to 'sha1-filename'.

Isn't that true for _any_ method except the single one for which you
need this patch?  I thought only names based on SHA1 of the contents
are affected and need this additional renaming?  The comment seems to
say something else.




This bug report was last modified 1 year and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.