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 18:50:27 +0200 Message-ID: <87cz0airvw.fsf@ledu-giraud.fr> References: <874jruy7xx.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> <87leezhwq0.fsf@ledu-giraud.fr> <83bkfvm2ew.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="1868"; 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 19:03:07 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 1qPnLP-0000IP-9G for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 Jul 2023 19:03:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPn9k-0000u4-N2; Sat, 29 Jul 2023 12:51: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 1qPn9j-0000tw-IY for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 12:51:03 -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 1qPn9j-0000hh-An for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 12:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qPn9i-0005BS-Sr for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2023 12:51: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 16:51: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.169064943519592 (code B ref 61394); Sat, 29 Jul 2023 16:51:02 +0000 Original-Received: (at 61394) by debbugs.gnu.org; 29 Jul 2023 16:50:35 +0000 Original-Received: from localhost ([127.0.0.1]:48705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPn9G-00055w-Kl for submit@debbugs.gnu.org; Sat, 29 Jul 2023 12:50:35 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:45537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPn9C-00055m-QQ for 61394@debbugs.gnu.org; Sat, 29 Jul 2023 12:50:32 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=cfHiBnq+ 7/j+fnSbZnUK2fiY2XuoWySCw5MPOXVgpAA=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=VqUuJc2X3cndSkffM2qYj9HkingEfL 2gXotrkhdjdOyKP0valzaA6aVv2cgz1qWhQmdvUWczdB/fSUSci9NMBw== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=cfHiBnq+7/j+fnSb ZnUK2fiY2XuoWySCw5MPOXVgpAA=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=a492jFZnuPNMzifcm4Nrruht/bYMaxx2pAbpfh 8bjknbyD+PBYXtx5WleMsNaE4tGPs4g0OnKdFv85dGGJJXFMfA5iaN/qUWnkpRLWBFsdMK oz9DO/KWLHaPkkKc+NapeNf0Yfgxqj8BWh0wL5B0VLaYOp6SqP0JeiiKSJu0z3cJzTRZHP +9strJhwr7+jFPyj2VpRYBFjgF2ZPV7Haebl+Lnfd/beasRQPvGKnGT2xK9ArHa69eabbd r2MQL4Tx0HPGRqWeuISlrym1ijZOjIv7BGAt1F2L96Kn69KCxMheaHnB13G79rpLrG0UWr dfHVF9FpSZv4a/qzhaBxTaCg== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 4a54f5c5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 29 Jul 2023 18:50:29 +0200 (CEST) In-Reply-To: <83bkfvm2ew.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 29 Jul 2023 13:34:47 +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:266337 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: stefankangas@gmail.com, contovob@tcd.ie, 61394@debbugs.gnu.org >> Date: Sat, 29 Jul 2023 11:51:19 +0200 >> >> 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. > > Thanks, will look into that soon. Here is a new version of this patch. I missed some precision in a docstring in the previous one (sorry). --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Revert-thumbnail-naming-for-per-directory-storage-me.patch >From 9db8988412a8d2463d3d44ff23b80e545e9e5b19 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 | 8 ++++---- 2 files changed, 10 insertions(+), 10 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..98596510ec1 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -174,8 +174,8 @@ image-dired-thumb-naming In both case, a \"jpg\" extension is appended to save as JPEG. The value of this option is ignored if Image-Dired is customized -to use the Thumbnail Managing Standard. See -`image-dired-thumbnail-storage'." +to use the Thumbnail Managing Standard or the per-directory +thumbnails setting. See `image-dired-thumbnail-storage'." :type '(choice :tag "How to name thumbnail files" (const :tag "SHA-1 of the image file name" sha1-filename) (const :tag "SHA-1 of the image contents" sha1-contents)) @@ -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 --=-=-= Content-Type: text/plain >> 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? > > Please report them as separate bugs. Ok, I've created one for Tramp for the moment. -- Manuel Giraud --=-=-=--