From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YCQ8Ot6IBGGrFQEAgWs5BA (envelope-from ) for ; Sat, 31 Jul 2021 01:18:54 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6CTvNd6IBGFzRwAA1q6Kng (envelope-from ) for ; Fri, 30 Jul 2021 23:18:54 +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 A4EB41C07E for ; Sat, 31 Jul 2021 01:18:54 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0F14D29234; Fri, 30 Jul 2021 19:18:51 -0400 (EDT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by mail.notmuchmail.org (Postfix) with ESMTPS id E0D2929208 for ; Fri, 30 Jul 2021 19:18:48 -0400 (EDT) Received: from fencepost.gnu.org ([2001:470:142:3::e]:33136) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9bmC-0007VH-CP for notmuch@notmuchmail.org; Fri, 30 Jul 2021 19:18:48 -0400 Received: from cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net ([92.233.85.247]:46242 helo=osgiliath.local) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9bmC-0003jR-7M for notmuch@notmuchmail.org; Fri, 30 Jul 2021 19:18:48 -0400 Received: by osgiliath.local (Postfix, from userid 1000) id BAD2F40413; Sat, 31 Jul 2021 00:18:45 +0100 (BST) From: Jose Antonio Ortega Ruiz To: notmuch@notmuchmail.org Subject: emacs: honoring notmuch-show-insert-part-text/html for 'w3m renderer X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: Date: Sat, 31 Jul 2021 00:18:45 +0100 Message-ID: <87k0l7jsq2.fsf@gnus.jao.io> MIME-Version: 1.0 Message-ID-Hash: LAMLYTEVFQ7SM3AZJLFCUBA73BKDY7HP X-Message-ID-Hash: LAMLYTEVFQ7SM3AZJLFCUBA73BKDY7HP 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 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=1627687134; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QMUBkHEH8L5MKjqG+IxeYt4Ng/QTRkNLlCOk7yQGYDg=; b=kGAol1TDpUfpqVqpQjzAkZl8HgRHE4uzd+7VSsxph9qPbz+0U/RcH8L99yvpWvh1ZlO8CD u6ZgG5fV5LHsT981FcFbX9cxZWe/l5fl0Ivfsd64xEwZ4eCZ83LVlGepF/qc8b1kkkVxg/ P6jhNsBaEtc6C+bsUlFqzkZnQkBKmquWd6ROTxHCaFomJ4AvN84TF1q7oMmWXalm+f5hTk W/U2hhM4A93NDNhrUpjfYrnz22PLYW4SdXrhAByGtM/T0lVLp+isFcaDTmvGjQU77EKKVh 5dbtrThiH9IH2+mt+sukNJWb4jtyL/OHc3CF68akOpijsUWLkBK0MYbxoUwfag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627687134; a=rsa-sha256; cv=none; b=kuFQgjkUECXkC808SDVd5rv+cqECk8Yl1E6j0NIyGLWzs+JgEohwdBE6dL2q4gaZ9EQwQC Qh8V2Ezwvu/HVvRBBsMNLVE4AuNjwgAXMANP7Tv4fT6P1a07ZIAlogiRE618Issq1zUzOB /DQde1HIRyuaqORl1d5XQqw/0rllU5XfXsH009aOsACtTq5EsCa0oLSpfx1nmI625j8WFq e5dFBGK1ike77VHn8B03nvewZksSJzgJjbSS0nSZCVRLwymQ3mgZq7Q5nXaL9a1fvpIv7W Uxr6gLMoulzmQzAmU9LUs7hoovP3r0MHjp7TKuWCfnZl5L+MLHJNrHvhUFyI2Q== ARC-Authentication-Results: i=1; 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-Spam-Score: -1.88 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: A4EB41C07E X-Spam-Score: -1.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: Xyis6rng369U Hi, notmuch-show-insert-part-text/html correctly binds shr-blocked-images to notmuch-show-text/html-blocked-images when using 'shr as the mm-text-html-renderer. However, when the latter is not shr, the function only binds gnus-blocked-images, which is not used by the 'w3m rendered. The corresponding variable to bind is in the latter case w3m-ignored-image-url-regexp, and something like the simple patch below seem to make things work, at least for me. Cheers, jao diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 9a95eb34..0c4fc110 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -823,7 +823,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