From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Peter =?UTF-8?Q?M=C3=BCnster?= Newsgroups: gmane.emacs.bugs Subject: bug#58255: 29.0.50; don't remove thumbnails in image-dired-do-flagged-delete until confirmation Date: Sun, 02 Oct 2022 19:22:47 +0200 Message-ID: <87tu4mxhqw.fsf@a16n.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30585"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: 58255@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 02 19:23:12 2022 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 1of2gK-0007l0-1Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Oct 2022 19:23:12 +0200 Original-Received: from localhost ([::1]:33712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1of2gJ-0004X8-4h for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Oct 2022 13:23:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of2gB-0004S2-2K for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 13:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1of2gA-0004r7-Qt for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 13:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1of2gA-0002LY-K5 for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 13:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Peter =?UTF-8?Q?M=C3=BCnster?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Oct 2022 17:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58255 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Emacs Bugs Original-Received: via spool by submit@debbugs.gnu.org id=B.16647313788993 (code B ref -1); Sun, 02 Oct 2022 17:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Oct 2022 17:22:58 +0000 Original-Received: from localhost ([127.0.0.1]:47952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of2g5-0002Ky-SV for submit@debbugs.gnu.org; Sun, 02 Oct 2022 13:22:58 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of2g4-0002Kr-Os for submit@debbugs.gnu.org; Sun, 02 Oct 2022 13:22:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of2g4-0004I5-Jj for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 13:22:56 -0400 Original-Received: from smtp2-g21.free.fr ([212.27.42.2]:50284) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of2g2-0004qb-4u for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2022 13:22:55 -0400 Original-Received: from server.a16n.net (unknown [82.65.98.121]) by smtp2-g21.free.fr (Postfix) with ESMTPS id 512B12003DE for ; Sun, 2 Oct 2022 19:22:49 +0200 (CEST) Original-Received: from ws.localdomain (lfbn-ren-1-357-130.w2-10.abo.wanadoo.fr [2.10.189.130]) by server.a16n.net (Postfix) with ESMTPSA id B068A800491 for ; Sun, 2 Oct 2022 19:22:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=a16n.net; s=a16n; t=1664731368; bh=lfCU1GMYedvKCnzpw4ybnVl8Gy84cAWdMJiqcwN58e8=; h=From:To:Subject:Date; b=pVCyPy5p2QvyGECY3guAwqpjM8UhqXTIuH31qS00rVEk4hAy37gs7/qOCW7XCgzgx B391iCmnR1TU9e72vuaUsngVIn/jhxxnGE3HbP9iIuLs4a7pSwfXa3qZpMgcHL1NpB y+jRYjQ8zHw+D6sAHFBBvPfbvzBZnLEcb+vmfPx/GtayKCXIV5Ok22RP3IVuTjUmyk XGbpj6+nMn2+zI7JKwXYdkBcRwxXEU7thGQHVuKwgJMTB0NUTigMWNgPZb9uP/CfaF YU84DngZvx5yqNSBS8S/vdmWZ3CoaKli31vJ/y+2jiKhEt4byNbgDLOHENcacmEK1Y Ur8dYafFqACZA== Original-Received: by ws.localdomain (Postfix, from userid 1000) id F202D205FB; Sun, 2 Oct 2022 19:22:47 +0200 (CEST) Received-SPF: pass client-ip=212.27.42.2; envelope-from=pm@a16n.net; helo=smtp2-g21.free.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:244248 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, As suggested by Stefan Kangas, please find here attached a patch, that changes image-dired-do-flagged-delete, so that thumbnails are removed only, when images are actually deleted in the dired buffer. Kind regards, =2D-=20 Peter --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=my-patch.diff Content-Transfer-Encoding: quoted-printable commit 5d117180ae038fde0732a96451bb588433a3ad38 Author: Peter M=C3=BCnster Date: Sun Oct 2 19:17:51 2022 +0200 Don't remove thumbnails in image-dired-do-flagged-delete until confirma= tion =20=20=20=20 * lisp/image/image-dired.el (image-dired-do-flagged-delete): Delete thumbnails only when original images disappear. diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 8fb89d4502..33f7149dec 100644 =2D-- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -1347,17 +1347,21 @@ image-dired-do-flagged-delete (interactive nil image-dired-thumbnail-mode) (unless (derived-mode-p 'image-dired-thumbnail-mode) (user-error "Not in `image-dired-thumbnail-mode'")) =2D (let ((inhibit-read-only t)) =2D (goto-char (point-min)) =2D (while (not (eobp)) =2D (if (image-dired-thumb-file-flagged-p) =2D (progn =2D (delete-char 1) =2D (forward-char)) =2D (forward-char 2)))) =2D (image-dired--line-up-with-method) =2D (image-dired--on-file-in-dired-buffer =2D (dired-do-flagged-delete))) + (image-dired--with-dired-buffer + (dired-do-flagged-delete)) + (let ((deletions)) + (save-excursion + (let ((inhibit-read-only t)) + (goto-char (point-min)) + (while (not (eobp)) + (let ((file-name (image-dired-original-file-name))) + (if (image-dired--with-dired-buffer (dired-goto-file file-name= )) + (forward-char 2) + (delete-char 1) + (forward-char) + (setq deletions t)))))) + (if deletions + (image-dired--line-up-with-method)))) =20 (defun image-dired--thumb-update-mark-at-point () (with-silent-modifications --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iGoEARECACoWIQS/5hHRBUjla4uZVXU6jitvQ7HLaAUCYznI5wwccG1AYTE2bi5u ZXQACgkQOo4rb0Oxy2g6TQCgmPN7Sd7X0lnnyunfRcVvXttcIVsAoNd0W7JJdCMx GJeiHZw4uzFknB11 =J9B9 -----END PGP SIGNATURE----- --==-=-=--