From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id sMZMGeEGEGUQUAEA9RJhRA:P1 (envelope-from ) for ; Sun, 24 Sep 2023 11:52:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sMZMGeEGEGUQUAEA9RJhRA (envelope-from ) for ; Sun, 24 Sep 2023 11:52:33 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 558175F55C for ; Sun, 24 Sep 2023 11:52:33 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 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=1695549153; 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=sDnNBD0gQ2lsQsedK9LUNkNXoIVsgtKgZbdwMz8ZsqU=; b=n3i4VwkBM3lNKj9bVdZFZXtB+BZoL4jU2pH7Y8GeACq7dP26mNvkRjXTUkT4V16S7galq5 wq7kys7g1gD+47+q77VvhqovwAUJxkez1g4mg+dLkAxU9nkCDszbuu+FGyoXY0fW9F0caR CsbYF2eczg07Udz/n+kZZlZEqraU7ojnidGEhjDhH+xTMcbJJy5PB9557lWAF1I6+fggZ9 cWRnSioZP8cSQPjwNXiBHAaP+6mM6kRjEGwXG4/D43UAVsi23U4+iCVBGAlz539WdSWbGl WbcFp7VgDKDfMdGHNlajwjPGW8G+hCnhtJ/Kin+/p3Xe0g5bStjtbsFnpr+qQA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695549153; a=rsa-sha256; cv=none; b=aDxMtcZw1xFSFMTMjR+auzc8OhoSchGJP8Z5Vc19q5hyQMBt4tjmB/ugsI0Wk1hxNAUVoQ Jdf9fBcgvNSf0OqBiae9PezjjDVqnS5mZG46vcDr0Zr+Pq7w7Gwqw9A5EBaLiP9ZifKWXw xb/By3tP5t9CG39LMfgAvuYbDUpfaYTPwR2oXELJ6xAAWeNj4vYEnIsZ4p1IpXkZmTAVIO tVLAdpaX7ceHAKZWkZ1fDP6BLH2rlw5ERd9mz7zyM2wGqqliwzIg2AE1X/yW3NplsITCUK sKLFIHrtvqf/hg47hfnClP5Nk77HSmeuECTK4umepxGl9BCsT+ncGDTkJSiKKg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 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 E666760955; Sun, 24 Sep 2023 09:52:13 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [IPv6:2607:5300:60:3a9d::1]) by mail.notmuchmail.org (Postfix) with ESMTPS id 704145F3E5 for ; Sun, 24 Sep 2023 09:52:10 +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 436D9180066; Sun, 24 Sep 2023 06:52:08 -0300 (ADT) Received: (nullmailer pid 1394253 invoked by uid 1000); Sun, 24 Sep 2023 09:52:05 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH v2 3/4] emacs: save image redisplay data during non-lazy display Date: Sun, 24 Sep 2023 06:51:51 -0300 Message-Id: <20230924095152.1394168-4-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: YRG4DFZB2EIFOWNZ4XL2DCBHPOKFI26Y X-Message-ID-Hash: YRG4DFZB2EIFOWNZ4XL2DCBHPOKFI26Y 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-Flow: FLOW_IN X-Migadu-Country: DE X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -2.93 X-Spam-Score: -2.93 X-Migadu-Queue-Id: 558175F55C X-TUID: UwG9Zp0YbM6Z This data will eventually be used to redisplay hidden images. A certain amount of refactoring is done here to avoid code duplication. --- emacs/notmuch-show.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 107ce1b8..54cf00c6 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1109,14 +1109,18 @@ is t, hide the part initially and show the button." (and deep button) (and high button) (and long button)))) - (content-beg (point))) + (content-beg (point)) + (part-data (list msg part mime-type nth depth button))) ;; Store the computed mime-type for later use (e.g. by attachment handlers). (plist-put part :computed-type mime-type) - (if show-part - (notmuch-show-insert-bodypart-internal msg part mime-type nth depth button) + (cond + (show-part + (apply #'notmuch-show-insert-bodypart-internal part-data) + (when (and button (string-match "^image/" mime-type)) + (button-put button :notmuch-redisplay-data part-data))) + (t (when button - (button-put button :notmuch-lazy-part - (list msg part mime-type nth depth button)))) + (button-put button :notmuch-lazy-part part-data)))) ;; Some of the body part handlers leave point somewhere up in the ;; part, so we make sure that we're down at the end. (goto-char (point-max)) -- 2.40.1