3 test_description="emacs interface"
6 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
10 test_begin_subtest "Basic notmuch-hello view in emacs"
11 test_emacs '(notmuch-hello)
13 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello
15 test_begin_subtest "Saved search with 0 results"
16 test_emacs '(let ((notmuch-show-empty-saved-searches t)
17 (notmuch-saved-searches
18 '\''(("inbox" . "tag:inbox")
19 ("unread" . "tag:unread")
20 ("empty" . "tag:doesnotexist"))))
23 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-with-empty
25 test_begin_subtest "No saved searches displayed (all with 0 results)"
26 test_emacs '(let ((notmuch-saved-searches
27 '\''(("empty" . "tag:doesnotexist"))))
30 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches
32 test_begin_subtest "Basic notmuch-search view in emacs"
33 test_emacs '(notmuch-search "tag:inbox")
36 test_expect_equal_file OUTPUT $EXPECTED/notmuch-search-tag-inbox
38 test_begin_subtest "Navigation of notmuch-hello to search results"
39 test_emacs '(notmuch-hello)
40 (goto-char (point-min))
41 (re-search-forward "inbox")
42 (widget-button-press (1- (point)))
45 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox
47 test_begin_subtest "Basic notmuch-show view in emacs"
48 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
49 test_emacs "(notmuch-show \"$maildir_storage_thread\")
51 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
53 test_begin_subtest "Basic notmuch-show view in emacs default indentation"
54 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
55 test_emacs "(let ((notmuch-show-indent-messages-width 1))
56 (notmuch-show \"$maildir_storage_thread\")
58 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
60 test_begin_subtest "Basic notmuch-show view in emacs without indentation"
61 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
62 test_emacs "(let ((notmuch-show-indent-messages-width 0))
63 (notmuch-show \"$maildir_storage_thread\")
65 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-without-indentation
67 test_begin_subtest "Basic notmuch-show view in emacs with fourfold indentation"
68 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
69 test_emacs "(let ((notmuch-show-indent-messages-width 4))
70 (notmuch-show \"$maildir_storage_thread\")
72 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation
74 test_begin_subtest "notmuch-show for message with invalid From"
75 add_message "[subject]=\"message-with-invalid-from\"" \
76 "[from]=\"\\\"Invalid \\\" From\\\" <test_suite@notmuchmail.org>\""
77 thread=$(notmuch search --output=threads subject:message-with-invalid-from)
78 test_emacs "(notmuch-show \"$thread\")
81 "Invalid " (2001-01-05) (inbox)
82 Subject: message-with-invalid-from
83 To: Notmuch Test Suite <test_suite@notmuchmail.org>
84 Date: Fri, 05 Jan 2001 15:43:57 +0000
86 This is just a test message (#1)
88 test_expect_equal_file OUTPUT EXPECTED
90 test_begin_subtest "Navigation of notmuch-search to thread view"
91 test_emacs '(notmuch-search "tag:inbox")
93 (goto-char (point-min))
94 (re-search-forward "Working with Maildir")
95 (notmuch-search-show-thread)
98 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
100 test_begin_subtest "Add tag from search view"
101 os_x_darwin_thread=$(notmuch search --output=threads id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com)
102 test_emacs "(notmuch-search \"$os_x_darwin_thread\")
104 (execute-kbd-macro \"+tag-from-search-view\")"
105 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
106 test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-search-view unread)"
108 test_begin_subtest "Remove tag from search view"
109 test_emacs "(notmuch-search \"$os_x_darwin_thread\")
111 (execute-kbd-macro \"-tag-from-search-view\")"
112 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
113 test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"
115 test_begin_subtest "Add tag from notmuch-show view"
116 test_emacs "(notmuch-show \"$os_x_darwin_thread\")
117 (execute-kbd-macro \"+tag-from-show-view\")"
118 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
119 test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)"
121 test_begin_subtest "Remove tag from notmuch-show view"
122 test_emacs "(notmuch-show \"$os_x_darwin_thread\")
123 (execute-kbd-macro \"-tag-from-show-view\")"
124 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
125 test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"
127 test_begin_subtest "Message with .. in Message-Id:"
128 add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'
129 test_emacs '(notmuch-search "id:\"123..456@example\"")
131 (execute-kbd-macro "+search-add")
132 (execute-kbd-macro "+search-remove")
133 (execute-kbd-macro "-search-remove")
134 (notmuch-show "id:\"123..456@example\"")
136 (execute-kbd-macro "+show-add")
137 (execute-kbd-macro "+show-remove")
138 (execute-kbd-macro "-show-remove")'
139 output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize)
140 test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)"
142 test_begin_subtest "Message with quote in Message-Id:"
143 add_message '[id]="\"quote\"@example"' '[subject]="Message with quote in Message-Id"'
144 test_emacs '(notmuch-search "subject:\"Message with quote\"")
146 (execute-kbd-macro "+search-add")
147 (notmuch-search-show-thread)
149 (execute-kbd-macro "+show-add")'
150 output=$(notmuch search 'id:"""quote""@example"' | notmuch_search_sanitize)
151 test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with quote in Message-Id (inbox search-add show-add)"
153 test_begin_subtest "Sending a message via (fake) SMTP"
154 emacs_deliver_message \
155 'Testing message sent via SMTP' \
156 'This is a test that messages are sent via SMTP' \
159 (insert "To: user@example.com\n")'
161 -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \
162 -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' < sent_message >OUTPUT
164 From: Notmuch Test Suite <test_suite@notmuchmail.org>
166 Subject: Testing message sent via SMTP
167 Date: 01 Jan 2000 12:00:00 -0000
168 User-Agent: Notmuch/XXX Emacs/XXX
171 Content-Type: text/plain; charset=us-ascii
173 This is a test that messages are sent via SMTP
175 test_expect_equal_file OUTPUT EXPECTED
177 test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)"
178 notmuch new > /dev/null
179 output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize)
180 test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"
182 test_begin_subtest "notmuch-fcc-dirs set to nil"
183 test_emacs "(let ((notmuch-fcc-dirs nil))
187 From: Notmuch Test Suite <test_suite@notmuchmail.org>
190 --text follows this line--
192 test_expect_equal_file OUTPUT EXPECTED
194 # Make another FCC maildir specific for the next test
195 mkdir -p mail/sent-string/cur
196 mkdir -p mail/sent-string/new
197 mkdir -p mail/sent-string/tmp
199 test_begin_subtest "notmuch-fcc-dirs set to a string"
200 test_emacs "(let ((notmuch-fcc-dirs \"sent-string\"))
204 From: Notmuch Test Suite <test_suite@notmuchmail.org>
207 Fcc: ${MAIL_DIR}/sent-string
208 --text follows this line--
210 test_expect_equal_file OUTPUT EXPECTED
212 # Make more FCC maildirs specific for the next test
213 mkdir -p mail/sent-list-match/cur
214 mkdir -p mail/sent-list-match/new
215 mkdir -p mail/sent-list-match/tmp
216 mkdir -p mail/failure/cur
217 mkdir -p mail/failure/new
218 mkdir -p mail/failure/tmp
220 test_begin_subtest "notmuch-fcc-dirs set to a list (with match)"
221 test_emacs "(let ((notmuch-fcc-dirs
222 '((\"notmuchmail.org\" . \"sent-list-match\")
223 (\".*\" . \"failure\"))))
227 From: Notmuch Test Suite <test_suite@notmuchmail.org>
230 Fcc: ${MAIL_DIR}/sent-list-match
231 --text follows this line--
233 test_expect_equal_file OUTPUT EXPECTED
235 # Make another FCC maildir specific for the next test
236 mkdir -p mail/sent-list-catch-all/cur
237 mkdir -p mail/sent-list-catch-all/new
238 mkdir -p mail/sent-list-catch-all/tmp
240 test_begin_subtest "notmuch-fcc-dirs set to a list (catch-all)"
241 test_emacs "(let ((notmuch-fcc-dirs
242 '((\"example.com\" . \"failure\")
243 (\".*\" . \"sent-list-catch-all\"))))
247 From: Notmuch Test Suite <test_suite@notmuchmail.org>
250 Fcc: ${MAIL_DIR}/sent-list-catch-all
251 --text follows this line--
253 test_expect_equal_file OUTPUT EXPECTED
255 test_begin_subtest "notmuch-fcc-dirs set to a list (no match)"
256 test_emacs "(let ((notmuch-fcc-dirs
257 '((\"example.com\" . \"failure\")
258 (\"nomatchhere.net\" . \"failure\"))))
262 From: Notmuch Test Suite <test_suite@notmuchmail.org>
265 --text follows this line--
267 test_expect_equal_file OUTPUT EXPECTED
269 test_begin_subtest "Reply within emacs"
270 test_emacs '(let ((message-hidden-headers ''()))
271 (notmuch-search "subject:\"testing message sent via SMTP\"")
273 (notmuch-search-reply-to-thread)
275 sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT
276 sed -i -e 's/^References: <.*>$/References: <XXX>/' OUTPUT
277 sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
279 From: Notmuch Test Suite <test_suite@notmuchmail.org>
281 Subject: Re: Testing message sent via SMTP
283 Fcc: ${MAIL_DIR}/sent
285 User-Agent: Notmuch/XXX Emacs/XXX
286 --text follows this line--
287 Notmuch Test Suite <test_suite@notmuchmail.org> writes:
289 > This is a test that messages are sent via SMTP
291 test_expect_equal_file OUTPUT EXPECTED
293 test_begin_subtest "Reply from alternate address within emacs"
294 add_message '[from]="Sender <sender@example.com>"' \
295 [to]=test_suite_other@notmuchmail.org
297 test_emacs "(let ((message-hidden-headers '()))
298 (notmuch-search \"id:\\\"${gen_msg_id}\\\"\")
300 (notmuch-search-reply-to-thread)
302 sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
304 From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
305 To: Sender <sender@example.com>
306 Subject: Re: ${test_subtest_name}
307 In-Reply-To: <${gen_msg_id}>
308 Fcc: ${MAIL_DIR}/sent
309 References: <${gen_msg_id}>
310 User-Agent: Notmuch/XXX Emacs/XXX
311 --text follows this line--
312 Sender <sender@example.com> writes:
314 > This is just a test message (#${gen_msg_cnt})
316 test_expect_equal_file OUTPUT EXPECTED
318 test_begin_subtest "Reply from address in named group list within emacs"
319 add_message '[from]="Sender <sender@example.com>"' \
320 '[to]=group:test_suite@notmuchmail.org,someone@example.com\;' \
321 [cc]=test_suite_other@notmuchmail.org
323 test_emacs "(let ((message-hidden-headers '()))
324 (notmuch-search \"id:\\\"${gen_msg_id}\\\"\")
326 (notmuch-search-reply-to-thread)
328 sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
330 From: Notmuch Test Suite <test_suite@notmuchmail.org>
331 To: Sender <sender@example.com>, someone@example.com
332 Subject: Re: ${test_subtest_name}
333 In-Reply-To: <${gen_msg_id}>
334 Fcc: ${MAIL_DIR}/sent
335 References: <${gen_msg_id}>
336 User-Agent: Notmuch/XXX Emacs/XXX
337 --text follows this line--
338 Sender <sender@example.com> writes:
340 > This is just a test message (#${gen_msg_cnt})
342 test_expect_equal_file OUTPUT EXPECTED
344 test_begin_subtest "Reply within emacs to a multipart/mixed message"
345 test_emacs '(let ((message-hidden-headers ''()))
346 (notmuch-show "id:20091118002059.067214ed@hikari")
349 sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
351 From: Notmuch Test Suite <test_suite@notmuchmail.org>
352 To: Adrian Perez de Castro <aperez@igalia.com>, notmuch@notmuchmail.org
353 Subject: Re: [notmuch] Introducing myself
354 In-Reply-To: <20091118002059.067214ed@hikari>
355 Fcc: ${MAIL_DIR}/sent
356 References: <20091118002059.067214ed@hikari>
357 User-Agent: Notmuch/XXX Emacs/XXX
358 --text follows this line--
359 Adrian Perez de Castro <aperez@igalia.com> writes:
363 > I have just heard about Not Much today in some random Linux-related news
364 > site (LWN?), my name is Adrian Perez and I work as systems administrator
365 > (although I can do some code as well :P). I have always thought that the
366 > ideas behind Sup were great, but after some time using it, I got tired of
367 > the oddities that it has. I also do not like doing things like having to
368 > install Ruby just for reading and sorting mails. Some time ago I thought
369 > about doing something like Not Much and in fact I played a bit with the
370 > Python+Xapian and the Python+Whoosh combinations, because I find relaxing
371 > to code things in Python when I am not working and also it is installed
372 > by default on most distribution. I got to have some mailboxes indexed and
373 > basic searching working a couple of months ago. Lately I have been very
374 > busy and had no time for coding, and them... boom! Not Much appears -- and
375 > it is almost exactly what I was trying to do, but faster. I have been
376 > playing a bit with Not Much today, and I think it has potential.
378 > Also, I would like to share one idea I had in mind, that you might find
379 > interesting: One thing I have found very annoying is having to re-tag my
380 > mail when the indexes get b0rked (it happened a couple of times to me while
381 > using Sup), so I was planning to mails as read/unread and adding the tags
382 > not just to the index, but to the mail text itself, e.g. by adding a
383 > "X-Tags" header field or by reusing the "Keywords" one. This way, the index
384 > could be totally recreated by re-reading the mail directories, and this
385 > would also allow to a tools like OfflineIMAP [1] to get the mails into a
386 > local maildir, tagging and indexing the mails with the e-mail reader and
387 > then syncing back the messages with the "X-Tags" header to the IMAP server.
388 > This would allow to use the mail reader from a different computer and still
389 > have everything tagged finely.
395 > [1] http://software.complete.org/software/projects/show/offlineimap
398 > Adrian Perez de Castro <aperez@igalia.com>
399 > Igalia - Free Software Engineering
400 > _______________________________________________
401 > notmuch mailing list
402 > notmuch@notmuchmail.org
403 > http://notmuchmail.org/mailman/listinfo/notmuch
405 test_expect_equal_file OUTPUT EXPECTED
407 test_begin_subtest "Reply within emacs to a multipart/alternative message"
408 test_emacs '(let ((message-hidden-headers ''()))
409 (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
412 sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
414 From: Notmuch Test Suite <test_suite@notmuchmail.org>
415 To: Alex Botero-Lowry <alex.boterolowry@gmail.com>, notmuch@notmuchmail.org
416 Subject: Re: [notmuch] preliminary FreeBSD support
417 In-Reply-To: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>
418 Fcc: ${MAIL_DIR}/sent
419 References: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>
420 User-Agent: Notmuch/XXX Emacs/XXX
421 --text follows this line--
422 Alex Botero-Lowry <alex.boterolowry@gmail.com> writes:
424 > I saw the announcement this morning, and was very excited, as I had been
425 > hoping sup would be turned into a library,
426 > since I like the concept more than the UI (I'd rather an emacs interface).
428 > I did a preliminary compile which worked out fine, but
429 > sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on
430 > FreeBSD, so notmuch_config_open segfaulted.
432 > Attached is a patch that supplies a default buffer size of 64 in cases where
435 > http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this
436 > is acceptable behavior,
437 > and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically
440 > _______________________________________________
441 > notmuch mailing list
442 > notmuch@notmuchmail.org
443 > http://notmuchmail.org/mailman/listinfo/notmuch
445 test_expect_equal_file OUTPUT EXPECTED
447 test_begin_subtest "Reply within emacs to an html-only message"
448 add_message '[content-type]="text/html"' \
449 '[body]="Hi,<br />This is an <b>HTML</b> test message.<br /><br />OK?"'
450 test_emacs "(let ((message-hidden-headers '()) (mm-text-html-renderer 'html2text))
451 (notmuch-show \"id:${gen_msg_id}\")
454 sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
456 From: Notmuch Test Suite <test_suite@notmuchmail.org>
458 Subject: Re: Reply within emacs to an html-only message
459 In-Reply-To: <${gen_msg_id}>
460 Fcc: ${MAIL_DIR}/sent
461 References: <${gen_msg_id}>
462 User-Agent: Notmuch/XXX Emacs/XXX
463 --text follows this line--
464 Notmuch Test Suite <test_suite@notmuchmail.org> writes:
466 > Hi,This is an HTML test message.OK?
468 test_expect_equal_file OUTPUT EXPECTED
470 test_begin_subtest "Quote MML tags in reply"
471 message_id='test-emacs-mml-quoting@message.id'
472 add_message [id]="$message_id" \
473 "[subject]='$test_subtest_name'" \
474 '[body]="<#part disposition=inline>"'
475 test_emacs "(let ((message-hidden-headers '()))
476 (notmuch-show \"id:$message_id\")
479 sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT
481 From: Notmuch Test Suite <test_suite@notmuchmail.org>
483 Subject: Re: Quote MML tags in reply
484 In-Reply-To: <test-emacs-mml-quoting@message.id>
485 Fcc: ${MAIL_DIR}/sent
486 References: <test-emacs-mml-quoting@message.id>
487 User-Agent: Notmuch/XXX Emacs/XXX
488 --text follows this line--
489 Notmuch Test Suite <test_suite@notmuchmail.org> writes:
491 > <#!part disposition=inline>
493 test_expect_equal_file OUTPUT EXPECTED
495 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"
496 # save as archive to test that Emacs does not re-compress .gz
497 test_emacs '(let ((standard-input "\"attachment1.gz\""))
498 (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
499 (notmuch-show-save-attachments))'
500 test_expect_equal_file attachment1.gz "$EXPECTED/attachment"
502 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part"
503 # save as archive to test that Emacs does not re-compress .gz
504 test_emacs '(let ((standard-input "\"attachment2.gz\""))
505 (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))'
506 test_expect_equal_file attachment2.gz "$EXPECTED/attachment"
508 test_begin_subtest "View raw message within emacs"
509 test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
510 (notmuch-show-view-raw-message)
512 test_expect_equal_file OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a
514 test_begin_subtest "Hiding/showing signature in notmuch-show view"
515 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
516 test_emacs "(notmuch-show \"$maildir_storage_thread\")
517 (search-forward \"Click/Enter to show.\")
518 (button-activate (button-at (point)))
519 (search-backward \"Click/Enter to hide.\")
520 (button-activate (button-at (point)))
522 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
524 test_begin_subtest "Detection and hiding of top-post quoting of message"
525 add_message '[subject]="The problem with top-posting"' \
526 [id]=top-post-target \
527 '[body]="A: Because it messes up the order in which people normally read text.
528 Q: Why is top-posting such a bad thing?
530 Q: What is the most annoying thing in e-mail?"'
531 add_message '[from]="Top Poster <top@poster.com>"' \
532 [in-reply-to]=top-post-target \
533 [references]=top-post-target \
534 '[subject]="Re: The problem with top-posting"' \
535 '[body]="Thanks for the advice! I will be sure to put it to good use.
539 ----- Original Message -----
540 From: Notmuch Test Suite <test_suite@notmuchmail.org>
541 To: Notmuch Test Suite <test_suite@notmuchmai.org>
542 Sent: Fri, 05 Jan 2001 15:43:57 +0000
543 Subject: The problem with top-posting
545 Q: Why is top-posting such a bad thing?
547 Q: What is the most annoying thing in e-mail?"'
548 test_emacs "(notmuch-show \"top-posting\")
549 (test-visible-output)"
550 echo "Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
551 Subject: The problem with top-posting
552 To: Notmuch Test Suite <test_suite@notmuchmail.org>
553 Date: Fri, 05 Jan 2001 15:43:57 +0000
555 A: Because it messes up the order in which people normally read text.
556 Q: Why is top-posting such a bad thing?
558 Q: What is the most annoying thing in e-mail?
559 Top Poster <top@poster.com> (2001-01-05) (inbox unread)
560 Subject: Re: The problem with top-posting
561 To: Notmuch Test Suite <test_suite@notmuchmail.org>
562 Date: Fri, 05 Jan 2001 15:43:57 +0000
564 Thanks for the advice! I will be sure to put it to good use.
568 [ 9-line hidden original message. Click/Enter to show. ]" > EXPECTED
569 test_expect_equal_file OUTPUT EXPECTED
571 test_begin_subtest "Hiding message in notmuch-show view"
572 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
573 (notmuch-show-toggle-message)
574 (test-visible-output)'
575 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
577 test_begin_subtest "Hiding message with visible citation in notmuch-show view"
578 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
579 (search-forward "Click/Enter to show.")
580 (button-activate (button-at (point)))
581 (notmuch-show-toggle-message)
582 (test-visible-output)'
583 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
585 test_begin_subtest "Stashing in notmuch-show"
586 add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \
587 '[from]="Some One <someone@somewhere.org>"' \
588 '[to]="Some One Else <notsomeone@somewhere.org>"' \
589 '[cc]="Notmuch <notmuch@notmuchmail.org>"' \
590 '[subject]="Stash my stashables"' \
592 '[body]="Unable to stash body. Where did you get it in the first place?!?"'
593 notmuch tag +stashtest id:${gen_msg_id}
594 test_emacs '(notmuch-show "id:\"bought\"")
595 (notmuch-show-stash-date)
596 (notmuch-show-stash-from)
597 (notmuch-show-stash-to)
598 (notmuch-show-stash-cc)
599 (notmuch-show-stash-subject)
600 (notmuch-show-stash-message-id)
601 (notmuch-show-stash-message-id-stripped)
602 (notmuch-show-stash-tags)
603 (notmuch-show-stash-filename)
604 (notmuch-show-stash-mlarchive-link "Gmane")
605 (notmuch-show-stash-mlarchive-link "MARC")
606 (notmuch-show-stash-mlarchive-link "Mail Archive, The")
608 (generate-new-buffer "*test-stashing*"))
612 (rotate-yank-pointer 1))
613 (reverse-region (point-min) (point-max))
616 Sat, 01 Jan 2000 12:00:00 +0000
617 Some One <someone@somewhere.org>
618 Some One Else <notsomeone@somewhere.org>
619 Notmuch <notmuch@notmuchmail.org>
625 http://mid.gmane.org/bought
626 http://marc.info/?i=bought
627 http://mail-archive.com/search?l=mid&q=bought
629 test_expect_equal_file OUTPUT EXPECTED
631 test_begin_subtest "Stashing in notmuch-search"
632 test_emacs '(notmuch-search "id:\"bought\"")
634 (notmuch-search-stash-thread-id)
636 (generate-new-buffer "*test-stashing*"))
639 sed -i -e 's/^thread:.*$/thread:XXX/' OUTPUT
640 test_expect_equal "$(cat OUTPUT)" "thread:XXX"
642 test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature'
643 message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu'
644 message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net'
645 test_emacs "(notmuch-search \"$message1 or $message2\")
647 (notmuch-search-show-thread)
648 (goto-char (point-max))
650 (notmuch-show-advance-and-archive)
652 test_emacs "(notmuch-show \"$message2\")
653 (test-output \"EXPECTED\")"
654 test_expect_equal_file OUTPUT EXPECTED
656 test_begin_subtest "Refresh show buffer"
657 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
658 (test-visible-output "EXPECTED")
659 (notmuch-show-refresh-view)
660 (test-visible-output)'
661 test_expect_equal_file OUTPUT EXPECTED
663 test_begin_subtest "Refresh modified show buffer"
664 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
665 (notmuch-show-toggle-message)
666 (notmuch-show-next-message)
667 (notmuch-show-toggle-message)
668 (test-visible-output "EXPECTED")
669 (notmuch-show-refresh-view)
670 (test-visible-output)'
671 test_expect_equal_file OUTPUT EXPECTED
673 test_begin_subtest "Do not call notmuch for non-inlinable application/mpeg parts"
674 id='message-with-application/mpeg-attachment@notmuchmail.org'
675 emacs_deliver_message \
676 'Message with application/mpeg attachment' \
679 (insert \"Message-ID: <$id>\n\")
681 (mml-insert-part \"application/mpeg\")
682 (insert \"a fake mp3 file\")"
683 notmuch_counter_reset
684 test_emacs "(let ((notmuch-command \"$notmuch_counter_command\"))
685 (notmuch-show \"id:$id\"))"
686 test_expect_equal $(notmuch_counter_value) 1
688 test_begin_subtest "Do not call notmuch for non-inlinable audio/mpeg parts"
689 id='message-with-audio/mpeg-attachment@notmuchmail.org'
690 emacs_deliver_message \
691 'Message with audio/mpeg attachment' \
694 (insert \"Message-ID: <$id>\n\")
696 (mml-insert-part \"audio/mpeg\")
697 (insert \"a fake mp3 file\")"
698 notmuch_counter_reset
699 test_emacs "(let ((notmuch-command \"$notmuch_counter_command\"))
700 (notmuch-show \"id:$id\"))"
701 test_expect_equal $(notmuch_counter_value) 1
703 test_begin_subtest "notmuch-hello-mode hook is called"
704 counter=$(test_emacs \
705 '(let ((notmuch-hello-mode-hook-counter 0))
706 (kill-buffer "*notmuch-hello*")
708 notmuch-hello-mode-hook-counter)'
710 test_expect_equal "$counter" 1
712 test_begin_subtest "notmuch-hello-mode hook is not called on updates"
713 counter=$(test_emacs \
714 '(let ((notmuch-hello-mode-hook-counter 0))
715 (kill-buffer "*notmuch-hello*")
717 (notmuch-hello-update)
718 notmuch-hello-mode-hook-counter)'
720 test_expect_equal "$counter" 1
722 test_begin_subtest "notmuch-hello-refresh hook is called"
723 counter=$(test_emacs \
724 '(let ((notmuch-hello-refresh-hook-counter 0))
725 (kill-buffer "*notmuch-hello*")
727 notmuch-hello-refresh-hook-counter)'
729 test_expect_equal "$counter" 1
731 test_begin_subtest "notmuch-hello-refresh hook is called on updates"
732 counter=$(test_emacs \
733 '(let ((notmuch-hello-refresh-hook-counter 0))
734 (kill-buffer "*notmuch-hello*")
736 (notmuch-hello-update)
737 notmuch-hello-refresh-hook-counter)'
739 test_expect_equal "$counter" 2