From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61394: 30.0.50; [PATCH] Image-dired thumb name based on content Date: Sat, 29 Jul 2023 11:51:19 +0200 Message-ID: <87leezhwq0.fsf@ledu-giraud.fr> References: <874jruy7xx.fsf@ledu-giraud.fr> <838rh4jlsq.fsf@gnu.org> <87bklzol8n.fsf@ledu-giraud.fr> <877cwmo8ij.fsf@ledu-giraud.fr> <87y1oz54bn.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> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8839"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: contovob@tcd.ie, stefankangas@gmail.com, 61394@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 29 12:11:32 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 1qPgv6-00028a-4i for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Jul 2023 12:11:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPgcG-0005gr-Cu; Sat, 29 Jul 2023 05:52: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 1qPgcE-0005fe-JH for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 05:52: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 1qPgcE-0002vM-B3 for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 05:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qPgcE-0004mY-7U for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 05:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jul 2023 09:52:02 +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.169062428518314 (code B ref 61394); Sat, 29 Jul 2023 09:52:02 +0000 Original-Received: (at 61394) by debbugs.gnu.org; 29 Jul 2023 09:51:25 +0000 Original-Received: from localhost ([127.0.0.1]:46448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPgbd-0004lJ-9y for submit@debbugs.gnu.org; Sat, 29 Jul 2023 05:51:25 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:42664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPgba-0004l6-Lu for 61394@debbugs.gnu.org; Sat, 29 Jul 2023 05:51:24 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=U1z/u6nJ UgLTm1ibTW8js9Enf/JFL5E0i8UQcmUa7Pw=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=//2RHLVgeZLMef1596zQY9VS8Byz57 X0YgFeD5WPGUgQYJV1pnNi+18tD2QWIgqYPcZrntuDB4POoxRJ2MuEDQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=U1z/u6nJUgLTm1ib TW8js9Enf/JFL5E0i8UQcmUa7Pw=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=sdS8bdZRuZRleNq8uaEExxMci/bi49eGvWwna8 pm7QyM6GPtM/B8Jy+SwUmVl6zAdSFZNHQNYW9SRiOpoYUeOKGaWlObrbd6uk2Ag4l/mpAJ n9HHpZk1eD6p21xE1TokiQn3sWhSu/V+s/RdNVqkgrJ+Dqn3aGKS5kBkermziMJ6uJMFsw 2AzrS+1sOz5PvX5sxDK58/7RCcMiqrK14elEf1a7dCt5CRKuROBLcDGxoEuG73fhEDaOQ1 vlISlEi2fcQIiw7u73t2XRQFU8i5O2LcErcm9kYF5yuL2F1P/JbdH1YKIbTN+PTCPJ8Jga 81FKGP0dAoGTuIL2K+xyrHFQ== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id e77a668a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 29 Jul 2023 11:51:20 +0200 (CEST) In-Reply-To: <83y1izj2q6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 28 Jul 2023 21:44:01 +0300") 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:266321 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: [...] >> If you talk about the behaviour change for the "per-directory" method, >> as I said, I can restore it back to what it was. > > Yes, I think we should do that, thanks. Hi Eli, So I think that this patch does that but then 5efc7b22cec should be reverted. I'm not so sure about the 'image-dired-thumb-name' docstring. BTW, I'm not running "make check" often but I have some failures here and there (2 in TRAMP, 2 in EPG...): is it expected? -- Manuel Giraud --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Revert-thumbnail-naming-for-per-directory-storage-me.patch >From f4c3260e982c0ff5f8afc0d80f634d5d3a3f991b Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 29 Jul 2023 10:59:32 +0200 Subject: [PATCH] Revert thumbnail naming for 'per-directory storage method * lisp/image/image-dired-util.el (image-dired-thumb-name): Revert to "filename.thumb.jpg" for 'per-directory storage. * lisp/image/image-dired.el (image-dired-thumbnail-storage): Fix documentation. --- lisp/image/image-dired-util.el | 12 ++++++------ lisp/image/image-dired.el | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/image/image-dired-util.el b/lisp/image/image-dired-util.el index 3f6880fc807..70911bce45a 100644 --- a/lisp/image/image-dired-util.el +++ b/lisp/image/image-dired-util.el @@ -77,8 +77,9 @@ image-dired-thumb-name added to the file name. - Otherwise `image-dired-thumbnail-storage' is used to set the - directory where to store the thumbnail. In this latter case - the name given to the thumbnail depends on the value of + directory where to store the thumbnail. In this latter case, + if `image-dired-thumbnail-storage' is set to `image-dired' the + file name given to the thumbnail depends on the value of `image-dired-thumb-naming'. See also `image-dired-thumbnail-storage' and @@ -99,15 +100,14 @@ image-dired-thumb-name (let ((name (if (eq 'sha1-contents image-dired-thumb-naming) (image-dired-contents-sha1 file) ;; Defaults to SHA-1 of file name - (if (eq 'per-directory image-dired-thumbnail-storage) - (sha1 (file-name-nondirectory file)) - (sha1 file))))) + (sha1 file)))) (cond ((or (eq 'image-dired image-dired-thumbnail-storage) ;; Maintained for backwards compatibility: (eq 'use-image-dired-dir image-dired-thumbnail-storage)) (expand-file-name (format "%s.jpg" name) (image-dired-dir))) ((eq 'per-directory image-dired-thumbnail-storage) - (expand-file-name (format "%s.jpg" name) + (expand-file-name (format "%s.thumb.jpg" + (file-name-nondirectory file)) (expand-file-name ".image-dired" (file-name-directory file))))))))) diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 96a0c2ef9bc..c5b317e6b2a 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -208,8 +208,8 @@ image-dired-thumbnail-storage Set this user option to `per-directory'. -To control the naming of thumbnails for alternatives (2) and (3) -above, customize the value of `image-dired-thumb-naming'. +To control the naming of thumbnails for alternative 2 above, +customize the value of `image-dired-thumb-naming'. To control the default size of thumbnails for alternatives (2) and (3) above, customize the value of `image-dired-thumb-size'. -- 2.40.0 --=-=-=--