From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mHZfLQOSLl8CfwAA0tVLHw (envelope-from ) for ; Sat, 08 Aug 2020 11:52:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YL8gKQOSLl84PAAAB5/wlQ (envelope-from ) for ; Sat, 08 Aug 2020 11:52:35 +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) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 69EB294028F for ; Sat, 8 Aug 2020 11:52:35 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E2E7629B81; Sat, 8 Aug 2020 07:51:34 -0400 (EDT) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 52BB129ACF for ; Sat, 8 Aug 2020 07:50:15 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 9E4841661F for ; Sat, 8 Aug 2020 13:50:11 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id 6CaSm8rzk5By for ; Sat, 8 Aug 2020 13:50:11 +0200 (CEST) Received: from customer (localhost [127.0.0.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 mail.hostpark.net (Postfix) with ESMTPSA id 74CD316AEC for ; Sat, 8 Aug 2020 13:50:11 +0200 (CEST) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH v3 33/34] emacs: Use new advice mechanism do advice mm-shr Date: Sat, 8 Aug 2020 13:50:08 +0200 Message-Id: <20200808115009.24071-34-jonas@bernoul.li> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200808115009.24071-1-jonas@bernoul.li> References: <20200726165818.400-1-jonas@bernoul.li> <20200808115009.24071-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: HQAR3RS7OGZEZ5DDFKJSGQMKPNZBV2GJ X-Message-ID-Hash: HQAR3RS7OGZEZ5DDFKJSGQMKPNZBV2GJ X-MailFrom: jonas@bernoul.li 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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-Spam-Score: 0.03 X-TUID: NYZlt94Y8Z+h Also because we now only support Emacs >= 25, we can remove the check for Emacs >= 24. --- emacs/notmuch-lib.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 91c94781..118faf1e 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -661,11 +661,9 @@ (defun notmuch-get-bodypart-text (msg part process-crypto &optional cache) ;; first loading gnus-art, which defines it, resulting in a ;; void-variable error. Hence, we advise `mm-shr' to ensure gnus-art ;; is loaded. -(when (>= emacs-major-version 24) - (defadvice mm-shr (before load-gnus-arts activate) - (require 'gnus-art nil t) - (ad-disable-advice 'mm-shr 'before 'load-gnus-arts) - (ad-activate 'mm-shr))) +(define-advice mm-shr (:before (_handle) notmuch--load-gnus-args) + "Require `gnus-art' since we use its variables." + (require 'gnus-art nil t)) (defun notmuch-mm-display-part-inline (msg part content-type process-crypto) "Use the mm-decode/mm-view functions to display a part in the -- 2.28.0