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