bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Manuel Giraud
Subject: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content
Date: Thu, 03 Aug 2023 18:51:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

[...]

>> +(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.)

I don't understand.  "Update the thumbnail at point." does not seem
sufficient because the fact that the original image might be modified is
the main point of this function.

>> +  (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.

What about:

"When 'image-dired-thumb-naming' is set to 'sha1-contents', 'thumb' and
'old-thumb' could be different file names.  Update the thumbnail then."
-- 
Manuel Giraud





reply via email to

[Prev in Thread] Current Thread [Next in Thread]