aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile.local9
-rw-r--r--bindings/ruby/defs.h3
-rw-r--r--bindings/ruby/init.c1
-rw-r--r--bindings/ruby/query.c19
-rw-r--r--doc/.gitignore1
-rw-r--r--emacs/notmuch-show.el40
-rw-r--r--emacs/notmuch.el10
-rw-r--r--performance-test/Makefile.local3
-rw-r--r--test/.gitignore12
-rw-r--r--test/test-databases/Makefile.local2
10 files changed, 73 insertions, 27 deletions
diff --git a/Makefile.local b/Makefile.local
index 4f8f4640..3377d55e 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -21,7 +21,7 @@ endif
VERSION:=$(shell cat ${srcdir}/version)
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/-/~/)
+VERSION:=$(shell git describe --abbrev=7 --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
# Write the file 'version.stamp' in case its contents differ from $(VERSION)
FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)
ifneq ($(FILE_VERSION),$(VERSION))
@@ -262,6 +262,10 @@ clean:
distclean: clean
rm -rf $(DISTCLEAN)
+.PHONY: dataclean
+dataclean: distclean
+ rm -rf $(DATACLEAN)
+
notmuch_client_srcs = \
command-line-arguments.c\
debugger.c \
@@ -331,7 +335,8 @@ install-desktop:
desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" notmuch.desktop
SRCS := $(SRCS) $(notmuch_client_srcs)
-CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) version.stamp
+CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules)
+CLEAN := $(CLEAN) version.stamp notmuch-*.tar.gz.tmp
DISTCLEAN := $(DISTCLEAN) .first-build-message Makefile.config
diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h
index 5b44585a..f4901a04 100644
--- a/bindings/ruby/defs.h
+++ b/bindings/ruby/defs.h
@@ -231,6 +231,9 @@ notmuch_rb_query_search_messages (VALUE self);
VALUE
notmuch_rb_query_count_messages (VALUE self);
+VALUE
+notmuch_rb_query_count_threads (VALUE self);
+
/* threads.c */
VALUE
notmuch_rb_threads_destroy (VALUE self);
diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c
index 663271d4..ab3f22df 100644
--- a/bindings/ruby/init.c
+++ b/bindings/ruby/init.c
@@ -271,6 +271,7 @@ Init_notmuch (void)
rb_define_method (notmuch_rb_cQuery, "search_threads", notmuch_rb_query_search_threads, 0); /* in query.c */
rb_define_method (notmuch_rb_cQuery, "search_messages", notmuch_rb_query_search_messages, 0); /* in query.c */
rb_define_method (notmuch_rb_cQuery, "count_messages", notmuch_rb_query_count_messages, 0); /* in query.c */
+ rb_define_method (notmuch_rb_cQuery, "count_threads", notmuch_rb_query_count_threads, 0); /* in query.c */
/*
* Document-class: Notmuch::Threads
diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c
index 1658edee..a7dacba3 100644
--- a/bindings/ruby/query.c
+++ b/bindings/ruby/query.c
@@ -182,3 +182,22 @@ notmuch_rb_query_count_messages (VALUE self)
*/
return UINT2NUM(notmuch_query_count_messages(query));
}
+
+/*
+ * call-seq: QUERY.count_threads => Fixnum
+ *
+ * Return an estimate of the number of threads matching a search
+ */
+VALUE
+notmuch_rb_query_count_threads (VALUE self)
+{
+ notmuch_query_t *query;
+
+ Data_Get_Notmuch_Query (self, query);
+
+ /* Xapian exceptions are not handled properly.
+ * (function may return 0 after printing a message)
+ * Thus there is nothing we can do here...
+ */
+ return UINT2NUM(notmuch_query_count_threads(query));
+}
diff --git a/doc/.gitignore b/doc/.gitignore
index a60fb31e..f0cbb9c2 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -1,2 +1,3 @@
+*.pyc
docdeps.mk
_build
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index df10d4ba..10fc8721 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -180,10 +180,21 @@ each attachment handler is logged in buffers with names beginning
)
"List of Mailing List Archives to use when stashing links.
-These URIs are concatenated with the current message's
-Message-Id in `notmuch-show-stash-mlarchive-link'."
+This list is used for generating a Mailing List Archive reference
+URI with the current message's Message-Id in
+`notmuch-show-stash-mlarchive-link'.
+
+If the cdr of the alist element is not a function, the cdr is
+expected to contain a URI that is concatenated with the current
+message's Message-Id to create a ML archive reference URI.
+
+If the cdr is a function, the function is called with the
+Message-Id as the argument, and the function is expected to
+return the ML archive reference URI."
:type '(alist :key-type (string :tag "Name")
- :value-type (string :tag "URL"))
+ :value-type (choice
+ (string :tag "URL")
+ (function :tag "Function returning the URL")))
:group 'notmuch-show)
(defcustom notmuch-show-stash-mlarchive-link-default "Gmane"
@@ -2055,16 +2066,19 @@ This presumes that the message is available at the selected Mailing List Archive
If optional argument MLA is non-nil, use the provided key instead of prompting
the user (see `notmuch-show-stash-mlarchive-link-alist')."
(interactive)
- (notmuch-common-do-stash
- (concat (cdr (assoc
- (or mla
- (let ((completion-ignore-case t))
- (completing-read
- "Mailing List Archive: "
- notmuch-show-stash-mlarchive-link-alist
- nil t nil nil notmuch-show-stash-mlarchive-link-default)))
- notmuch-show-stash-mlarchive-link-alist))
- (notmuch-show-get-message-id t))))
+ (let ((url (cdr (assoc
+ (or mla
+ (let ((completion-ignore-case t))
+ (completing-read
+ "Mailing List Archive: "
+ notmuch-show-stash-mlarchive-link-alist
+ nil t nil nil
+ notmuch-show-stash-mlarchive-link-default)))
+ notmuch-show-stash-mlarchive-link-alist))))
+ (notmuch-common-do-stash
+ (if (functionp url)
+ (funcall url (notmuch-show-get-message-id t))
+ (concat url (notmuch-show-get-message-id t))))))
(defun notmuch-show-stash-mlarchive-link-and-go (&optional mla)
"Copy an ML Archive URI for the current message to the kill-ring and visit it.
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 1adea9c2..f6bf9c84 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -649,12 +649,12 @@ of the result."
Here is an example of how to color search results based on tags.
(the following text would be placed in your ~/.emacs file):
- (setq notmuch-search-line-faces '((\"deleted\" . (:foreground \"red\"
- :background \"blue\"))
- (\"unread\" . (:foreground \"green\"))))
+ (setq notmuch-search-line-faces '((\"unread\" . (:foreground \"green\"))
+ (\"deleted\" . (:foreground \"red\"
+ :background \"blue\"))))
-The attributes defined for matching tags are merged, with later
-attributes overriding earlier. A message having both \"deleted\"
+The attributes defined for matching tags are merged, with earlier
+attributes overriding later. A message having both \"deleted\"
and \"unread\" tags with the above settings would have a green
foreground and blue background."
:type '(alist :key-type (string) :value-type (custom-face-edit))
diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
index d97e56d9..3469aa3d 100644
--- a/performance-test/Makefile.local
+++ b/performance-test/Makefile.local
@@ -40,4 +40,5 @@ download-corpus:
wget -O ${TXZFILE} ${DEFAULT_URL}
CLEAN := $(CLEAN) $(dir)/tmp.* $(dir)/log.*
-DISTCLEAN := $(dir)/corpus $(dir)/notmuch.cache.*
+DISTCLEAN := $(DISTCLEAN) $(dir)/corpus $(dir)/notmuch.cache.*
+DATACLEAN := $(DATACLEAN) $(TXZFILE)
diff --git a/test/.gitignore b/test/.gitignore
index 97e02487..4081cee6 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -1,9 +1,11 @@
-test-results
-corpus.mail
-smtp-dummy
-symbol-test
arg-test
+corpus.mail
+have-compact
+have-man
hex-xcode
-random-corpus
parse-time
+random-corpus
+smtp-dummy
+symbol-test
+test-results
tmp.*
diff --git a/test/test-databases/Makefile.local b/test/test-databases/Makefile.local
index 0572e784..ff333a1d 100644
--- a/test/test-databases/Makefile.local
+++ b/test/test-databases/Makefile.local
@@ -11,4 +11,4 @@ test_databases := $(dir)/database-v1.tar.xz
download-test-databases: ${test_databases}
-DISTCLEAN := $(DISTCLEAN) ${test_databases}
+DATACLEAN := $(DATACLEAN) ${test_databases}