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#49999: 27.2; save-mark-and-excursion does not save mark-active Date: Fri, 13 Aug 2021 11:19:20 +0200 Message-ID: <875yw9aehz.fsf@a16n.net> References: <87bl64l2sm.fsf@a16n.net> <87r1f0rx5s.fsf@gnus.org> <87y298oufi.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="33215"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: 49999@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 13 11:20:12 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 1mETMJ-0008QI-Ku for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 11:20:11 +0200 Original-Received: from localhost ([::1]:35502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mETMH-0004Ll-W9 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 05:20:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mETMA-0004Kw-M9 for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 05:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mETMA-0007TW-GE for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 05:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mETMA-00051b-AD for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 05:20:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87bl64l2sm.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: Fri, 13 Aug 2021 09:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49999 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 49999-submit@debbugs.gnu.org id=B49999.162884637619268 (code B ref 49999); Fri, 13 Aug 2021 09:20:02 +0000 Original-Received: (at 49999) by debbugs.gnu.org; 13 Aug 2021 09:19:36 +0000 Original-Received: from localhost ([127.0.0.1]:40498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mETLg-00050c-IA for submit@debbugs.gnu.org; Fri, 13 Aug 2021 05:19:36 -0400 Original-Received: from server.a16n.net ([178.33.238.77]:42088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mETLb-00050H-J5 for 49999@debbugs.gnu.org; Fri, 13 Aug 2021 05:19:31 -0400 Original-Received: from ws.localdomain (lfbn-ren-1-1338-34.w86-229.abo.wanadoo.fr [86.229.185.34]) by server.a16n.net (Postfix) with ESMTPSA id D81C543E04CA; Fri, 13 Aug 2021 11:19:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=a16n.net; s=a16n; t=1628846360; bh=OQPas2Ael+b1Hu5/TdzakAVgYPDhj1OrJaYTXwQU/7Y=; h=From:To:Cc:Subject:References:Date; b=lKJaLLnn//vU/GxrsQjbdXgzF2+xE1xlwqgBC2DJBZDL12rUFFgSnHCDs+Pp1NOKI IxwEKB6WvUPbAhZBIkaNjc9ED/8FV1Ypoz1taGtJBzhUsxrNTk31if74PLkJM5K5gC jCOAiGE3tJRXAJWWl9NeBi30NF4+J0s5tQ3GPIVYqqozT6WuMCEmQSvMDlWFogTIql 9ffHRvY51fF1bn7FJ5grtKs7YGV2AxqQvv0Sxo8l0K/b9wZKeY+ynyZCkI57VnlCX7 A2Xf6ESGm3fuzaGY8OGz+D+XfoPcaxjyLF2KJwH7/u/u48IbTM+1iUMactg+qMFl0w gWvFF48zgTrVg== Original-Received: by ws.localdomain (Postfix, from userid 1000) id 3C6547406D1; Fri, 13 Aug 2021 11:19:20 +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:211722 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, Aug 11 2021, Lars Ingebrigtsen wrote: > So `save-mark-and-excursion' works exactly as it should. But if you > don't want transient-mark-mode to switch itself off, you have to say > something like: Thanks for your explanation. Please find attached a patch, that uses your solution. =2D-=20 Peter --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Minor-enhancements-for-image-dired.el.patch Content-Transfer-Encoding: quoted-printable From=208e0d6c4e787ecb56ef8eede83ea5c5d8ed0db5e1 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Peter=3D20M=3DC3=3DBCnster?=3D Date: Fri, 13 Aug 2021 11:13:43 +0200 Subject: [PATCH] Minor enhancements for image-dired.el * lisp/image-dired.el (image-dired-thumb-visible-marks): Add the group. (image-dired-thumb-update-marks): Keep the mark state when changing faces. =2D-- lisp/image-dired.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 76c7ae91f0..34bf1d02a9 100644 =2D-- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -465,6 +465,7 @@ This is where you see the cursor." If non-nil, apply the `image-dired-thumb-mark' face to marked images." :type 'boolean + :group 'image-dired :version "28.1") =20 (defface image-dired-thumb-mark @@ -2360,20 +2361,18 @@ non-nil." =20 (defun image-dired-thumb-update-marks () "Update the marks in the thumbnail buffer." =2D ;; TODO: only called by image-dired-mouse-toggle-mark but there are =2D ;; certainly other places, where it should be called too. (when image-dired-thumb-visible-marks (with-current-buffer image-dired-thumbnail-buffer =2D (save-excursion + (save-mark-and-excursion (goto-char (point-min)) (let ((inhibit-read-only t)) (while (not (eobp)) =2D (if (image-dired-thumb-file-marked-p) =2D (add-face-text-property =2D (point) (1+ (point)) =2D 'image-dired-thumb-mark) =2D (remove-text-properties (point) (1+ (point)) =2D '(face image-dired-thumb-mark))) + (with-silent-modifications + (if (image-dired-thumb-file-marked-p) + (add-face-text-property (point) (1+ (point)) + 'image-dired-thumb-mark) + (remove-text-properties (point) (1+ (point)) + '(face image-dired-thumb-mark)))) (forward-char))))))) =20 (defun image-dired-mouse-toggle-mark-1 () =2D-=20 2.26.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iGoEARECACoWIQS/5hHRBUjla4uZVXU6jitvQ7HLaAUCYRY5GAwccG1AYTE2bi5u ZXQACgkQOo4rb0Oxy2hO9QCfTKhiUibjYTzMUDNZhEEZ6+oPTAoAn14eVp/GCS99 XBQR7OcZBD6XchCU =NQt2 -----END PGP SIGNATURE----- --==-=-=--