From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content Date: Thu, 03 Aug 2023 14:38:14 +0300 Message-ID: <833510xsnt.fsf@gnu.org> References: <874jruy7xx.fsf@ledu-giraud.fr> <87wn4dra0h.fsf@ledu-giraud.fr> <87bklhtwhd.fsf@ledu-giraud.fr> <871qgumqh7.fsf@ledu-giraud.fr> <83ila5n8co.fsf@gnu.org> <87fs59qx54.fsf@ledu-giraud.fr> <83wmyll9s5.fsf@gnu.org> <87bkfxcaa2.fsf@ledu-giraud.fr> <83wmykjzji.fsf@gnu.org> <877cqkcrds.fsf@ledu-giraud.fr> <83bkfwjkh8.fsf@gnu.org> <871qgsc9fv.fsf@ledu-giraud.fr> <83y1izj2q6.fsf@gnu.org> <87leezhwq0.fsf@ledu-giraud.fr> <87edko9ixu.fsf@ledu-giraud.fr> <87h6piu1zj.fsf@ledu-giraud.fr> <83wmydzn4z.fsf@gnu.org> <87sf91jpe4.fsf@ledu-giraud.fr> <83a5v9z4ve.fsf@gnu.org> <87o7jojs98.fsf@ledu-giraud.fr> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15016"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 03 13:39:15 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qRWfi-0003iF-RA for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Aug 2023 13:39:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRWfY-0003sZ-Iu; Thu, 03 Aug 2023 07:39:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWfW-0003ry-Ha for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 07:39:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRWfW-0002mj-7O for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 07:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qRWfV-00020Q-Qy for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 07:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Aug 2023 11:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61394 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61394-submit@debbugs.gnu.org id=B61394.16910626947645 (code B ref 61394); Thu, 03 Aug 2023 11:39:01 +0000 Original-Received: (at 61394) by debbugs.gnu.org; 3 Aug 2023 11:38:14 +0000 Original-Received: from localhost ([127.0.0.1]:50984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWej-0001zE-L6 for submit@debbugs.gnu.org; Thu, 03 Aug 2023 07:38:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWeh-0001z1-LT for 61394@debbugs.gnu.org; Thu, 03 Aug 2023 07:38:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWeb-0002f6-Dx; Thu, 03 Aug 2023 07:38:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=fg5IMeMihjyAduYeFs44+VyJXR9iitBwpEHFP7jPtiE=; b=bkFQadxpbm8C C3srC5ZPLXj6h3+YhsVJo9HpyEqfSOZsOpn+4ifxjyAPPXZ3mJ1JTSReKUd04fE6FWU1YpDmFbX+f OQXR1yGnUzOYyeI7UVrGoiv6DgilhqDSiK5N69ruPn5G8mmI/f/9t7lBYG6z1JdpUG9uBpTpyp0/j HgxGnKR+vNpVV1frflS/vaKRT/UT0U0P496Kba3pCLgsJ4esMvOzk65dsX+HlI7kO4Zctmv1lJQ7y aHQtHtFkrKs2K5wYX4ZGEbBDJ9GI8r2AK9DnfDwyJi0xigz9FevHoEz0hiVhZmP3WnY84uR2dhliz o77G3Nc4ZGikY6cqDypbwA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWea-0004ab-SP; Thu, 03 Aug 2023 07:38:05 -0400 In-Reply-To: <87o7jojs98.fsf@ledu-giraud.fr> (message from Manuel Giraud on Thu, 03 Aug 2023 13:10:43 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266584 Archived-At: > From: Manuel Giraud > Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org > Date: Thu, 03 Aug 2023 13:10:43 +0200 > > Eli Zaretskii 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.