]> git.notmuchmail.org Git - notmuch/commitdiff
Merge branch 'release'
authorDavid Bremner <bremner@debian.org>
Sun, 27 Nov 2011 05:15:20 +0000 (21:15 -0800)
committerDavid Bremner <bremner@debian.org>
Sun, 27 Nov 2011 05:15:20 +0000 (21:15 -0800)
19 files changed:
Makefile.local
RELEASING
debian/control
emacs/notmuch-hello.el
emacs/notmuch-show.el
emacs/notmuch.el
lib/Makefile.local
lib/message.cc
test/Makefile.local
test/basic
test/emacs
test/emacs.expected-output/emacs-stashing [deleted file]
test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation [new file with mode: 0644]
test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation [new file with mode: 0644]
test/notmuch-test
test/raw
test/symbol-test.cc
test/test-lib.sh [changed mode: 0755->0644]
util/Makefile.local

index 8b42136a640b1c80cef40a8829c8e148e7e6650e..c94402b18d04e858fa89bd2e0a9b666fc14efeb5 100644 (file)
@@ -12,16 +12,18 @@ PACKAGE=notmuch
 
 IS_GIT=$(shell if [ -d .git ] ; then echo yes ; else echo no; fi)
 
+ifeq ($(IS_GIT),yes)
+DATE:=$(shell git log --date=short -1 --pretty=format:%cd)
+else
+DATE:=$(shell date +%F)
+endif
+
 VERSION:=$(shell cat ${srcdir}/version)
-ifneq ($(MAKECMDGOALS),release)
-ifneq ($(MAKECMDGOALS),release-message)
-ifneq ($(MAKECMDGOALS),pre-release)
+ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
 ifeq ($(IS_GIT),yes)
 VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
 endif
 endif
-endif
-endif
 
 UPSTREAM_TAG=$(subst ~,_,$(VERSION))
 DEB_TAG=debian/$(UPSTREAM_TAG)-1
@@ -91,6 +93,12 @@ $(GPG_FILE): $(SHA1_FILE)
 .PHONY: dist
 dist: $(TAR_FILE)
 
+.PHONY: update-versions
+
+update-versions:
+       sed -i "s/^.TH NOTMUCH 1.*$$/.TH NOTMUCH 1 ${DATE} \"Notmuch ${VERSION}\"/" notmuch.1
+       sed -i "s/^__VERSION__[[:blank:]]*=.*$$/__VERSION__ = \'${VERSION}\'/" $(PV_FILE)
+
 # We invoke make recursively only to force ordering of our phony
 # targets in the case of parallel invocation of make (-j).
 #
@@ -179,7 +187,7 @@ release-message:
 verify-source-tree-and-version: verify-no-dirty-code
 
 .PHONY: verify-no-dirty-code
-verify-no-dirty-code: verify-version-debian verify-version-python
+verify-no-dirty-code: verify-version-debian verify-version-python verify-version-manpage
 ifeq ($(IS_GIT),yes)
        @printf "Checking that source tree is clean..."
 ifneq ($(shell git ls-files -m),)
@@ -199,28 +207,33 @@ endif
 .PHONY: verify-version-debian
 verify-version-debian: verify-version-components
        @echo -n "Checking that Debian package version is $(VERSION)-1..."
-       @if [ "$(VERSION)-1" != $$(dpkg-parsechangelog | grep ^Version | awk '{print $$2}') ] ; then \
+       @[ "$(VERSION)-1" = $$(sed '1{ s/).*//; s/.*(//; q; }' debian/changelog) ] || \
                (echo "No." && \
-                echo "Please edit version and debian/changelog to have consistent versions." && false) \
-        fi
+                echo "Please edit version and debian/changelog to have consistent versions." && false)
        @echo "Good."
 
 .PHONY: verify-version-python
 verify-version-python: verify-version-components
        @echo -n "Checking that python bindings version is $(VERSION)..."
-       @if [ "$(VERSION)" != $$(python -c "execfile('$(PV_FILE)'); print __VERSION__") ] ; then \
+       @[ "$(VERSION)" = $$(python -c "execfile('$(PV_FILE)'); print __VERSION__") ] || \
+               (echo "No." && \
+                echo "Please edit version and $(PV_FILE) to have consistent versions." && false)
+       @echo "Good."
+
+.PHONY: verify-version-manpage
+verify-version-manpage: verify-version-components
+       @echo -n "Checking that manual page version is $(VERSION)..."
+       @[ "$(VERSION)" = $$(sed -n '/^[.]TH NOTMUCH 1/{s/.*"Notmuch //;s/".*//p;}' notmuch.1) ] || \
                (echo "No." && \
-                echo "Please edit version and $(PV_FILE) to have consistent versions." && false) \
-        fi
+                echo "Please edit version and notmuch.1 to have consistent versions." && false)
        @echo "Good."
 
 .PHONY: verify-version-components
 verify-version-components:
        @echo -n "Checking that $(VERSION) consists only of digits and periods..."
-       @if echo $(VERSION) | grep -q -v -x '[0-9.]*'; then \
+       @echo $(VERSION) | grep -q -x '^[0-9.]*$$' || \
                (echo "No." && \
-                echo "Please follow the instructions in RELEASING to choose a version" && false) \
-        else :; fi
+                echo "Please follow the instructions in RELEASING to choose a version" && false)
        @echo "Good."
 
 .PHONY: verify-newer
index e3e0cefe69e3dc3f640c1d3471d90f802209d553..88dab04eefd5dcc9ca78f9b76ee71ecf96215d7e 100644 (file)
--- a/RELEASING
+++ b/RELEASING
@@ -62,11 +62,11 @@ repository. From here, there are just a few steps to release:
        be "1.0.1" and a subsequent bug-fix release would be "1.0.2"
        etc.
 
-       Update bindings/python/notmuch/version.py to match version.
+       When you are happy with the file 'version', run
 
-       Update the version in notmuch.1 to match version.
+            make update-versions
 
-       XXX: Probably these last two steps should be (semi-)automated.
+       to propagate the version to the other places needed.
 
        Commit these changes.
 
index 3252f32cf4c00bc0b6a29fb377a0c2c459ba2ba1..f6f415edf46b850e4b8da2e868471c125cfd4940 100644 (file)
@@ -16,7 +16,7 @@ Build-Depends:
  python-all (>= 2.6.6-3~),
  emacs23-nox | emacs23 (>=23~) | emacs23-lucid (>=23~),
  gdb,
- dtach
+ dtach (>= 0.8)
 Standards-Version: 3.9.2
 Homepage: http://notmuchmail.org/
 Vcs-Git: git://notmuchmail.org/git/notmuch
index 1a76c30abed9d79eafe1da8c30acc9ad5bf93561..0582cae76f492fc1ab349ab4458e889b2ea576ae 100644 (file)
   :type 'boolean
   :group 'notmuch)
 
+(defun notmuch-sort-saved-searches (alist)
+  "Generate an alphabetically sorted saved searches alist."
+  (sort alist (lambda (a b) (string< (car a) (car b)))))
+
+(defcustom notmuch-saved-search-sort-function nil
+  "Function used to sort the saved searches for the notmuch-hello view.
+
+This variable controls how saved searches should be sorted. No
+sorting (nil) displays the saved searches in the order they are
+stored in `notmuch-saved-searches'. Sort alphabetically sorts the
+saved searches in alphabetical order. Custom sort function should
+be a function or a lambda expression that takes the saved
+searches alist as a parameter, and returns a new saved searches
+alist to be used."
+  :type '(choice (const :tag "No sorting" nil)
+                (const :tag "Sort alphabetically" notmuch-sort-saved-searches)
+                (function :tag "Custom sort function"
+                          :value notmuch-sort-saved-searches))
+  :group 'notmuch)
+
 (defvar notmuch-hello-indent 4
   "How much to indent non-headers.")
 
@@ -168,8 +188,8 @@ Typically \",\" in the US and UK and \".\" in Europe."
                collect elem))
     ;; Add the new one.
     (customize-save-variable 'notmuch-saved-searches
-                            (push (cons name search)
-                                  notmuch-saved-searches))
+                            (add-to-list 'notmuch-saved-searches
+                                         (cons name search) t))
     (message "Saved '%s' as '%s'." search name)
     (notmuch-hello-update)))
 
@@ -440,6 +460,10 @@ Complete list of currently available key bindings:
             (widest (max saved-widest alltags-widest)))
 
        (when saved-alist
+         ;; Sort saved searches if required.
+         (when notmuch-saved-search-sort-function
+           (setq saved-alist
+                 (funcall notmuch-saved-search-sort-function saved-alist)))
          (widget-insert "\nSaved searches: ")
          (widget-create 'push-button
                         :notify (lambda (&rest ignore)
index d5c95d802b701144149c9cc61fa11be0e0791a02..d7fbbca9471b374b8ce26b22bd15084a2a8a690d 100644 (file)
@@ -91,6 +91,16 @@ any given message."
   :group 'notmuch
   :type 'boolean)
 
+(defcustom notmuch-indent-messages-width 1
+  "Width of message indentation in threads.
+
+Messages are shown indented according to their depth in a thread.
+This variable determines the width of this indentation measured
+in number of blanks.  Defaults to `1', choose `0' to disable
+indentation."
+  :group 'notmuch
+  :type 'integer)
+
 (defcustom notmuch-show-indent-multipart nil
   "Should the sub-parts of a multipart/* part be indented?"
   ;; dme: Not sure which is a good default.
@@ -238,7 +248,7 @@ unchanged ADDRESS if parsing fails."
   "Insert a notmuch style headerline based on HEADERS for a
 message at DEPTH in the current thread."
   (let ((start (point)))
-    (insert (notmuch-show-spaces-n depth)
+    (insert (notmuch-show-spaces-n (* notmuch-indent-messages-width depth))
            (notmuch-show-clean-address (plist-get headers :From))
            " ("
            date
@@ -739,7 +749,7 @@ current buffer, if possible."
     (setq content-end (point-marker))
 
     ;; Indent according to the depth in the thread.
-    (indent-rigidly content-start content-end depth)
+    (indent-rigidly content-start content-end (* notmuch-indent-messages-width depth))
 
     (setq message-end (point-max-marker))
 
@@ -843,6 +853,8 @@ buffer."
         (inhibit-read-only t))
     (switch-to-buffer buffer)
     (notmuch-show-mode)
+    ;; Don't track undo information for this buffer
+    (set 'buffer-undo-list t)
 
     (setq notmuch-show-thread-id thread-id)
     (setq notmuch-show-parent-buffer parent-buffer)
@@ -1135,26 +1147,18 @@ All currently available key bindings:
 
 ;; Commands typically bound to keys.
 
-(defun notmuch-show-advance-and-archive ()
-  "Advance through thread and archive.
-
-This command is intended to be one of the simplest ways to
-process a thread of email. It does the following:
+(defun notmuch-show-advance ()
+  "Advance through thread.
 
 If the current message in the thread is not yet fully visible,
 scroll by a near screenful to read more of the message.
 
 Otherwise, (the end of the current message is already within the
-current window), advance to the next open message.
-
-Finally, if there is no further message to advance to, and this
-last message is already read, then archive the entire current
-thread, (remove the \"inbox\" tag from each message). Also kill
-this buffer, and display the next thread from the search from
-which this thread was originally shown."
+current window), advance to the next open message."
   (interactive)
   (let* ((end-of-this-message (notmuch-show-message-bottom))
-        (visible-end-of-this-message (1- end-of-this-message)))
+        (visible-end-of-this-message (1- end-of-this-message))
+        (ret nil))
     (while (invisible-p visible-end-of-this-message)
       (setq visible-end-of-this-message
            (previous-single-char-property-change visible-end-of-this-message
@@ -1173,8 +1177,24 @@ which this thread was originally shown."
       (notmuch-show-next-open-message))
 
      (t
-      ;; This is the last message - archive the thread.
-      (notmuch-show-archive-thread)))))
+      ;; This is the last message - change the return value
+      (setq ret t)))
+    ret))
+
+(defun notmuch-show-advance-and-archive ()
+  "Advance through thread and archive.
+
+This command is intended to be one of the simplest ways to
+process a thread of email. It works exactly like
+notmuch-show-advance, in that it scrolls through messages in a
+show buffer, except that when it gets to the end of the buffer it
+archives the entire current thread, (remove the \"inbox\" tag
+from each message), kills the buffer, and displays the next
+thread from the search from which this thread was originally
+shown."
+  (interactive)
+  (if (notmuch-show-advance)
+      (notmuch-show-archive-thread)))
 
 (defun notmuch-show-rewind ()
   "Backup through the thread, (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).
index c1827cc2691f66cb0f566668fede9116bfb62776..f15a75b1bd30aa25a55b0b9a65e3833c0331045f 100644 (file)
@@ -805,12 +805,12 @@ non-authors is found, assume that all of the authors match."
                      (goto-char (point-max))
                      (if (/= (match-beginning 1) line)
                          (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))
-                     (let ((beg (point-marker)))
+                     (let ((beg (point)))
                        (notmuch-search-show-result date count authors subject tags)
-                       (notmuch-search-color-line beg (point-marker) tag-list)
-                       (put-text-property beg (point-marker) 'notmuch-search-thread-id thread-id)
-                       (put-text-property beg (point-marker) 'notmuch-search-authors authors)
-                       (put-text-property beg (point-marker) 'notmuch-search-subject subject)
+                       (notmuch-search-color-line beg (point) tag-list)
+                       (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
+                       (put-text-property beg (point) 'notmuch-search-authors authors)
+                       (put-text-property beg (point) 'notmuch-search-subject subject)
                        (if (string= thread-id notmuch-search-target-thread)
                            (progn
                              (set 'found-target beg)
@@ -920,6 +920,8 @@ The optional parameters are used as follows:
   (let ((buffer (get-buffer-create (notmuch-search-buffer-title query))))
     (switch-to-buffer buffer)
     (notmuch-search-mode)
+    ;; Don't track undo information for this buffer
+    (set 'buffer-undo-list t)
     (set 'notmuch-search-query-string query)
     (set 'notmuch-search-oldest-first oldest-first)
     (set 'notmuch-search-target-thread target-thread)
index 57dca702f116a0bdfdb5e171fb008f6503db7ec7..54c4dea4560b422f39a47cc5304b6de0b1a0484d 100644 (file)
@@ -30,7 +30,7 @@ LIBRARY_SUFFIX = so
 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
-LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME)
+LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) -Wl,--no-undefined
 ifeq ($(LIBDIR_IN_LDCONFIG),1)
 ifeq ($(DESTDIR),)
 LIBRARY_INSTALL_POST_COMMAND=ldconfig
index ca7fbf21f19262d6dd69c0f8cc1429685817fb71..00754254b87bc387420529a66082a3887ec69a4e 100644 (file)
@@ -49,16 +49,16 @@ struct visible _notmuch_message {
 struct maildir_flag_tag {
     char flag;
     const char *tag;
-    bool inverse;
+    notmuch_bool_t inverse;
 };
 
 /* ASCII ordered table of Maildir flags and associated tags */
 static struct maildir_flag_tag flag2tag[] = {
-    { 'D', "draft",   false},
-    { 'F', "flagged", false},
-    { 'P', "passed",  false},
-    { 'R', "replied", false},
-    { 'S', "unread",  true }
+    { 'D', "draft",   FALSE},
+    { 'F', "flagged", FALSE},
+    { 'P', "passed",  FALSE},
+    { 'R', "replied", FALSE},
+    { 'S', "unread",  TRUE }
 };
 
 /* We end up having to call the destructor explicitly because we had
@@ -1217,8 +1217,6 @@ _new_maildir_filename (void *ctx,
     if (info == NULL) {
        info = filename + strlen(filename);
     } else {
-       flags = info + 3;
-
        /* Loop through existing flags in filename. */
        for (flags = info + 3, last_flag = 0;
             *flags;
index 8eb0433098b20958e42d6831e5bcc4e3e6e5af6d..9b3308a1bbb511840818396a69b5d55125805e0b 100644 (file)
@@ -17,4 +17,4 @@ test: all $(dir)/smtp-dummy
 
 check: test
 
-CLEAN := $(CLEAN) $(dir)/smtp-dummy
+CLEAN := $(CLEAN) $(dir)/smtp-dummy $(dir)/smtp-dummy.o
index 38db2baf74d97f0c27878a03fe5ecf207bcb1052..f258d1f95e84082d9e2a2baa976cccb765be015e 100755 (executable)
@@ -51,17 +51,11 @@ test_expect_code 2 'failure to clean up causes the test to fail' '
 
 # Ensure that all tests are being run
 test_begin_subtest 'Ensure that all available tests will be run by notmuch-test'
-eval $(sed -n -e '/^TESTS="$/,/^"$/p' notmuch-test $TEST_DIRECTORY/notmuch-test)
+eval $(sed -n -e '/^TESTS="$/,/^"$/p' $TEST_DIRECTORY/notmuch-test)
 tests_in_suite=$(for i in $TESTS; do echo $i; done | sort)
-available=$(ls -1 $TEST_DIRECTORY/ | \
-    sed -r -e "/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d" \
-          -e "/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d" \
-          -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|symbol-test.cc)/d" \
-          -e "/^(test.expected-output|.*~)/d" \
-          -e "/^(gnupg-secret-key.asc)/d" \
-          -e "/^(gnupg-secret-key.NOTE)/d" \
-          -e "/^(atomicity.gdb)/d" \
-          | sort)
+available=$(find "$TEST_DIRECTORY" -maxdepth 1 -type f -executable -printf '%f\n' | \
+    sed -r -e "/^(aggregate-results.sh|notmuch-test|smtp-dummy|test-verbose)$/d" | \
+    sort)
 test_expect_equal "$tests_in_suite" "$available"
 
 EXPECTED=$TEST_DIRECTORY/test.expected-output
index 75a0a7442f4b46921afa698f1bde9732e8482895..198c27b07c10abb2fbaf71b0bdb621745060480d 100755 (executable)
@@ -50,6 +50,27 @@ test_emacs "(notmuch-show \"$maildir_storage_thread\")
            (test-output)"
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
 
+test_begin_subtest "Basic notmuch-show view in emacs default indentation"
+maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
+test_emacs "(let ((notmuch-indent-messages-width 1))
+             (notmuch-show \"$maildir_storage_thread\")
+             (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
+
+test_begin_subtest "Basic notmuch-show view in emacs without indentation"
+maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
+test_emacs "(let ((notmuch-indent-messages-width 0))
+             (notmuch-show \"$maildir_storage_thread\")
+             (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-without-indentation
+
+test_begin_subtest "Basic notmuch-show view in emacs with fourfold indentation"
+maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
+test_emacs "(let ((notmuch-indent-messages-width 4))
+             (notmuch-show \"$maildir_storage_thread\")
+             (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation
+
 test_begin_subtest "notmuch-show for message with invalid From"
 add_message "[subject]=\"message-with-invalid-from\"" \
            "[from]=\"\\\"Invalid \\\" From\\\" <test_suite@notmuchmail.org>\""
@@ -369,8 +390,18 @@ test_emacs '(notmuch-show "id:\"bought\"")
           (rotate-yank-pointer 1))
         (reverse-region (point-min) (point-max))
            (test-output)'
-sed -i -e 's/^.*tmp.emacs\/mail.*$/FILENAME/' OUTPUT
-test_expect_equal_file OUTPUT $EXPECTED/emacs-stashing
+cat <<EOF >EXPECTED
+Sat, 01 Jan 2000 12:00:00 -0000
+Some One <someone@somewhere.org>
+Some One Else <notsomeone@somewhere.org>
+Notmuch <notmuch@notmuchmail.org>
+Stash my stashables
+id:"bought"
+bought
+inbox,stashtest
+${gen_msg_filename}
+EOF
+test_expect_equal_file OUTPUT EXPECTED
 
 test_begin_subtest "Stashing in notmuch-search"
 test_emacs '(notmuch-search "id:\"bought\"")
diff --git a/test/emacs.expected-output/emacs-stashing b/test/emacs.expected-output/emacs-stashing
deleted file mode 100644 (file)
index 4923594..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Sat, 01 Jan 2000 12:00:00 -0000
-Some One <someone@somewhere.org>
-Some One Else <notsomeone@somewhere.org>
-Notmuch <notmuch@notmuchmail.org>
-Stash my stashables
-id:"bought"
-bought
-inbox,stashtest
-FILENAME
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
new file mode 100644 (file)
index 0000000..41e2aaa
--- /dev/null
@@ -0,0 +1,215 @@
+Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 14:00:54 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+I saw the LWN article and decided to take a look at notmuch.  I'm
+currently using mutt and mairix to index and read a collection of
+Maildir mail folders (around 40,000 messages total).
+
+notmuch indexed the messages without complaint, but my attempt at
+searching bombed out. Running, for example:
+
+  notmuch search storage
+
+Resulted in 4604 lines of errors along the lines of:
+
+  Error opening
+  /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
+  Too many open files
+
+I'm curious if this is expected behavior (i.e., notmuch does not work
+with Maildir) or if something else is going on.
+
+Cheers,
+
+[ 5-line signature. Click/Enter to show. ]
+-- 
+Lars Kellogg-Stedman <lars@seas.harvard.edu>
+Senior Technologist, Computing and Information Technology
+Harvard University School of Engineering and Applied Sciences
+
+[ application/pgp-signature ]
+[ text/plain ]
+[ 4-line signature. Click/Enter to show. ]
+_______________________________________________
+notmuch mailing list
+notmuch@notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+    Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread)
+    Subject: Re: [notmuch] Working with Maildir storage?
+    To: notmuch@notmuchmail.org
+    Date: Wed, 18 Nov 2009 01:02:38 +0600
+
+    [ multipart/mixed ]
+    [ multipart/signed ]
+    [ text/plain ]
+
+    Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did gyre and gimble:
+
+     LK> Resulted in 4604 lines of errors along the lines of:
+
+     LK>   Error opening
+     LK>   /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
+     LK>   Too many open files
+
+    See the patch just posted here.
+
+    [ 2-line signature. Click/Enter to show. ]
+    -- 
+    http://fossarchy.blogspot.com/
+    [ application/pgp-signature ]
+    [ text/plain ]
+    [ 4-line signature. Click/Enter to show. ]
+    _______________________________________________
+    notmuch mailing list
+    notmuch@notmuchmail.org
+    http://notmuchmail.org/mailman/listinfo/notmuch
+        Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed unread)
+       Subject: Re: [notmuch] Working with Maildir storage?
+       To: Mikhail Gusarov <dottedmag@dottedmag.net>
+       Cc: notmuch@notmuchmail.org
+       Date: Tue, 17 Nov 2009 15:33:01 -0500
+
+       [ multipart/mixed ]
+       [ multipart/signed ]
+       [ text/plain ]
+       > See the patch just posted here.
+
+       Is the list archived anywhere?  The obvious archives
+       (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I
+       think I subscribed too late to get the patch (I only just saw the
+       discussion about it).
+
+       It doesn't look like the patch is in git yet.
+
+       -- Lars
+
+       [ 5-line signature. Click/Enter to show. ]
+       -- 
+       Lars Kellogg-Stedman <lars@seas.harvard.edu>
+       Senior Technologist, Computing and Information Technology
+       Harvard University School of Engineering and Applied Sciences
+
+       [ application/pgp-signature ]
+       [ text/plain ]
+       [ 4-line signature. Click/Enter to show. ]
+       _______________________________________________
+       notmuch mailing list
+       notmuch@notmuchmail.org
+       http://notmuchmail.org/mailman/listinfo/notmuch
+            Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread)
+           Subject: [notmuch] Working with Maildir storage?
+           To: notmuch@notmuchmail.org
+           Date: Wed, 18 Nov 2009 02:50:48 +0600
+
+
+           Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu did gyre and gimble:
+
+            LK> Is the list archived anywhere?  The obvious archives
+            LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I
+            LK> think I subscribed too late to get the patch (I only just saw the
+            LK> discussion about it).
+
+            LK> It doesn't look like the patch is in git yet.
+
+           Just has been pushed
+
+           [ 10-line signature. Click/Enter to show. ]
+           -- 
+           http://fossarchy.blogspot.com/
+           -------------- next part --------------
+           A non-text attachment was scrubbed...
+           Name: not available
+           Type: application/pgp-signature
+           Size: 834 bytes
+           Desc: not available
+           URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091118/0e33d964/attachment.pgp>
+
+            Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread)
+           Subject: [notmuch] Working with Maildir storage?
+           To: notmuch@notmuchmail.org
+           Date: Tue, 17 Nov 2009 13:24:13 -0800
+
+           On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at seas.harvard.edu> wrote:
+           > > See the patch just posted here.
+
+           I've also pushed a slightly more complicated (and complete) fix to my
+           private notmuch repository
+
+           git://keithp.com/git/notmuch
+
+           > Is the list archived anywhere?
+
+           Oops. Looks like Carl's mail server is broken. He's traveling to
+           Barcelona today and so it won't get fixed for a while.
+
+           Thanks to everyone for trying out notmuch!
+
+           -keith
+
+                Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread)
+               Subject: Re: [notmuch] Working with Maildir storage?
+               To: Keith Packard <keithp@keithp.com>
+               Cc: notmuch@notmuchmail.org
+               Date: Tue, 17 Nov 2009 19:50:40 -0500
+
+               [ multipart/mixed ]
+               [ multipart/signed ]
+               [ text/plain ]
+               > I've also pushed a slightly more complicated (and complete) fix to my
+               > private notmuch repository
+
+               The version of lib/messages.cc in your repo doesn't build because it's
+               missing "#include <stdint.h>" (for the uint32_t on line 466).
+
+               [ 5-line signature. Click/Enter to show. ]
+               -- 
+               Lars Kellogg-Stedman <lars@seas.harvard.edu>
+               Senior Technologist, Computing and Information Technology
+               Harvard University School of Engineering and Applied Sciences
+
+               [ application/pgp-signature ]
+               [ text/plain ]
+               [ 4-line signature. Click/Enter to show. ]
+               _______________________________________________
+               notmuch mailing list
+               notmuch@notmuchmail.org
+               http://notmuchmail.org/mailman/listinfo/notmuch
+    Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread)
+    Subject: [notmuch] Working with Maildir storage?
+    To: notmuch@notmuchmail.org
+    Date: Wed, 18 Nov 2009 02:08:10 -0800
+
+    On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at seas.harvard.edu> wrote:
+    > I saw the LWN article and decided to take a look at notmuch.  I'm
+    > currently using mutt and mairix to index and read a collection of
+    > Maildir mail folders (around 40,000 messages total).
+
+    Welcome, Lars!
+
+    I hadn't even seen that Keith's blog post had been picked up by lwn.net.
+    That's very interesting. So, thanks for coming and trying out notmuch.
+
+    >   Error opening
+    >   /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
+    >   Too many open files
+
+    Sadly, the lwn article coincided with me having just introduced this
+    bug, and then getting on a Trans-Atlantic flight. So I fixed the bug
+    fairly quickly, but there was quite a bit of latency before I could push
+    the fix out. It should be fixed now.
+
+    > I'm curious if this is expected behavior (i.e., notmuch does not work
+    > with Maildir) or if something else is going on.
+
+    Notmuch works just fine with maildir---it's one of the things that it
+    likes the best.
+
+    Happy hacking,
+
+    -Carl
+
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
new file mode 100644 (file)
index 0000000..fa2108e
--- /dev/null
@@ -0,0 +1,215 @@
+Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 14:00:54 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+I saw the LWN article and decided to take a look at notmuch.  I'm
+currently using mutt and mairix to index and read a collection of
+Maildir mail folders (around 40,000 messages total).
+
+notmuch indexed the messages without complaint, but my attempt at
+searching bombed out. Running, for example:
+
+  notmuch search storage
+
+Resulted in 4604 lines of errors along the lines of:
+
+  Error opening
+  /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
+  Too many open files
+
+I'm curious if this is expected behavior (i.e., notmuch does not work
+with Maildir) or if something else is going on.
+
+Cheers,
+
+[ 5-line signature. Click/Enter to show. ]
+-- 
+Lars Kellogg-Stedman <lars@seas.harvard.edu>
+Senior Technologist, Computing and Information Technology
+Harvard University School of Engineering and Applied Sciences
+
+[ application/pgp-signature ]
+[ text/plain ]
+[ 4-line signature. Click/Enter to show. ]
+_______________________________________________
+notmuch mailing list
+notmuch@notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: notmuch@notmuchmail.org
+Date: Wed, 18 Nov 2009 01:02:38 +0600
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+
+Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did gyre and gimble:
+
+ LK> Resulted in 4604 lines of errors along the lines of:
+
+ LK>   Error opening
+ LK>   /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
+ LK>   Too many open files
+
+See the patch just posted here.
+
+[ 2-line signature. Click/Enter to show. ]
+-- 
+http://fossarchy.blogspot.com/
+[ application/pgp-signature ]
+[ text/plain ]
+[ 4-line signature. Click/Enter to show. ]
+_______________________________________________
+notmuch mailing list
+notmuch@notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: Mikhail Gusarov <dottedmag@dottedmag.net>
+Cc: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 15:33:01 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+> See the patch just posted here.
+
+Is the list archived anywhere?  The obvious archives
+(http://notmuchmail.org/pipermail/notmuch/) aren't available, and I
+think I subscribed too late to get the patch (I only just saw the
+discussion about it).
+
+It doesn't look like the patch is in git yet.
+
+-- Lars
+
+[ 5-line signature. Click/Enter to show. ]
+-- 
+Lars Kellogg-Stedman <lars@seas.harvard.edu>
+Senior Technologist, Computing and Information Technology
+Harvard University School of Engineering and Applied Sciences
+
+[ application/pgp-signature ]
+[ text/plain ]
+[ 4-line signature. Click/Enter to show. ]
+_______________________________________________
+notmuch mailing list
+notmuch@notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch@notmuchmail.org
+Date: Wed, 18 Nov 2009 02:50:48 +0600
+
+
+Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu did gyre and gimble:
+
+ LK> Is the list archived anywhere?  The obvious archives
+ LK> (http://notmuchmail.org/pipermail/notmuch/) aren't available, and I
+ LK> think I subscribed too late to get the patch (I only just saw the
+ LK> discussion about it).
+
+ LK> It doesn't look like the patch is in git yet.
+
+Just has been pushed
+
+[ 10-line signature. Click/Enter to show. ]
+-- 
+http://fossarchy.blogspot.com/
+-------------- next part --------------
+A non-text attachment was scrubbed...
+Name: not available
+Type: application/pgp-signature
+Size: 834 bytes
+Desc: not available
+URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091118/0e33d964/attachment.pgp>
+
+Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 13:24:13 -0800
+
+On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at seas.harvard.edu> wrote:
+> > See the patch just posted here.
+
+I've also pushed a slightly more complicated (and complete) fix to my
+private notmuch repository
+
+git://keithp.com/git/notmuch
+
+> Is the list archived anywhere?
+
+Oops. Looks like Carl's mail server is broken. He's traveling to
+Barcelona today and so it won't get fixed for a while.
+
+Thanks to everyone for trying out notmuch!
+
+-keith
+
+Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-18) (inbox signed unread)
+Subject: Re: [notmuch] Working with Maildir storage?
+To: Keith Packard <keithp@keithp.com>
+Cc: notmuch@notmuchmail.org
+Date: Tue, 17 Nov 2009 19:50:40 -0500
+
+[ multipart/mixed ]
+[ multipart/signed ]
+[ text/plain ]
+> I've also pushed a slightly more complicated (and complete) fix to my
+> private notmuch repository
+
+The version of lib/messages.cc in your repo doesn't build because it's
+missing "#include <stdint.h>" (for the uint32_t on line 466).
+
+[ 5-line signature. Click/Enter to show. ]
+-- 
+Lars Kellogg-Stedman <lars@seas.harvard.edu>
+Senior Technologist, Computing and Information Technology
+Harvard University School of Engineering and Applied Sciences
+
+[ application/pgp-signature ]
+[ text/plain ]
+[ 4-line signature. Click/Enter to show. ]
+_______________________________________________
+notmuch mailing list
+notmuch@notmuchmail.org
+http://notmuchmail.org/mailman/listinfo/notmuch
+Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread)
+Subject: [notmuch] Working with Maildir storage?
+To: notmuch@notmuchmail.org
+Date: Wed, 18 Nov 2009 02:08:10 -0800
+
+On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at seas.harvard.edu> wrote:
+> I saw the LWN article and decided to take a look at notmuch.  I'm
+> currently using mutt and mairix to index and read a collection of
+> Maildir mail folders (around 40,000 messages total).
+
+Welcome, Lars!
+
+I hadn't even seen that Keith's blog post had been picked up by lwn.net.
+That's very interesting. So, thanks for coming and trying out notmuch.
+
+>   Error opening
+>   /home/lars/Mail/read-messages.2008/cur/1246413773.24928_27334.hostname,U=3026:2,S:
+>   Too many open files
+
+Sadly, the lwn article coincided with me having just introduced this
+bug, and then getting on a Trans-Atlantic flight. So I fixed the bug
+fairly quickly, but there was quite a bit of latency before I could push
+the fix out. It should be fixed now.
+
+> I'm curious if this is expected behavior (i.e., notmuch does not work
+> with Maildir) or if something else is going on.
+
+Notmuch works just fine with maildir---it's one of the things that it
+likes the best.
+
+Happy hacking,
+
+-Carl
+
index 5aced5cef9fdb98cd1c213486de1e0f008371c90..ba28ff3908e4d415f0bbbdf4ea11f6b5d99f6570 100755 (executable)
@@ -61,10 +61,13 @@ else
     TEST_TIMEOUT_CMD=""
 fi
 
+trap 'e=$?; kill $!; exit $e' HUP INT TERM
 # Run the tests
 for test in $TESTS; do
-    $TEST_TIMEOUT_CMD ./$test "$@"
+    $TEST_TIMEOUT_CMD ./$test "$@" &
+    wait $!
 done
+trap - HUP INT TERM
 
 # Report results
 ./aggregate-results.sh test-results/*
index b7e265a80da79fd66a69498e95b8cea4168a0071..99d3a3bf0460ee55009c72dcba1814cc59995ff8 100755 (executable)
--- a/test/raw
+++ b/test/raw
@@ -1,4 +1,4 @@
-#!/usr//bin/env bash
+#!/usr/bin/env bash
 
 test_description='notmuch show --format=raw'
 . ./test-lib.sh
index 1de06eae41032f0c0d5b05c840f3942cfff043da..1548ca400a544f3ddb325ce02826de1531cf602d 100644 (file)
@@ -1,17 +1,17 @@
 #include <stdio.h>
 #include <xapian.h>
 #include <notmuch.h>
-main (int argc, char **argv){
 
-    notmuch_database_t *notmuch
-      = notmuch_database_open ("fakedb",
-                                    NOTMUCH_DATABASE_MODE_READ_ONLY);
 
-  try{
-    (void)new Xapian::WritableDatabase ("./nonexistant",                                       Xapian::DB_OPEN);
+int main() {
+  (void) notmuch_database_open("fakedb", NOTMUCH_DATABASE_MODE_READ_ONLY);
+
+  try {
+    (void) new Xapian::WritableDatabase("./nonexistant", Xapian::DB_OPEN);
   } catch (const Xapian::Error &error) {
-    printf("caught %s\n",error.get_msg().c_str());
+    printf("caught %s\n", error.get_msg().c_str());
     return 0;
   }
+
   return 1;
 }
old mode 100755 (executable)
new mode 100644 (file)
index cf309f9..93867b0
@@ -398,6 +398,8 @@ emacs_deliver_message ()
           (insert \"${body}\")
           $@
           (message-send-and-exit))"
+    # opportunistically quit smtp-dummy in case above fails.
+    { echo QUIT > /dev/tcp/localhost/25025; } 2>/dev/null
     wait ${smtp_dummy_pid}
     notmuch new >/dev/null
 }
index 2ff42b3d85f2e644b45fd8f51c0ada496395027c..03408995b4fd35c44d98f46313f6629e31ae7184 100644 (file)
@@ -9,3 +9,5 @@ libutil_modules := $(libutil_c_srcs:.c=.o)
 
 $(dir)/libutil.a: $(libutil_modules)
        $(call quiet,AR) rcs $@ $^
+
+CLEAN := $(CLEAN) $(dir)/xutil.o $(dir)/error_util.o $(dir)/libutil.a