From: David Bremner Date: Wed, 23 Nov 2011 20:02:47 +0000 (-0400) Subject: Merge branch 'release' X-Git-Tag: 0.11_rc1~113 X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b5803e918dbf772536de2bd1017e8888c01bd5a9;hp=9fbc912cc98cfd3977a5ce419ae88948abf8158f;p=obsolete%2Fnotmuch-old Merge branch 'release' --- diff --git a/Makefile.local b/Makefile.local index 8b42136a..775f3935 100644 --- a/Makefile.local +++ b/Makefile.local @@ -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). # diff --git a/RELEASING b/RELEASING index e3e0cefe..88dab04e 100644 --- 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. diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 1a76c30a..0582cae7 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -42,6 +42,26 @@ :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) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index d5c95d80..a7f32631 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1135,26 +1135,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 +1165,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]). diff --git a/lib/Makefile.local b/lib/Makefile.local index 57dca702..54c4dea4 100644 --- a/lib/Makefile.local +++ b/lib/Makefile.local @@ -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 diff --git a/lib/message.cc b/lib/message.cc index ca7fbf21..00754254 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -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; diff --git a/test/emacs b/test/emacs index 75a0a744..3bf2e29a 100755 --- a/test/emacs +++ b/test/emacs @@ -369,8 +369,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 <EXPECTED +Sat, 01 Jan 2000 12:00:00 -0000 +Some One +Some One Else +Notmuch +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 index 49235947..00000000 --- a/test/emacs.expected-output/emacs-stashing +++ /dev/null @@ -1,9 +0,0 @@ -Sat, 01 Jan 2000 12:00:00 -0000 -Some One -Some One Else -Notmuch -Stash my stashables -id:"bought" -bought -inbox,stashtest -FILENAME diff --git a/test/notmuch-test b/test/notmuch-test index adfd589f..6c65ed7a 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -60,10 +60,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/* diff --git a/test/raw b/test/raw index b7e265a8..99d3a3bf 100755 --- 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 diff --git a/test/test-lib.sh b/test/test-lib.sh index cf309f94..93867b03 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -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 }