From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kHznBjrZCWEGbAEAgWs5BA (envelope-from ) for ; Wed, 04 Aug 2021 02:03:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GIVvAjrZCWG3LwAAB5/wlQ (envelope-from ) for ; Wed, 04 Aug 2021 00:03:06 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (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 44F1B2A30 for ; Wed, 4 Aug 2021 02:03:05 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 793272C0B2; Tue, 3 Aug 2021 20:03:01 -0400 (EDT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by mail.notmuchmail.org (Postfix) with ESMTPS id F20142C0B1 for ; Tue, 3 Aug 2021 20:02:58 -0400 (EDT) Received: from fencepost.gnu.org ([2001:470:142:3::e]:41824) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mB4N6-0003j7-3c; Tue, 03 Aug 2021 20:02:56 -0400 Received: from [217.138.196.18] (port=4073 helo=osgiliath.local) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mB4N5-0005Iz-QO; Tue, 03 Aug 2021 20:02:56 -0400 From: jao To: notmuch@notmuchmail.org Subject: [PATCH] emacs: honour notmuch-show-text/html-blocked-images in w3m messages Date: Wed, 4 Aug 2021 01:02:41 +0100 Message-Id: <20210804000241.1053748-1-jao@gnu.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Message-ID-Hash: UCIKIA5GKX7LLKIHCP54V3UKIVNWE4ND X-Message-ID-Hash: UCIKIA5GKX7LLKIHCP54V3UKIVNWE4ND X-MailFrom: jao@gnu.org 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; suspicious-header CC: jao X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628035385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TdEbe/NWH4lAAfmBhhaeLjrYLcaES3ok2yquklgTzdU=; b=GepchkTDUacSEUqYE7GlmU35eBQDeTj7WfYHmTUlVkh6LvRM7sTSwy5q/mZLDin7gpM2ey qEol5hY9FtqQ1Z95D1s7xHZGfRz339e1T6x8quGkQFxIdQK082d8Qw3alvgNDFiwAWAT5R UoIGUxYDqA/ZDLrOmZ1qSMfOHnbCdpw0aEY5RDdFPVyp++MiFEun6OJ6Z3DK1dDhuGXcut iSOAs4IdmW70UUuEsRH+tWZ7elDvUfyiNEAVDNwBSiSoDS2Bzx8otxbEOjOmnpQyKkZMYA SEbPaPnA8lrZgyVS8OvkBrt+mp9nj1FmPzhQcdUNfxxWtWxv9DqJutWlKRj75A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628035385; a=rsa-sha256; cv=none; b=XEsiJC0uZXnMh7VB7FU5kTDikXroo+GI4SC6U55zRHpHoAhRfXhbSR5mAkvlSEhOtVO2U3 GC6vorMVzq3OQKnLzRYBcUN33NjxdKG1CAQFbM7aJ/aj7mrMtgk0EiS+NrHAcm8iKE1ZI8 BOgL52q0UgXquSC/llaN40/kaLDZhnQDB9OcFQobLuc20AOsUY1EfH1YyHrtNgz0Vy0M/X dcoR6SCntws6HSRwWg/k7dfjLs7fmf0m949hn18zrxlQt0nMS98uXvSz1B8dFYAQs+xYzP am2hWLg7b/Hg2i5ByYksDY8dRbFnfyXH9hOSoph24D9GQVuE2N3jQ/DBcyi4ug== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.87 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 44F1B2A30 X-Spam-Score: -0.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: BeLpPr7qXMcQ When mm-text-html-renderer is set to 'w3m, the variable playing the role of a regular expression for blocked images is w3m-ignored-image-url-regexp. We bind it when the renderer is not 'shr. --- emacs/notmuch-show.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 9a95eb34..0f96c4fe 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -59,6 +59,7 @@ (defvar shr-blocked-images) (defvar gnus-blocked-images) (defvar shr-content-function) +(defvar w3m-ignored-image-url-regexp) ;;; Options @@ -823,7 +824,8 @@ will return nil if the CID is unknown or cannot be retrieved." (let ((mm-inline-text-html-with-w3m-keymap nil) ;; FIXME: If we block an image, offer a button to load external ;; images. - (gnus-blocked-images notmuch-show-text/html-blocked-images)) + (gnus-blocked-images notmuch-show-text/html-blocked-images) + (w3m-ignored-image-url-regexp notmuch-show-text/html-blocked-images)) (notmuch-show-insert-part-*/* msg part content-type nth depth button)))) ;;; Functions used by notmuch-show--insert-part-text/html-shr -- 2.32.0