From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qAywJ9IGEGVuYwEA9RJhRA:P1 (envelope-from ) for ; Sun, 24 Sep 2023 11:52:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qAywJ9IGEGVuYwEA9RJhRA (envelope-from ) for ; Sun, 24 Sep 2023 11:52:18 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 910373D608 for ; Sun, 24 Sep 2023 11:52:18 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695549138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=/ZCwB7qvMLhvI+keyaeGIQsoE2zlUvAxl/wse+aGOgU=; b=n05rlkQM6qh1SO26YiHURT5KVDvn4hzxjMuE2QLtuNfDVaB+nAbQn7cKLfZAv8bjQa32Q+ I09jCbcpsW2GiUvI5zBkHkVsc2KTVHri+QFkeht/sjfYOYqNqbsJgds0cPcA6PH726zc8V qQzfoj+xh011BH1DOmxOMLb4oDB0BwDBQ1duMr3oPrUry4yZjAq4jJ701qLt2Y/gix+pMy zA/6PL+urxATe8+x0QE8Z8MG+ZwjsnSz+/13Pl4KXxMbWuh9gt2DPO9/Fp+mxZoOakkzrZ i50Pm/A65Pl3bolQauYsM9RWXyn73j0+6JqeGq3MUTDlCrBDXoRnMT5FHWSgUw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695549138; a=rsa-sha256; cv=none; b=oRvRAjFpKQ+Q0mfjCaJspaASdRtNH9ElbxWUV6vaqGBXRbrWJtw6HQtr6FK62vYcP+trPr /oNeCDrV/qUE56WM+bFV/qjEnUSn6DAgH6o4osUFhL5WFTRNkdbTX0+XhjSRH/Qdjdgxh/ tl3X3B662Zj3k2Sdb7xp4b1o9kEfNtR3aLtarZFtutkZ2SkdOvJGZcC7k7E4lckwV58U15 cNCef7IObvkykRsrJW5KfPL1UKIerew+1qkVHEGo0cfJbyMMSnMFUmQ1iEfd7TlvKnfdtI EpaQtE+7rSibL2J3TbSo1cKE3qYyfKXBV1C2KcMNX7hInqdTUdDUdq6x4T+1WQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 330D55F428; Sun, 24 Sep 2023 09:52:12 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [IPv6:2607:5300:60:3a9d::1]) by mail.notmuchmail.org (Postfix) with ESMTPS id 89E235F376 for ; Sun, 24 Sep 2023 09:52:08 +0000 (UTC) Received: from tethera.net (fctnnbsc51w-159-2-210-253.dhcp-dynamic.fibreop.nb.bellaliant.net [159.2.210.253]) by phubs.tethera.net (Postfix) with ESMTPS id C63BC180068; Sun, 24 Sep 2023 06:52:06 -0300 (ADT) Received: (nullmailer pid 1394250 invoked by uid 1000); Sun, 24 Sep 2023 09:52:05 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH v2 2/4] emacs/show: save redisplay redisplay data when showing lazy part. Date: Sun, 24 Sep 2023 06:51:50 -0300 Message-Id: <20230924095152.1394168-3-david@tethera.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230924095152.1394168-1-david@tethera.net> References: <20230924095152.1394168-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: GPP7LZJNFYXPIVV4WUMWO6OA27LPOQ55 X-Message-ID-Hash: GPP7LZJNFYXPIVV4WUMWO6OA27LPOQ55 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN X-Spam-Score: -2.81 X-Migadu-Spam-Score: -2.81 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 910373D608 X-TUID: oSyah6tzPE4P This data will be used to redisplay an image that is hidden by deleting it from the buffer. We cannot easily delay until the image is hidden, as we won't have the original data at that point. --- emacs/notmuch-show.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 36cce619..107ce1b8 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1019,10 +1019,13 @@ will return nil if the CID is unknown or cannot be retrieved." (part-end (copy-marker (point) t)) ;; We have to save the depth as we can't find the depth ;; when narrowed. - (depth (notmuch-show-get-depth))) + (depth (notmuch-show-get-depth)) + (mime-type (plist-get (cadr part-args) :computed-type))) (save-restriction (narrow-to-region part-beg part-end) (delete-region part-beg part-end) + (when (and mime-type (string-match "^image/" mime-type)) + (button-put button :notmuch-redisplay-data part-args)) (apply #'notmuch-show-insert-bodypart-internal part-args) (indent-rigidly part-beg part-end -- 2.40.1