From 347ae697737a8f632e4330ddf81b22fba4fa069d Mon Sep 17 00:00:00 2001 From: Sanjoy Mahajan Date: Fri, 13 May 2016 11:11:55 +2000 Subject: [PATCH] slight workaround needed to use gnus-alias --- c2/3298d2cfb5de93a442b20cced3918af1ba2a10 | 99 +++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 c2/3298d2cfb5de93a442b20cced3918af1ba2a10 diff --git a/c2/3298d2cfb5de93a442b20cced3918af1ba2a10 b/c2/3298d2cfb5de93a442b20cced3918af1ba2a10 new file mode 100644 index 000000000..68c41ff6c --- /dev/null +++ b/c2/3298d2cfb5de93a442b20cced3918af1ba2a10 @@ -0,0 +1,99 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 86AC46DE0188 + for ; Thu, 12 May 2016 08:42:16 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.011 +X-Spam-Level: +X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 + tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id E1hBJDsXPIK9 for ; + Thu, 12 May 2016 08:42:08 -0700 (PDT) +X-Greylist: delayed 1809 seconds by postgrey-1.35 at arlo; + Thu, 12 May 2016 08:42:08 PDT +Received: from EXCAS03.olin.edu (webmail.olin.edu [208.91.53.40]) + by arlo.cworth.org (Postfix) with ESMTPS id 79A416DE00D3 + for ; Thu, 12 May 2016 08:42:08 -0700 (PDT) +Received: from insight.mit.edu (108.20.254.101) by EX04.olin.edu (10.1.15.12) + with Microsoft SMTP Server (TLS) id 15.0.1104.5; + Thu, 12 May 2016 11:11:57 -0400 +Received: from sanjoy by insight.mit.edu with local (Exim 4.87) + (envelope-from ) id 1b0sHL-0005kj-JE + for notmuch@notmuchmail.org; Thu, 12 May 2016 11:11:55 -0400 +From: Sanjoy Mahajan +To: +Subject: slight workaround needed to use gnus-alias +User-Agent: Notmuch/0.22 (http://notmuchmail.org) Emacs/24.5.1 + (x86_64-pc-linux-gnu) +Date: Thu, 12 May 2016 11:11:55 -0400 +Message-ID: <87lh3f1fb8.fsf@insight.mit.edu> +MIME-Version: 1.0 +Content-Type: text/plain +X-Originating-IP: [108.20.254.101] +X-ClientProxiedBy: EXCAS04.olin.edu (10.1.15.17) To EX04.olin.edu (10.1.15.12) +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 12 May 2016 15:42:16 -0000 + +(I am using notmuch 0.22 from the Debian 0.22-1 package, in Emacs 24.5.1.) + +I start gnus-alias in my message-setup-hook: + + (add-hook 'message-setup-hook 'gnus-alias-determine-identity) + +That worked fine until recently. Now it fails with the following error +(in the *Messages* buffer and minibuffer): + + apply: Must be in `message-mode'.? + +The problem is the following in gnus-alias.el: + + (defun gnus-alias-ensure-message-mode () + "Assert that the current buffer is a message buffer." + (when (not (eq major-mode 'message-mode)) + (gnus-alias-error "Must be in `message-mode'.? "))) + +The latest notmuch-mua.el doesn't use message-mode directly but rather +defines a derived mode: + + (define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]" + "Notmuch message composition mode. Mostly like `message-mode'" + (when notmuch-address-command + (notmuch-address-setup))) + +I'm not sure what the best fix is. But I've done the following, which +works for me: + +(require 'gnus-alias) +(gnus-alias-init) +;;; upstream version checks just for message-mode, but notmuch uses +;;; notmuch-message-mode, which is derived from message-mode +(defun gnus-alias-ensure-message-mode () + "Assert that the current buffer is a message buffer." + (when (not (derived-mode-p 'notmuch-message-mode)) + (gnus-alias-error "Must be in `message-mode' or mode derived from it. "))) +(add-hook 'message-setup-hook 'gnus-alias-determine-identity) + +-- +-Sanjoy + + +Save Long Wharf Park in Boston Harbor! + + +Six reasoning tools to make hard problems easy. -- 2.26.2