Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / c2 / 3298d2cfb5de93a442b20cced3918af1ba2a10
1 Return-Path: <Sanjoy.Mahajan@olin.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id 86AC46DE0188\r
6  for <notmuch@notmuchmail.org>; Thu, 12 May 2016 08:42:16 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.011\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5\r
12  tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id E1hBJDsXPIK9 for <notmuch@notmuchmail.org>;\r
16  Thu, 12 May 2016 08:42:08 -0700 (PDT)\r
17 X-Greylist: delayed 1809 seconds by postgrey-1.35 at arlo;\r
18  Thu, 12 May 2016 08:42:08 PDT\r
19 Received: from EXCAS03.olin.edu (webmail.olin.edu [208.91.53.40])\r
20  by arlo.cworth.org (Postfix) with ESMTPS id 79A416DE00D3\r
21  for <notmuch@notmuchmail.org>; Thu, 12 May 2016 08:42:08 -0700 (PDT)\r
22 Received: from insight.mit.edu (108.20.254.101) by EX04.olin.edu (10.1.15.12)\r
23  with Microsoft SMTP Server (TLS) id 15.0.1104.5;\r
24  Thu, 12 May 2016 11:11:57 -0400\r
25 Received: from sanjoy by insight.mit.edu with local (Exim 4.87)\r
26  (envelope-from <sanjoy@olin.edu>) id 1b0sHL-0005kj-JE\r
27  for notmuch@notmuchmail.org; Thu, 12 May 2016 11:11:55 -0400\r
28 From: Sanjoy Mahajan <sanjoy@olin.edu>\r
29 To: <notmuch@notmuchmail.org>\r
30 Subject: slight workaround needed to use gnus-alias\r
31 User-Agent: Notmuch/0.22 (http://notmuchmail.org) Emacs/24.5.1\r
32  (x86_64-pc-linux-gnu)\r
33 Date: Thu, 12 May 2016 11:11:55 -0400\r
34 Message-ID: <87lh3f1fb8.fsf@insight.mit.edu>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain\r
37 X-Originating-IP: [108.20.254.101]\r
38 X-ClientProxiedBy: EXCAS04.olin.edu (10.1.15.17) To EX04.olin.edu (10.1.15.12)\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.20\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43  <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
45  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
50  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Thu, 12 May 2016 15:42:16 -0000\r
52 \r
53 (I am using notmuch 0.22 from the Debian 0.22-1 package, in Emacs 24.5.1.)\r
54 \r
55 I start gnus-alias in my message-setup-hook:\r
56 \r
57   (add-hook 'message-setup-hook 'gnus-alias-determine-identity)\r
58 \r
59 That worked fine until recently.  Now it fails with the following error\r
60 (in the *Messages* buffer and minibuffer):\r
61 \r
62   apply: Must be in `message-mode'.? \r
63 \r
64 The problem is the following in gnus-alias.el:\r
65 \r
66   (defun gnus-alias-ensure-message-mode ()\r
67     "Assert that the current buffer is a message buffer."\r
68     (when (not (eq major-mode 'message-mode))\r
69       (gnus-alias-error "Must be in `message-mode'.? ")))\r
70 \r
71 The latest notmuch-mua.el doesn't use message-mode directly but rather\r
72 defines a derived mode:\r
73 \r
74   (define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]"\r
75     "Notmuch message composition mode. Mostly like `message-mode'"\r
76     (when notmuch-address-command\r
77       (notmuch-address-setup)))\r
78 \r
79 I'm not sure what the best fix is.  But I've done the following, which\r
80 works for me:\r
81 \r
82 (require 'gnus-alias)\r
83 (gnus-alias-init)\r
84 ;;; upstream version checks just for message-mode, but notmuch uses\r
85 ;;; notmuch-message-mode, which is derived from message-mode\r
86 (defun gnus-alias-ensure-message-mode ()\r
87   "Assert that the current buffer is a message buffer."\r
88   (when (not (derived-mode-p 'notmuch-message-mode))\r
89     (gnus-alias-error "Must be in `message-mode' or mode derived from it. ")))\r
90 (add-hook 'message-setup-hook 'gnus-alias-determine-identity)\r
91 \r
92 -- \r
93 -Sanjoy\r
94 \r
95 <http://savelongwharfpark.org/>\r
96 Save Long Wharf Park in Boston Harbor!\r
97 \r
98 <http://streetfightingmath.com/>\r
99 Six reasoning tools to make hard problems easy.\r