Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / df / 6d0678f029c551675b74404f19f6b6ca160075
1 Return-Path: <tomi.ollila@iki.fi>\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 CF9DA6DE1930\r
6  for <notmuch@notmuchmail.org>; Thu, 12 Nov 2015 01:07:17 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.725\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.725 tagged_above=-999 required=5 tests=[AWL=0.073, \r
12  SPF_NEUTRAL=0.652] 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 mOFL7PHa236e for <notmuch@notmuchmail.org>;\r
16  Thu, 12 Nov 2015 01:07:15 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18  by arlo.cworth.org (Postfix) with ESMTP id E3B3C6DE192F\r
19  for <notmuch@notmuchmail.org>; Thu, 12 Nov 2015 01:07:14 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21  by guru.guru-group.fi (Postfix) with ESMTP id 4742510007F;\r
22  Thu, 12 Nov 2015 11:07:16 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH] devel/emacs: add devel/try-emacs-mua.sh\r
26 In-Reply-To: <87si4bwrsu.fsf@qmul.ac.uk>\r
27 References: <1446390985-20989-1-git-send-email-tomi.ollila@iki.fi>\r
28  <87si4bwrsu.fsf@qmul.ac.uk>\r
29 User-Agent: Notmuch/0.21+14~g053baf4 (http://notmuchmail.org) Emacs/24.3.1\r
30  (x86_64-unknown-linux-gnu)\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
32  $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
33  !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
34 Date: Thu, 12 Nov 2015 11:07:16 +0200\r
35 Message-ID: <m2fv0br3gb.fsf@guru.guru-group.fi>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.20\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42  <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
44  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
49  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Thu, 12 Nov 2015 09:07:18 -0000\r
51 \r
52 On Thu, Nov 12 2015, Mark Walters <markwalters1009@gmail.com> wrote:\r
53 \r
54 >> devel/try-emacs-mua.sh provides an easy way to try and experiment with\r
55 >> the notmuch emacs client provided in emacs subdirectory of notmuch\r
56 >> source tree.\r
57 >>\r
58 >> User is required to choose whether to run emacs with -q, -Q or neither\r
59 >> -- and experienced ones may add other command line options, like\r
60 >> '-f notmuch'.\r
61 >>\r
62 >> This script ensures that no .el files are newer than corresponding .elc\r
63 >> files so that user (/developer!) does not accidentally experiment with\r
64 >> outdated elisp files. The emacs variable to have the same effect,\r
65 >> `load-prefer-newer' is not available until emacs 24.4.\r
66 >>\r
67 >> The *scratch* buffer is filled with some code user can execute before\r
68 >> running notmuch code.\r
69 >\r
70 > I like this -- a nice simple way to get to a working but uncustomised\r
71 > test environment.\r
72 >\r
73 > I don't know how easy the following would be but one addition that I\r
74 > would find very useful would be a way to make this use the test\r
75 > corpus. This would be useful for giving a completely standard\r
76 > environment for interactive testing, but also for debugging what is\r
77 > going on when tests fail.\r
78 >\r
79 > Of course that is a feature request and should not delay the feature.\r
80 >\r
81 > Finally, I think there is a bug: \r
82 >\r
83 >\r
84 >> ---\r
85 >>\r
86 >> Addressed David's comments in id:87d1xdtim1.fsf@maritornes.cs.unb.ca\r
87 >> with 2 updates:\r
88 >>      1) removed "address completion insinuate"\r
89 >>      2) added code to initialize package system when using -q or -Q\r
90 >>\r
91 >>  devel/try-emacs-mua.sh | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++\r
92 >>  1 file changed, 92 insertions(+)\r
93 >>  create mode 100755 devel/try-emacs-mua.sh\r
94 >>\r
95 >> diff --git a/devel/try-emacs-mua.sh b/devel/try-emacs-mua.sh\r
96 >> new file mode 100755\r
97 >> index 000000000000..71be152c2346\r
98 >> --- /dev/null\r
99 >> +++ b/devel/try-emacs-mua.sh\r
100 >> @@ -0,0 +1,92 @@\r
101 >> +#!/bin/sh\r
102 >> +\r
103 >> +# This script provides an easy way to try and experiment with the\r
104 >> +# notmuch emacs client provided in notmuch/emacs directory.\r
105 >> +\r
106 >> +set -eu\r
107 >> +\r
108 >> +test $# -gt 0 || {\r
109 >> +    exec >&2\r
110 >> +    echo\r
111 >> +    echo "Usage: $0 '' | q | Q [other-emacs-args]"\r
112 >> +    echo\r
113 >> +    printf "  $0 %s\n" "'' starts emacs without either -q or -Q option" \\r
114 >> +            "q  starts emacs with -q" \\r
115 >> +            "Q  starts emacs with -Q"\r
116 >> +    echo\r
117 >> +    echo Note that if there are notmuch-emacs .elc files that are older than\r
118 >> +    echo their corresponding .el files those older .elcs will be removed.\r
119 >> +    echo\r
120 >> +    exit 1\r
121 >> +}\r
122 >> +\r
123 >> +case $1 in '') opt=\r
124 >> +    ;; q | -q) opt=-q\r
125 >> +    ;; Q | -Q) opt=-Q\r
126 >> +    ;; *) echo "option '$1' not '', 'q' nor 'Q'" >&2; exit 1\r
127 >> +esac\r
128 >> +shift\r
129 >> +\r
130 >> +case $0 in\r
131 >> +    *\"*)   echo "'$0' contain one or more '\"'s" >&2; exit 1 ;;\r
132 >> +    */*)    d0=${0%/*} ;;\r
133 >> +    *)      d0=.\r
134 >> +esac\r
135 >> +\r
136 >> +pwd=$PWD\r
137 >> +cd "$d0/.."\r
138 >> +nmd=$PWD\r
139 >> +emd=$PWD/emacs\r
140 >> +\r
141 >> +test -f "$nmd"/emacs/notmuch-lib.el || {\r
142 >> +    echo "Cannot find notmuch-emacs source directory"\r
143 >> +    exit 1\r
144 >> +}\r
145 >> +\r
146 >> +if test -x "$nmd"/notmuch\r
147 >> +then\r
148 >> +    nmin='\r
149 >> +To use accompanied notmuch binary from the same source, evaluate\r
150 >> +(setq exec-path (cons \"'"$nmd"'\" exec-path))\r
151 >> +Note: Evaluating the above may be followed by unintended database\r
152 >> +upgrade and getting back to old version may require dump & restore.\r
153 >> +'\r
154 >> +else\r
155 >> +    nmin=\r
156 >> +fi\r
157 >> +\r
158 >> +if test "$opt" = '-q' || test "$opt" = '-Q'\r
159 >> +then\r
160 >> +    pkgin='\r
161 >> +If you want to use packages (like company from elpa) evaluate\r
162 >> +(progn (require '\''package) (package-initialize))\r
163 >> +'\r
164 >> +else\r
165 >> +    pkgin=\r
166 >> +fi\r
167 >\r
168 > As far as I can see at this point we are in $nmd not $emd so the\r
169 > following does not delete stale .elc files.\r
170 \r
171 It sure doesn't! Thanks for the review.\r
172 \r
173 Tomi\r
174 \r
175 \r
176 >\r
177 >> +\r
178 >> +# ensure we don't load .elc files that are older than corresponding .el file\r
179 >> +# the emacs variable `load-prefer-newer' is not available until emacs 24.4\r
180 >> +perl -e 'use strict; use warnings;\r
181 >> +while (<*.elc>) {\r
182 >> +    my $elc = $_; s/elc$/el/;\r
183 >> +    if (-M $_ < -M $elc) {\r
184 >> +            warn "$_ is newer than $elc. Removing $elc\n";\r
185 >> +            unlink $elc or die "Failed to remove '\''$elc'\'': $!\n";\r
186 >> +    }\r
187 >> +}'\r
188 >\r
189 >\r
190 > Best wishes\r
191 >\r
192 > Mark\r
193 >\r
194 >> +\r
195 >> +cd "$pwd"\r
196 >> +\r
197 >> +# note: whitespace in $EMACS splits to command and args\r
198 >> +exec ${EMACS:-emacs} $opt -L "$emd" -l "$emd"/notmuch.el "$@" --eval '\r
199 >> +(with-current-buffer "*scratch*"\r
200 >> +  (insert "\r
201 >> +Go to the end of the following lines and type C-x C-e to evaluate\r
202 >> +(or C-j which is shorter but inserts evaluation results into buffer)\r
203 >> +\r
204 >> +To \"disable\" mail sending, evaluate\r
205 >> +(setq message-send-mail-function (lambda () t))\r
206 >> +'"$nmin$pkgin"'\r
207 >> +To start notmuch (hello) screen, evaluate\r
208 >> +(notmuch-hello)") (set-buffer-modified-p nil))'\r
209 >> -- \r
210 >> 2.0.0\r
211 >>\r
212 >> _______________________________________________\r
213 >> notmuch mailing list\r
214 >> notmuch@notmuchmail.org\r
215 >> https://notmuchmail.org/mailman/listinfo/notmuch\r
216 > _______________________________________________\r
217 > notmuch mailing list\r
218 > notmuch@notmuchmail.org\r
219 > https://notmuchmail.org/mailman/listinfo/notmuch\r