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#50000: 27.2; tagging marked thumbnails Date: Wed, 11 Aug 2021 16:31:03 +0200 Message-ID: <87r1f0gijc.fsf@a16n.net> References: <874kbwl2qc.fsf@a16n.net> <87lf58rx3g.fsf@gnus.org> 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="40897"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: 50000@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 11 16:32:13 2021 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 1mDpHA-000ARH-8S for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Aug 2021 16:32:12 +0200 Original-Received: from localhost ([::1]:51942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDpH8-0007nC-Qs for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Aug 2021 10:32:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDpH0-0007mu-6u for bug-gnu-emacs@gnu.org; Wed, 11 Aug 2021 10:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDpH0-0003eJ-0T for bug-gnu-emacs@gnu.org; Wed, 11 Aug 2021 10:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mDpGz-00071M-UK for bug-gnu-emacs@gnu.org; Wed, 11 Aug 2021 10:32:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <874kbwl2qc.fsf@a16n.net> Resent-From: Peter =?UTF-8?Q?M=C3=BCnster?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Aug 2021 14:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50000 X-GNU-PR-Package: emacs Original-Received: via spool by 50000-submit@debbugs.gnu.org id=B50000.162869227426920 (code B ref 50000); Wed, 11 Aug 2021 14:32:01 +0000 Original-Received: (at 50000) by debbugs.gnu.org; 11 Aug 2021 14:31:14 +0000 Original-Received: from localhost ([127.0.0.1]:36260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDpGD-000708-IX for submit@debbugs.gnu.org; Wed, 11 Aug 2021 10:31:13 -0400 Original-Received: from server.a16n.net ([178.33.238.77]:48810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDpGB-0006zq-0T for 50000@debbugs.gnu.org; Wed, 11 Aug 2021 10:31:11 -0400 Original-Received: from ws.localdomain (arennes-662-1-84-172.w2-14.abo.wanadoo.fr [2.14.50.172]) by server.a16n.net (Postfix) with ESMTPSA id 212E843E054E; Wed, 11 Aug 2021 16:31:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=a16n.net; s=a16n; t=1628692264; bh=P4T1xZhKjL5DBtgjBkWJRaeNCKc+ct2qgL0mLTd43+A=; h=From:To:Cc:Subject:References:Date; b=eVI2UzHz/Jz5auq5c2X4vHeNRiGH6HV54tEX/FdS+fyjmbwHYfKUxrupLyExATO+0 ZW2i2WxDRbW29N9M30E4+cR0CQn9MLgFozqZoq6Gf5aM1oIUK2ui/HVTDV6YaNdpeO N5YH29jTSCd5owBtHDKL0Bn51RlLLKqyv59T6dgrBpmoLXDuZVKxYz+WWvAG9J1fs6 6L3NxxVFvWMR31ImLME8O6goSrWd9BoJNRWterJkwGbzZPmepNvGRoW4VtkKKjIRhJ HEHM8BxOXRc9ZOxvOklgw5GGVo6RCsfthj4neh0/a/h1aBcy3NOq2BdzeBsP+yTgUX SXIIwPpC3p4IA== Original-Received: by ws.localdomain (Postfix, from userid 1000) id 3F64974235E; Wed, 11 Aug 2021 16:31:03 +0200 (CEST) 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:211605 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, Aug 11 2021, Lars Ingebrigtsen wrote: > Can you submit it as a patch? Yes, I attach it here. There are 2 more things: image-dired-delete-marked and a suggestion for another placement of the calls to image-dired-thumb-update-marks. =2D-- image-dired.el-orig 2021-08-11 16:09:03.312541533 +0200 +++ image-dired.el 2021-08-11 13:13:01.561075067 +0200 @@ -1005,6 +1003,19 @@ (set-window-configuration image-dired-saved-window-configuration) (message "No saved window configuration"))) =20 +(defun image-dired-line-up-with-method () + "Line up thumbnails according to `image-dired-line-up-method'." + (cond ((eq 'dynamic image-dired-line-up-method) + (image-dired-line-up-dynamic)) + ((eq 'fixed image-dired-line-up-method) + (image-dired-line-up)) + ((eq 'interactive image-dired-line-up-method) + (image-dired-line-up-interactive)) + ((eq 'none image-dired-line-up-method) + nil) + (t + (image-dired-line-up-dynamic)))) + ;;;###autoload (defun image-dired-display-thumbs (&optional arg append do-not-pop) "Display thumbnails of all marked files, in `image-dired-thumbnail-buffe= r'. @@ -1046,16 +1057,7 @@ (if do-not-pop (display-buffer buf) (pop-to-buffer buf)) =2D (cond ((eq 'dynamic image-dired-line-up-method) =2D (image-dired-line-up-dynamic)) =2D ((eq 'fixed image-dired-line-up-method) =2D (image-dired-line-up)) =2D ((eq 'interactive image-dired-line-up-method) =2D (image-dired-line-up-interactive)) =2D ((eq 'none image-dired-line-up-method) =2D nil) =2D (t =2D (image-dired-line-up-dynamic)))))) + (image-dired-line-up-with-method)))) =20 ;;;###autoload (defun image-dired-show-all-from-dir (dir) @@ -1186,6 +1188,14 @@ (cons x tag)) files)))) =20 +(defun image-dired-tag-marked-thumbnails () + "Tag marked thumbnails." + (interactive) + (let ((dired-buf (image-dired-associated-dired-buffer))) + (if dired-buf + (with-current-buffer dired-buf + (image-dired-tag-files nil))))) + (defun image-dired-tag-thumbnail () "Tag current thumbnail." (interactive) @@ -1417,27 +1427,26 @@ (message "No image, or image with correct properties, at point.") (with-current-buffer dired-buf (message "%s" file-name) =2D (if (dired-goto-file file-name) =2D (cond ((eq command 'mark) (dired-mark 1)) =2D ((eq command 'unmark) (dired-unmark 1)) =2D ((eq command 'toggle) =2D (if (image-dired-dired-file-marked-p) =2D (dired-unmark 1) =2D (dired-mark 1))) =2D ((eq command 'flag) (dired-flag-file-deletion 1)))))))) + (when (dired-goto-file file-name) + (cond ((eq command 'mark) (dired-mark 1)) + ((eq command 'unmark) (dired-unmark 1)) + ((eq command 'toggle) + (if (image-dired-dired-file-marked-p) + (dired-unmark 1) + (dired-mark 1))) + ((eq command 'flag) (dired-flag-file-deletion 1))) + (image-dired-thumb-update-marks)))))) =20 (defun image-dired-mark-thumb-original-file () "Mark original image file in associated dired buffer." (interactive) (image-dired-modify-mark-on-thumb-original-file 'mark) =2D (image-dired-thumb-update-marks) (image-dired-forward-image)) =20 (defun image-dired-unmark-thumb-original-file () "Unmark original image file in associated dired buffer." (interactive) (image-dired-modify-mark-on-thumb-original-file 'unmark) =2D (image-dired-thumb-update-marks) (image-dired-forward-image)) =20 (defun image-dired-flag-thumb-original-file () @@ -1449,8 +1458,7 @@ (defun image-dired-toggle-mark-thumb-original-file () "Toggle mark on original image file in associated dired buffer." (interactive) =2D (image-dired-modify-mark-on-thumb-original-file 'toggle) =2D (image-dired-thumb-update-marks)) + (image-dired-modify-mark-on-thumb-original-file 'toggle)) =20 (defun image-dired-jump-original-dired-buffer () "Jump to the dired buffer associated with the current image file. @@ -2331,19 +2339,32 @@ "Check if file is marked in associated dired buffer." (let ((file-name (image-dired-original-file-name)) (dired-buf (image-dired-associated-dired-buffer))) (when (and dired-buf file-name) (with-current-buffer dired-buf (when (dired-goto-file file-name) (image-dired-dired-file-marked-p)))))) + +(defun image-dired-delete-marked () + "Delete marked thumbnails and associated images." + (interactive) + (goto-char (point-min)) + (let ((dired-buf (image-dired-associated-dired-buffer))) + (while (not (eobp)) + (if (image-dired-thumb-file-marked-p) + (image-dired-delete-char) + (forward-char))) + (image-dired-line-up-with-method) + (with-current-buffer dired-buf + (dired-do-delete)))) =20 (defun image-dired-thumb-update-marks () "Update the marks in the thumbnail buffer." (when image-dired-thumb-visible-marks (with-current-buffer image-dired-thumbnail-buffer =2D (save-excursion + (save-mark-and-excursion ; todo: mark-active is not restored, bug #4= 9999 (goto-char (point-min)) (let ((inhibit-read-only t)) (while (not (eobp)) (if (image-dired-thumb-file-marked-p) (add-face-text-property (point) (1+ (point)) =2D-=20 Peter --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iGoEARECACoWIQS/5hHRBUjla4uZVXU6jitvQ7HLaAUCYRPfJwwccG1AYTE2bi5u ZXQACgkQOo4rb0Oxy2gGyACg3Qi0NaRqPzmA4kk5sjLnlKmR248AoNRuSZdu1Wbu qzJRxiwViw29btco =Mlrr -----END PGP SIGNATURE----- --=-=-=--