Re: [PATCH 3/5] nmbug-status: Add an nmbug-status(5) man page
[notmuch-archives.git] / 68 / 579fb70f5095fc73b97221892e4e57c67a82e5
1 Return-Path: <markwalters1009@gmail.com>\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 olra.theworths.org (Postfix) with ESMTP id 1C410431FB6\r
6         for <notmuch@notmuchmail.org>; Thu,  4 Sep 2014 02:47:15 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id Fx2AR21aKl9E for <notmuch@notmuchmail.org>;\r
18         Thu,  4 Sep 2014 02:47:09 -0700 (PDT)\r
19 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
20         [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 68A86431FAF\r
23         for <notmuch@notmuchmail.org>; Thu,  4 Sep 2014 02:47:09 -0700 (PDT)\r
24 Received: by mail-wi0-f181.google.com with SMTP id e4so732668wiv.14\r
25         for <notmuch@notmuchmail.org>; Thu, 04 Sep 2014 02:47:08 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id;\r
28         bh=o6wkQIVWoJOu5Yz85J6lk1cJ5+japQL2mX9qmM176A0=;\r
29         b=VCxSdHqmip5vdGL5G/kh9nE84a8VpaY6KEL7HPhkGWEYzb9H65f+7g6Eo7QwNUR6B3\r
30         5kN8onhEs+eiNOtorERXxHcs342udFK9PRhxswmAgfVJK7UijNRbrt0HipE9JoTskxRQ\r
31         a2bKZSD0Iv3VLw9aH0M3K20AVSdJVy9ko5cEc++wl8fEUkzPX0hG6T02ybw5C5dYJ35f\r
32         pa03O54tp6uPIMmPb4k3YZ22t6gUdb1HQagmpC7cS0AVKosaa4LK0pVhh6CCJh7c1OQF\r
33         BWRfol61lu2NoYTzi4cfP5fdhOYFhzu8VH1byGu9NILo2d/btIs7LzDejO+6b2NGnXc0\r
34         vgfA==\r
35 X-Received: by 10.194.157.135 with SMTP id wm7mr4395162wjb.117.1409824027024; \r
36         Thu, 04 Sep 2014 02:47:07 -0700 (PDT)\r
37 Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
38         by mx.google.com with ESMTPSA id s1sm792000wiw.6.2014.09.04.02.47.05\r
39         for <multiple recipients>\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Thu, 04 Sep 2014 02:47:06 -0700 (PDT)\r
42 From: Mark Walters <markwalters1009@gmail.com>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH] emacs: jump: fix compile warning on emacs 23\r
45 Date: Thu,  4 Sep 2014 10:46:54 +0100\r
46 Message-Id: <1409824014-14622-1-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.10.4\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Thu, 04 Sep 2014 09:47:15 -0000\r
61 \r
62 notmuch-jump uses window-body-width which is not defined in emacs\r
63 23. To get around this it does\r
64 \r
65 (unless (fboundp 'window-body-width)\r
66   ;; Compatibility for Emacs pre-24\r
67   (defalias 'window-body-width 'window-width))\r
68 \r
69 This makes sure window-body-width is defined and all should be\r
70 well. But it seems that the byte compiler does not realise that this\r
71 guarantees that window-body-width will be defined and so, when\r
72 compiling with emacs 23, it gives an error\r
73 \r
74 In end of data:\r
75 notmuch-jump.el:172:1:Warning: the function `window-body-width' is not known to be defined.\r
76 \r
77 Domo and I came to following on irc: wrap the (unless (fboundp ...))\r
78 inside eval-and-compile which ensures that both the test and the\r
79 defalias (if needed) happen at both compile and load time.  This fixes\r
80 the warning.\r
81 ---\r
82 I think Domo and I were both not completely sure whether the\r
83 eval-and-compile should be inside or outside the (unless fboundp ..)\r
84 or not (ie should it wrap the unless fboundp or just the defalias) nor\r
85 whether it should be eval-and-compile or eval-when-compile.\r
86 \r
87 We think this is the right version but it would be good to have confirmation.\r
88 \r
89 I tested notmuch jump inside emacs 23 and 24 with notmuch-emacs\r
90 compiled with emacs 23 or 24 (ie all four combinations) and it seemed to work.\r
91 \r
92 Best wishes\r
93 \r
94 Mark\r
95 \r
96 \r
97 \r
98  emacs/notmuch-jump.el |    7 ++++---\r
99  1 file changed, 4 insertions(+), 3 deletions(-)\r
100 \r
101 diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el\r
102 index 5eb0949..2706b6c 100644\r
103 --- a/emacs/notmuch-jump.el\r
104 +++ b/emacs/notmuch-jump.el\r
105 @@ -25,9 +25,10 @@\r
106  (require 'notmuch-lib)\r
107  (require 'notmuch-hello)\r
108  \r
109 -(unless (fboundp 'window-body-width)\r
110 -  ;; Compatibility for Emacs pre-24\r
111 -  (defalias 'window-body-width 'window-width))\r
112 +(eval-and-compile\r
113 +  (unless (fboundp 'window-body-width)\r
114 +    ;; Compatibility for Emacs pre-24\r
115 +    (defalias 'window-body-width 'window-width)))\r
116  \r
117  ;;;###autoload\r
118  (defun notmuch-jump-search ()\r
119 -- \r
120 1.7.10.4\r
121 \r