[PATCH 3/3] build: pass CPPFLAGS to C and C++ compilers

2013-05-25 Thread da...@tethera.net
From: David Bremner 

This is used in particular by hardening flags.
---
 Makefile.local |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index c274f07..644623f 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -39,8 +39,8 @@ GPG_FILE=$(SHA1_FILE).asc
 PV_FILE=bindings/python/notmuch/version.py

 # Smash together user's values with our extra values
-FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) 
$(CONFIGURE_CFLAGS) $(extra_cflags)
-FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) 
$(extra_cflags) $(extra_cxxflags)
+FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(CFLAGS) 
$(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
+FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) 
$(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
 FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch 
$(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS)
 FINAL_NOTMUCH_LINKER = CC
 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
@@ -237,11 +237,11 @@ quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))

 %.o: %.cc $(global_deps)
@mkdir -p .deps/$(@D)
-   $(call quiet,CXX $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ -MD -MP -MF 
.deps/$*.d
+   $(call quiet,CXX $(CPPFLAGS) $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ 
-MD -MP -MF .deps/$*.d

 %.o: %.c $(global_deps)
@mkdir -p .deps/$(@D)
-   $(call quiet,CC $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ -MD -MP -MF 
.deps/$*.d
+   $(call quiet,CC $(CPPFLAGS) $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ -MD 
-MP -MF .deps/$*.d

 .PHONY : clean
 clean:
-- 
1.7.10.4



[PATCH 2/3] configure: grab CPPFLAGS from the environment.

2013-05-25 Thread da...@tethera.net
From: David Bremner 

This is needed in particular for hardening flags.
---
 configure |5 +
 1 file changed, 5 insertions(+)

diff --git a/configure b/configure
index 460fcfc..3ba1ec3 100755
--- a/configure
+++ b/configure
@@ -43,6 +43,7 @@ fi
 CC=${CC:-gcc}
 CXX=${CXX:-g++}
 CFLAGS=${CFLAGS:--O2}
+CPPFLAGS=${CPPFLAGS:-}
 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
 LDFLAGS=${LDFLAGS:-}
 XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}
@@ -91,6 +92,7 @@ First, some common variables can specified via environment 
variables:

CC  The C compiler to use
CFLAGS  Flags to pass to the C compiler
+CPPFLAGS   Flags to pass to the C preprocessor
CXX The C++ compiler to use
CXXFLAGSFlags to pass to the C compiler
LDFLAGS Flags to pass when linking
@@ -615,6 +617,9 @@ EMACS = emacs --quick
 # Default FLAGS for C compiler (can be overridden by user such as "make 
CFLAGS=-g")
 CFLAGS = ${CFLAGS}

+# Default FLAGS for C preprocessor (can be overridden by user such as "make 
CPPFLAGS=-I/usr/local/include")
+CPPFLAGS = ${CPPFLAGS}
+
 # Default FLAGS for C++ compiler (can be overridden by user such as "make 
CXXFLAGS=-g")
 CXXFLAGS = ${CXXFLAGS}

-- 
1.7.10.4



[PATCH 1/3] debian: compile with V=1

2013-05-25 Thread da...@tethera.net
From: David Bremner 

The idea is to allow hardening verification tools (in particular blhc)
to scan the logs. Actually fixing the problem will require modifying
the notmuch configure script to propagate CPPFLAGS.
---
 debian/rules |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 71a5602..4257c5a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,7 +9,7 @@ override_dh_auto_configure:
dh_auto_configure -- --emacslispdir=/usr/share/emacs/site-lisp/notmuch

 override_dh_auto_build:
-   dh_auto_build
+   dh_auto_build -- V=1
dh_auto_build --sourcedirectory bindings/python
cd bindings/python && $(python3_all) setup.py build
cd bindings/ruby && ruby extconf.rb --vendor && make
-- 
1.7.10.4



handle CPPFLAGS in configure and make

2013-05-25 Thread da...@tethera.net
I wanted to enable hardening flags in the debian build (I guess other
distros will want to do the same); I realized this is made more
difficult by the fact that we don't handle CPPFLAGS in our build
system. Well, if it makes us feel any better, CMake had (has?) the
same bug.



[PATCH] emacs: add show view bindings to move to previous/next thread

2013-05-25 Thread Mark Walters
From: Jani Nikula 

We have most of the plumbing in place, add the bindings M-n and M-p.
---
 emacs/notmuch-show.el |   30 +-
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d56154e..2b33007 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -39,6 +39,7 @@

 (declare-function notmuch-call-notmuch-process "notmuch" ( args))
 (declare-function notmuch-search-next-thread "notmuch" nil)
+(declare-function notmuch-search-previous-thread "notmuch" nil)
 (declare-function notmuch-search-show-thread "notmuch" nil)

 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
@@ -1273,6 +1274,8 @@ reset based on the original query."
(define-key map "P" 'notmuch-show-previous-message)
(define-key map "n" 'notmuch-show-next-open-message)
(define-key map "p" 'notmuch-show-previous-open-message)
+   (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
+   (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
(define-key map (kbd "DEL") 'notmuch-show-rewind)
(define-key map " " 'notmuch-show-advance-and-archive)
(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
@@ -1834,16 +1837,33 @@ argument, hide all of the messages."
   (interactive)
   (backward-button 1))

-(defun notmuch-show-next-thread ( show-next)
-  "Move to the next item in the search results, if any."
+(defun notmuch-show-next-thread ( show previous)
+  "Move to the next item in the search results, if any.
+
+If SHOW is non-nil, open the next item in a show
+buffer. Otherwise just highlight the next item in the search
+buffer. If PREVIOUS is non-nil, move to the previous item in the
+search results instead."
   (interactive "P")
   (let ((parent-buffer notmuch-show-parent-buffer))
 (notmuch-kill-this-buffer)
 (when (buffer-live-p parent-buffer)
   (switch-to-buffer parent-buffer)
-  (notmuch-search-next-thread)
-  (if show-next
- (notmuch-search-show-thread)
+  (and (if previous
+  (notmuch-search-previous-thread)
+(notmuch-search-next-thread))
+  show
+  (notmuch-search-show-thread)
+
+(defun notmuch-show-next-thread-show ()
+  "Show the next thread in the search results, if any."
+  (interactive)
+  (notmuch-show-next-thread t))
+
+(defun notmuch-show-previous-thread-show ()
+  "Show the previous thread in the search results, if any."
+  (interactive)
+  (notmuch-show-next-thread t t))

 (defun notmuch-show-archive-thread ( unarchive)
   "Archive each message in thread.
-- 
1.7.9.1



[PATCH 1/2] emacs: add show view bindings to move to previous/next thread

2013-05-25 Thread Jani Nikula
On Sat, 25 May 2013, Mark Walters  wrote:
> Did you want this to not exit back to the search results if you do M-p
> on the first result?  I attach a version below that does exit back (so
> M-p and M-n behave the same.

Oh, that was just pure fail from my part. Sorry about that, Mark, and
thanks so much for fixing it. Your amended version is better.

Thanks,
Jani.


[PATCH 2/2] TODO: keybindings for next/previous thread done

2013-05-25 Thread Jani Nikula
---
 devel/TODO |2 --
 1 file changed, 2 deletions(-)

diff --git a/devel/TODO b/devel/TODO
index f63385d..844555e 100644
--- a/devel/TODO
+++ b/devel/TODO
@@ -34,8 +34,6 @@ current message/thread and make searches not return deleted 
messages
 by default, (unless the user asks explicitly for deleted messages in
 the search query).

-Add keybindings for next/previous thread.
-
 Add support to "mute" a thread (add a "muted" tag and then don't
 display threads in searches by default where any message of the thread
 has the "muted" tag).
-- 
1.7.10.4



[PATCH 1/2] emacs: add show view bindings to move to previous/next thread

2013-05-25 Thread Jani Nikula
We have most of the plumbing in place, add the bindings M-n and M-p.

---

v2: reduce duplication by adding PREVIOUS argument to
notmuch-show-next-thread instead of adding a separate function for
moving to previous thread (Mark)
---
 emacs/notmuch-show.el |   28 
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d56154e..a903395 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -39,6 +39,7 @@

 (declare-function notmuch-call-notmuch-process "notmuch" ( args))
 (declare-function notmuch-search-next-thread "notmuch" nil)
+(declare-function notmuch-search-previous-thread "notmuch" nil)
 (declare-function notmuch-search-show-thread "notmuch" nil)

 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
@@ -1273,6 +1274,8 @@ reset based on the original query."
(define-key map "P" 'notmuch-show-previous-message)
(define-key map "n" 'notmuch-show-next-open-message)
(define-key map "p" 'notmuch-show-previous-open-message)
+   (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
+   (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
(define-key map (kbd "DEL") 'notmuch-show-rewind)
(define-key map " " 'notmuch-show-advance-and-archive)
(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
@@ -1834,17 +1837,34 @@ argument, hide all of the messages."
   (interactive)
   (backward-button 1))

-(defun notmuch-show-next-thread ( show-next)
-  "Move to the next item in the search results, if any."
+(defun notmuch-show-next-thread ( show previous)
+  "Move to the next item in the search results, if any.
+
+If SHOW is non-nil, open the next item in a show
+buffer. Otherwise just highlight the next item in the search
+buffer. If PREVIOUS is non-nil, move to the previous item in the
+search results instead."
   (interactive "P")
   (let ((parent-buffer notmuch-show-parent-buffer))
 (notmuch-kill-this-buffer)
 (when (buffer-live-p parent-buffer)
   (switch-to-buffer parent-buffer)
-  (notmuch-search-next-thread)
-  (if show-next
+  (if previous
+ (notmuch-search-previous-thread)
+   (notmuch-search-next-thread))
+  (if show
  (notmuch-search-show-thread)

+(defun notmuch-show-next-thread-show ()
+  "Show the next thread in the search results, if any."
+  (interactive)
+  (notmuch-show-next-thread t))
+
+(defun notmuch-show-previous-thread-show ()
+  "Show the previous thread in the search results, if any."
+  (interactive)
+  (notmuch-show-next-thread t t))
+
 (defun notmuch-show-archive-thread ( unarchive)
   "Archive each message in thread.

-- 
1.7.10.4



[PATCH 1/2] emacs: add show view bindings to move to previous/next thread

2013-05-25 Thread Mark Walters

Hi

> We have most of the plumbing in place, add the bindings M-n and M-p.
>
> ---
>
> v2: reduce duplication by adding PREVIOUS argument to
> notmuch-show-next-thread instead of adding a separate function for
> moving to previous thread (Mark)
> ---
>  emacs/notmuch-show.el |   28 
>  1 file changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index d56154e..a903395 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -39,6 +39,7 @@
>  
>  (declare-function notmuch-call-notmuch-process "notmuch" ( args))
>  (declare-function notmuch-search-next-thread "notmuch" nil)
> +(declare-function notmuch-search-previous-thread "notmuch" nil)
>  (declare-function notmuch-search-show-thread "notmuch" nil)
>  
>  (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
> @@ -1273,6 +1274,8 @@ reset based on the original query."
>   (define-key map "P" 'notmuch-show-previous-message)
>   (define-key map "n" 'notmuch-show-next-open-message)
>   (define-key map "p" 'notmuch-show-previous-open-message)
> + (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
> + (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
>   (define-key map (kbd "DEL") 'notmuch-show-rewind)
>   (define-key map " " 'notmuch-show-advance-and-archive)
>   (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
> @@ -1834,17 +1837,34 @@ argument, hide all of the messages."
>(interactive)
>(backward-button 1))
>  
> -(defun notmuch-show-next-thread ( show-next)
> -  "Move to the next item in the search results, if any."
> +(defun notmuch-show-next-thread ( show previous)
> +  "Move to the next item in the search results, if any.
> +
> +If SHOW is non-nil, open the next item in a show
> +buffer. Otherwise just highlight the next item in the search
> +buffer. If PREVIOUS is non-nil, move to the previous item in the
> +search results instead."
>(interactive "P")
>(let ((parent-buffer notmuch-show-parent-buffer))
>  (notmuch-kill-this-buffer)
>  (when (buffer-live-p parent-buffer)
>(switch-to-buffer parent-buffer)
> -  (notmuch-search-next-thread)
> -  (if show-next
> +  (if previous
> +   (notmuch-search-previous-thread)
> + (notmuch-search-next-thread))
> +  (if show
> (notmuch-search-show-thread)

Did you want this to not exit back to the search results if you do M-p
on the first result?  I attach a version below that does exit back (so
M-p and M-n behave the same.

Best wishes 

Mark

>From 22f03457a4c1884d35cf3de32f55977b980b7960 Mon Sep 17 00:00:00 2001
From: Jani Nikula 
Date: Sat, 25 May 2013 15:14:25 +0300
Subject: [PATCH 1/2] emacs: add show view bindings to move to previous/next
 thread

We have most of the plumbing in place, add the bindings M-n and M-p.
---
 emacs/notmuch-show.el |   30 +-
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d56154e..2b33007 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -39,6 +39,7 @@

 (declare-function notmuch-call-notmuch-process "notmuch" ( args))
 (declare-function notmuch-search-next-thread "notmuch" nil)
+(declare-function notmuch-search-previous-thread "notmuch" nil)
 (declare-function notmuch-search-show-thread "notmuch" nil)

 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
@@ -1273,6 +1274,8 @@ reset based on the original query."
(define-key map "P" 'notmuch-show-previous-message)
(define-key map "n" 'notmuch-show-next-open-message)
(define-key map "p" 'notmuch-show-previous-open-message)
+   (define-key map (kbd "M-n") 'notmuch-show-next-thread-show)
+   (define-key map (kbd "M-p") 'notmuch-show-previous-thread-show)
(define-key map (kbd "DEL") 'notmuch-show-rewind)
(define-key map " " 'notmuch-show-advance-and-archive)
(define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
@@ -1834,16 +1837,33 @@ argument, hide all of the messages."
   (interactive)
   (backward-button 1))

-(defun notmuch-show-next-thread ( show-next)
-  "Move to the next item in the search results, if any."
+(defun notmuch-show-next-thread ( show previous)
+  "Move to the next item in the search results, if any.
+
+If SHOW is non-nil, open the next item in a show
+buffer. Otherwise just highlight the next item in the search
+buffer. If PREVIOUS is non-nil, move to the previous item in the
+search results instead."
   (interactive "P")
   (let ((parent-buffer notmuch-show-parent-buffer))
 (notmuch-kill-this-buffer)
 (when (buffer-live-p parent-buffer)
   (switch-to-buffer parent-buffer)
-  (notmuch-search-next-thread)
-  (if show-next
- (notmuch-search-show-thread)
+  (and (if previous
+  (notmuch-search-previous-thread)
+

[PATCH v2] build: fix out-of-tree builds

2013-05-25 Thread Jani Nikula
Support for out-of-tree builds was added in
commit 3e4a9d60a9419621b08c647a306843d76c47c2cb
Author: Carl Worth 
Date:   Wed Mar 9 15:02:42 2011 -0800

build: Add support for non-source-directory builds.

and broken in
commit 7beeb8c88a014ecbc53d8241f10683b3c4c16228
Author: David Bremner 
Date:   Sat Nov 17 12:28:15 2012 -0400

test: initial performance testing infrastructure

Fix the build breakage.

Out-of-tree 'make test' has been broken since earlier than the above,
and remains broken, as does out-of-tree perf test, but at least the
build now works.

---

I didn't have the time to dig into the test and perf test breakage.
---
 Makefile|7 ---
 performance-test/Makefile.local |2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 73a8554..0428160 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,10 @@
 # given explicitly on the command line) so mention it first.
 all:

-# List all subdirectories here. Each contains its own Makefile.local
-subdirs := compat completion emacs lib man parse-time-string
-subdirs += performance-test util test
+# List all subdirectories here. Each contains its own Makefile.local.
+# Use of '=', without '+=', seems to be required for out-of-tree
+# builds to work.
+subdirs = compat completion emacs lib man parse-time-string performance-test 
util test

 # We make all targets depend on the Makefiles themselves.
 global_deps = Makefile Makefile.config Makefile.local \
diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
index 73aa963..e47219a 100644
--- a/performance-test/Makefile.local
+++ b/performance-test/Makefile.local
@@ -2,7 +2,7 @@

 dir := performance-test

-include $(dir)/version.sh
+include $(srcdir)/$(dir)/version.sh

 TIME_TEST_SCRIPT := ${dir}/notmuch-time-test
 MEMORY_TEST_SCRIPT := ${dir}/notmuch-memory-test
-- 
1.7.10.4



[PATCH] cli: remove unused argument descriptions

2013-05-25 Thread Jani Nikula
Clean up leftovers from help system rework. These are no longer
needed. They are easy to resurrect and update if a need later arises.
---
 notmuch.c |   13 -
 1 file changed, 13 deletions(-)

diff --git a/notmuch.c b/notmuch.c
index f51a84f..267ce3d 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -28,7 +28,6 @@ typedef struct command {
 const char *name;
 command_function_t function;
 notmuch_bool_t create_config;
-const char *arguments;
 const char *summary;
 } command_t;

@@ -40,40 +39,28 @@ notmuch_command (notmuch_config_t *config, int argc, char 
*argv[]);

 static command_t commands[] = {
 { NULL, notmuch_command, TRUE,
-  NULL,
   "Notmuch main command." },
 { "setup", notmuch_setup_command, TRUE,
-  NULL,
   "Interactively setup notmuch for first use." },
 { "new", notmuch_new_command, FALSE,
-  "[options...]",
   "Find and import new messages to the notmuch database." },
 { "search", notmuch_search_command, FALSE,
-  "[options...]  [...]",
   "Search for messages matching the given search terms." },
 { "show", notmuch_show_command, FALSE,
-  " [...]",
   "Show all messages matching the search terms." },
 { "count", notmuch_count_command, FALSE,
-  "[options...]  [...]",
   "Count messages matching the search terms." },
 { "reply", notmuch_reply_command, FALSE,
-  "[options...]  [...]",
   "Construct a reply template for a set of messages." },
 { "tag", notmuch_tag_command, FALSE,
-  "+|- [...] [--]  [...]" ,
   "Add/remove tags for all messages matching the search terms." },
 { "dump", notmuch_dump_command, FALSE,
-  "[] [--] []",
   "Create a plain-text dump of the tags for each message." },
 { "restore", notmuch_restore_command, FALSE,
-  "[--accumulate] []",
   "Restore the tags from the given dump file (see 'dump')." },
 { "config", notmuch_config_command, FALSE,
-  "[get|set] . [value ...]",
   "Get or set settings in the notmuch configuration file." },
 { "help", notmuch_help_command, TRUE, /* create but don't save config */
-  "[]",
   "This message, or more detailed help for the named command." }
 };

-- 
1.7.10.4



[PATCH 2/4] test: added --stderr=FILE tests

2013-05-25 Thread Jani Nikula
On Fri, 24 May 2013, Jani Nikula  wrote:
> On Thu, 23 May 2013, Tomi Ollila  wrote:
>> --stderr=FILE tests were added to test/help-test as it is the one
>> doing most global option testing. Also, it was simplest to test
>> this new option using `notmuch help` command.
>> ---
>>
>> In the future this file (help-test) could be renamed and used in
>> more generic "global option" testing
>>
>>  test/help-test | 10 ++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/test/help-test b/test/help-test
>> index f7df725..8b77931 100755
>> --- a/test/help-test
>> +++ b/test/help-test
>> @@ -9,4 +9,14 @@ test_expect_success 'notmuch help' 'notmuch help'
>>  test_expect_success 'notmuch help tag' 'notmuch help tag'
>>  test_expect_success 'notmuch --version' 'notmuch --version'
>>  
>> +test_begin_subtest "notmuch --stderr=stderr help %"
>> +notmuch --stderr=stderr help %
>> +test_expect_equal "$(cat stderr)" "
>> +Sorry, % is not a known command. There's not much I can do to help."
>> +
>> +test_begin_subtest "notmuch --stderr=- help %"
>> +notmuch --stderr=stderr help %
>
> Leftover line from copy-paste?

Apart from this, the whole series LGTM.

BR,
Jani.


[PATCH 0/8] packaging: fedora: general updates

2013-05-25 Thread Tomi Ollila
On Sun, Apr 28 2013, Felipe Contreras  wrote:

> Hi,
>
> It doesn't seem the spec file is properly maintained, it should be much better
> now, closer to Fedora's one, and with support for Ruby bindings.
>
> Felipe Contreras (8):
>   packaging: fedora: update
>   packaging: fedora: remove irrelevant stuff
>   packaging: fedora: trivial cleanups
>   packaging: fedora: reorganize files section
>   packaging: fedora: separate package for emacs
>   packaging: fedora: package python bindings
>   packaging: fedora: package notmuch-mutt
>   packaging: fedora: add ruby bindings
>
>  packaging/fedora/notmuch.spec | 195 
> --
>  1 file changed, 111 insertions(+), 84 deletions(-)

This series looks ok to me -- in full, w/o last 1-2 patches or last 1-2
patches in outcommented format (depending on the consistency "policy").  


> 1.8.2.1.1031.g2ee5873

Tomi


[PATCH 1/4] cli: add global option --stderr=FILE

2013-05-25 Thread Mark Walters

This series looks good to me and it does simplify the emacs async error
handling very usefully. +1

Best wishes

Mark


On Thu, 23 May 2013, Tomi Ollila  wrote:
> With this option all writes to stderr are redirected to the spesified
> FILE (or to stdout on case FILE is '-'). This is immediately useful
> in emacs interface as some of its exec intefaces do not provide
> separation of stdout and stderr.
> ---
>  notmuch-client.h |  1 +
>  notmuch.c| 31 +++
>  2 files changed, 32 insertions(+)
>
> diff --git a/notmuch-client.h b/notmuch-client.h
> index 45749a6..4a3c7ac 100644
> --- a/notmuch-client.h
> +++ b/notmuch-client.h
> @@ -54,6 +54,7 @@ typedef GMimeCipherContext notmuch_crypto_context_t;
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/notmuch.c b/notmuch.c
> index f51a84f..77b5282 100644
> --- a/notmuch.c
> +++ b/notmuch.c
> @@ -251,6 +251,31 @@ notmuch_command (notmuch_config_t *config,
>  return 0;
>  }
>  
> +static int redirect_stderr (const char * stderr_file)
> +{
> +if (strcmp (stderr_file, "-") == 0) {
> + if (dup2 (STDOUT_FILENO, STDERR_FILENO) < 0) {
> + perror ("dup2");
> + return 1;
> + }
> +} else {
> + int fd = open (stderr_file, O_WRONLY|O_CREAT|O_APPEND, 0644);
> + if (fd < 0) {
> + fprintf (stderr, "Error: Cannot redirect stderr to '%s': %s\n",
> +  stderr_file, strerror (errno));
> + return 1;
> + }
> + if (fd != STDERR_FILENO) {
> + if (dup2 (fd, STDERR_FILENO) < 0) {
> + perror ("dup2");
> + return 1;
> + }
> + close (fd);
> + }
> +}
> +return 0;
> +}
> +
>  int
>  main (int argc, char *argv[])
>  {
> @@ -259,6 +284,7 @@ main (int argc, char *argv[])
>  const char *command_name = NULL;
>  command_t *command;
>  char *config_file_name = NULL;
> +char *stderr_file = NULL;
>  notmuch_config_t *config;
>  notmuch_bool_t print_help=FALSE, print_version=FALSE;
>  int opt_index;
> @@ -268,6 +294,7 @@ main (int argc, char *argv[])
>   { NOTMUCH_OPT_BOOLEAN, _help, "help", 'h', 0 },
>   { NOTMUCH_OPT_BOOLEAN, _version, "version", 'v', 0 },
>   { NOTMUCH_OPT_STRING, _file_name, "config", 'c', 0 },
> + { NOTMUCH_OPT_STRING, _file, "stderr", '\0', 0 },
>   { 0, 0, 0, 0, 0 }
>  };
>  
> @@ -287,6 +314,10 @@ main (int argc, char *argv[])
>   return 1;
>  }
>  
> +if (stderr_file && redirect_stderr (stderr_file) != 0) {
> + /* error already printed */
> + return 1;
> +}
>  if (print_help)
>   return notmuch_help_command (NULL, argc - 1, [1]);
>  
> -- 
> 1.8.1.4
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 4/5] emacs: Streaming S-expression parser

2013-05-25 Thread Mark Walters

Hi

On Wed, 22 May 2013, Austin Clements  wrote:
> On Tue, 21 May 2013, Mark Walters  wrote:
>> Hi
>>
>> This patch looks good to me. Some minor comments below.
>
> Some minor replies below.
>
> In building some other code on top of this, I found an interesting (but
> easy to fix) interface bug.  Currently, the interface is designed as if
> it doesn't matter what buffer these functions are called from, however,
> because they move point and expect this point motion to persist, it's
> actually not safe to call this interface unless the caller is in the
> right buffer anyway.  For example, if the buffer is selected in a
> window, the with-current-buffer in the parser functions will actually
> move a *temporary* point, meaning that the only way the caller can
> discover the new point is to first select the buffer for itself.  I can
> think of two solutions: 1) maintain our own mark for the parser's
> current position or 2) tweak the doc strings and code so that it reads
> from the current buffer.  1 keeps the interface the way it's currently
> documented, but complicates the parser implementation and interface and
> doesn't simplify the caller.  2 simplifies the parser and it turns out
> all callers already satisfy the requirement.

I am confused by this: the docs strings for json/sexp-parse-partial-list
both say something like "Parse a partial JSON list from current buffer"?
Or do you mean the with-current-buffer in notmuch-search-process-filter?

>> On Sat, 18 May 2013, Austin Clements  wrote:
>>> This provides the same interface as the streaming JSON parser, but
>>> reads S-expressions incrementally.  The only difference is that the
>>> `notmuch-sexp-parse-partial-list' helper does not handle interleaved
>>> error messages (since we now have the ability to separate these out at
>>> the invocation level), so it no longer takes an error function and
>>> does not need to do the horrible resynchronization that the JSON
>>> parser had to.
>>>
>>> Some implementation improvements have been made over the JSON parser.
>>> This uses a vector instead of a list for the parser data structure,
>>> since this allows faster access to elements (and modern versions of
>>> Emacs handle storage of small vectors efficiently).  Private functions
>>> follow the "prefix--name" convention.  And the implementation is much
>>> simpler overall because S-expressions are much easier to parse.
>>> ---
>>>  emacs/Makefile.local|1 +
>>>  emacs/notmuch-parser.el |  212 
>>> +++
>>>  2 files changed, 213 insertions(+)
>>>  create mode 100644 emacs/notmuch-parser.el
>>>
>>> diff --git a/emacs/Makefile.local b/emacs/Makefile.local
>>> index 456700a..a910aff 100644
>>> --- a/emacs/Makefile.local
>>> +++ b/emacs/Makefile.local
>>> @@ -3,6 +3,7 @@
>>>  dir := emacs
>>>  emacs_sources := \
>>> $(dir)/notmuch-lib.el \
>>> +   $(dir)/notmuch-parser.el \
>>> $(dir)/notmuch.el \
>>> $(dir)/notmuch-query.el \
>>> $(dir)/notmuch-show.el \
>>> diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
>>> new file mode 100644
>>> index 000..1b7cf64
>>> --- /dev/null
>>> +++ b/emacs/notmuch-parser.el
>>> @@ -0,0 +1,212 @@
>>> +;; notmuch-parser.el --- streaming S-expression parser
>>> +;;
>>> +;; Copyright ? Austin Clements
>>> +;;
>>> +;; This file is part of Notmuch.
>>> +;;
>>> +;; Notmuch is free software: you can redistribute it and/or modify it
>>> +;; under the terms of the GNU General Public License as published by
>>> +;; the Free Software Foundation, either version 3 of the License, or
>>> +;; (at your option) any later version.
>>> +;;
>>> +;; Notmuch is distributed in the hope that it will be useful, but
>>> +;; WITHOUT ANY WARRANTY; without even the implied warranty of
>>> +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>>> +;; General Public License for more details.
>>> +;;
>>> +;; You should have received a copy of the GNU General Public License
>>> +;; along with Notmuch.  If not, see .
>>> +;;
>>> +;; Authors: Austin Clements 
>>> +
>>> +(require 'cl)
>>> +
>>> +(defun notmuch-sexp-create-parser (buffer)
>>> +  "Return a streaming S-expression parser that reads from BUFFER.
>>> +
>>> +This parser is designed to incrementally read an S-expression
>>> +whose structure is known to the caller.  Like a typical
>>> +S-expression parsing interface, it provides a function to read a
>>> +complete S-expression from the input.  However, it extends this
>>> +with an additional function that requires the next value in the
>>> +input to be a list and descends into it, allowing its elements to
>>> +be read one at a time or further descended into.  Both functions
>>> +can return 'retry to indicate that not enough input is available.
>>> +
>>> +The parser always consumes input from BUFFER's point.  Hence, the
>>> +caller is allowed to delete any data before point and may
>>> +resynchronize after an error by moving point."

[PATCH 0/8] packaging: fedora: general updates

2013-05-25 Thread David Bremner
Felipe Contreras  writes:

> On Sun, Apr 28, 2013 at 4:52 AM, Felipe Contreras
>  wrote:
>
>> It doesn't seem the spec file is properly maintained, it should be much 
>> better
>> now, closer to Fedora's one, and with support for Ruby bindings.
>
> What about these?
>

Hi Felipe

At this point we wait for somebody (else) with Fedora expertise to
review the patches.

Maybe your ping will inspire someone. Or, at the risk of telling you
things you already know, maybe reviewing other people's patches will
make them keaner enough to review yours [1].

d

[1]: http://notmuchmail.org/contributing/



Re: [PATCH 0/8] packaging: fedora: general updates

2013-05-25 Thread Tomi Ollila
On Sun, Apr 28 2013, Felipe Contreras felipe.contre...@gmail.com wrote:

 Hi,

 It doesn't seem the spec file is properly maintained, it should be much better
 now, closer to Fedora's one, and with support for Ruby bindings.

 Felipe Contreras (8):
   packaging: fedora: update
   packaging: fedora: remove irrelevant stuff
   packaging: fedora: trivial cleanups
   packaging: fedora: reorganize files section
   packaging: fedora: separate package for emacs
   packaging: fedora: package python bindings
   packaging: fedora: package notmuch-mutt
   packaging: fedora: add ruby bindings

  packaging/fedora/notmuch.spec | 195 
 --
  1 file changed, 111 insertions(+), 84 deletions(-)

This series looks ok to me -- in full, w/o last 1-2 patches or last 1-2
patches in outcommented format (depending on the consistency policy).  


 1.8.2.1.1031.g2ee5873

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 4/5] emacs: Streaming S-expression parser

2013-05-25 Thread Mark Walters

Hi

On Wed, 22 May 2013, Austin Clements amdra...@mit.edu wrote:
 On Tue, 21 May 2013, Mark Walters markwalters1...@gmail.com wrote:
 Hi

 This patch looks good to me. Some minor comments below.

 Some minor replies below.

 In building some other code on top of this, I found an interesting (but
 easy to fix) interface bug.  Currently, the interface is designed as if
 it doesn't matter what buffer these functions are called from, however,
 because they move point and expect this point motion to persist, it's
 actually not safe to call this interface unless the caller is in the
 right buffer anyway.  For example, if the buffer is selected in a
 window, the with-current-buffer in the parser functions will actually
 move a *temporary* point, meaning that the only way the caller can
 discover the new point is to first select the buffer for itself.  I can
 think of two solutions: 1) maintain our own mark for the parser's
 current position or 2) tweak the doc strings and code so that it reads
 from the current buffer.  1 keeps the interface the way it's currently
 documented, but complicates the parser implementation and interface and
 doesn't simplify the caller.  2 simplifies the parser and it turns out
 all callers already satisfy the requirement.

I am confused by this: the docs strings for json/sexp-parse-partial-list
both say something like Parse a partial JSON list from current buffer?
Or do you mean the with-current-buffer in notmuch-search-process-filter?

 On Sat, 18 May 2013, Austin Clements amdra...@mit.edu wrote:
 This provides the same interface as the streaming JSON parser, but
 reads S-expressions incrementally.  The only difference is that the
 `notmuch-sexp-parse-partial-list' helper does not handle interleaved
 error messages (since we now have the ability to separate these out at
 the invocation level), so it no longer takes an error function and
 does not need to do the horrible resynchronization that the JSON
 parser had to.

 Some implementation improvements have been made over the JSON parser.
 This uses a vector instead of a list for the parser data structure,
 since this allows faster access to elements (and modern versions of
 Emacs handle storage of small vectors efficiently).  Private functions
 follow the prefix--name convention.  And the implementation is much
 simpler overall because S-expressions are much easier to parse.
 ---
  emacs/Makefile.local|1 +
  emacs/notmuch-parser.el |  212 
 +++
  2 files changed, 213 insertions(+)
  create mode 100644 emacs/notmuch-parser.el

 diff --git a/emacs/Makefile.local b/emacs/Makefile.local
 index 456700a..a910aff 100644
 --- a/emacs/Makefile.local
 +++ b/emacs/Makefile.local
 @@ -3,6 +3,7 @@
  dir := emacs
  emacs_sources := \
 $(dir)/notmuch-lib.el \
 +   $(dir)/notmuch-parser.el \
 $(dir)/notmuch.el \
 $(dir)/notmuch-query.el \
 $(dir)/notmuch-show.el \
 diff --git a/emacs/notmuch-parser.el b/emacs/notmuch-parser.el
 new file mode 100644
 index 000..1b7cf64
 --- /dev/null
 +++ b/emacs/notmuch-parser.el
 @@ -0,0 +1,212 @@
 +;; notmuch-parser.el --- streaming S-expression parser
 +;;
 +;; Copyright © Austin Clements
 +;;
 +;; This file is part of Notmuch.
 +;;
 +;; Notmuch is free software: you can redistribute it and/or modify it
 +;; under the terms of the GNU General Public License as published by
 +;; the Free Software Foundation, either version 3 of the License, or
 +;; (at your option) any later version.
 +;;
 +;; Notmuch is distributed in the hope that it will be useful, but
 +;; WITHOUT ANY WARRANTY; without even the implied warranty of
 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 +;; General Public License for more details.
 +;;
 +;; You should have received a copy of the GNU General Public License
 +;; along with Notmuch.  If not, see http://www.gnu.org/licenses/.
 +;;
 +;; Authors: Austin Clements acleme...@csail.mit.edu
 +
 +(require 'cl)
 +
 +(defun notmuch-sexp-create-parser (buffer)
 +  Return a streaming S-expression parser that reads from BUFFER.
 +
 +This parser is designed to incrementally read an S-expression
 +whose structure is known to the caller.  Like a typical
 +S-expression parsing interface, it provides a function to read a
 +complete S-expression from the input.  However, it extends this
 +with an additional function that requires the next value in the
 +input to be a list and descends into it, allowing its elements to
 +be read one at a time or further descended into.  Both functions
 +can return 'retry to indicate that not enough input is available.
 +
 +The parser always consumes input from BUFFER's point.  Hence, the
 +caller is allowed to delete any data before point and may
 +resynchronize after an error by moving point.
 +
 +  (vector 'notmuch-sexp-parser
 + buffer
 + ;; List depth
 + 0
 + ;; Partial parse position marker
 + nil
 + ;; Partial parse state
 + nil))
 +
 +(defmacro 

Re: [PATCH 1/4] cli: add global option --stderr=FILE

2013-05-25 Thread Mark Walters

This series looks good to me and it does simplify the emacs async error
handling very usefully. +1

Best wishes

Mark


On Thu, 23 May 2013, Tomi Ollila tomi.oll...@iki.fi wrote:
 With this option all writes to stderr are redirected to the spesified
 FILE (or to stdout on case FILE is '-'). This is immediately useful
 in emacs interface as some of its exec intefaces do not provide
 separation of stdout and stderr.
 ---
  notmuch-client.h |  1 +
  notmuch.c| 31 +++
  2 files changed, 32 insertions(+)

 diff --git a/notmuch-client.h b/notmuch-client.h
 index 45749a6..4a3c7ac 100644
 --- a/notmuch-client.h
 +++ b/notmuch-client.h
 @@ -54,6 +54,7 @@ typedef GMimeCipherContext notmuch_crypto_context_t;
  #include sys/stat.h
  #include sys/time.h
  #include unistd.h
 +#include fcntl.h
  #include dirent.h
  #include errno.h
  #include signal.h
 diff --git a/notmuch.c b/notmuch.c
 index f51a84f..77b5282 100644
 --- a/notmuch.c
 +++ b/notmuch.c
 @@ -251,6 +251,31 @@ notmuch_command (notmuch_config_t *config,
  return 0;
  }
  
 +static int redirect_stderr (const char * stderr_file)
 +{
 +if (strcmp (stderr_file, -) == 0) {
 + if (dup2 (STDOUT_FILENO, STDERR_FILENO)  0) {
 + perror (dup2);
 + return 1;
 + }
 +} else {
 + int fd = open (stderr_file, O_WRONLY|O_CREAT|O_APPEND, 0644);
 + if (fd  0) {
 + fprintf (stderr, Error: Cannot redirect stderr to '%s': %s\n,
 +  stderr_file, strerror (errno));
 + return 1;
 + }
 + if (fd != STDERR_FILENO) {
 + if (dup2 (fd, STDERR_FILENO)  0) {
 + perror (dup2);
 + return 1;
 + }
 + close (fd);
 + }
 +}
 +return 0;
 +}
 +
  int
  main (int argc, char *argv[])
  {
 @@ -259,6 +284,7 @@ main (int argc, char *argv[])
  const char *command_name = NULL;
  command_t *command;
  char *config_file_name = NULL;
 +char *stderr_file = NULL;
  notmuch_config_t *config;
  notmuch_bool_t print_help=FALSE, print_version=FALSE;
  int opt_index;
 @@ -268,6 +294,7 @@ main (int argc, char *argv[])
   { NOTMUCH_OPT_BOOLEAN, print_help, help, 'h', 0 },
   { NOTMUCH_OPT_BOOLEAN, print_version, version, 'v', 0 },
   { NOTMUCH_OPT_STRING, config_file_name, config, 'c', 0 },
 + { NOTMUCH_OPT_STRING, stderr_file, stderr, '\0', 0 },
   { 0, 0, 0, 0, 0 }
  };
  
 @@ -287,6 +314,10 @@ main (int argc, char *argv[])
   return 1;
  }
  
 +if (stderr_file  redirect_stderr (stderr_file) != 0) {
 + /* error already printed */
 + return 1;
 +}
  if (print_help)
   return notmuch_help_command (NULL, argc - 1, argv[1]);
  
 -- 
 1.8.1.4

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 2/4] test: added --stderr=FILE tests

2013-05-25 Thread Jani Nikula
On Fri, 24 May 2013, Jani Nikula j...@nikula.org wrote:
 On Thu, 23 May 2013, Tomi Ollila tomi.oll...@iki.fi wrote:
 --stderr=FILE tests were added to test/help-test as it is the one
 doing most global option testing. Also, it was simplest to test
 this new option using `notmuch help` command.
 ---

 In the future this file (help-test) could be renamed and used in
 more generic global option testing

  test/help-test | 10 ++
  1 file changed, 10 insertions(+)

 diff --git a/test/help-test b/test/help-test
 index f7df725..8b77931 100755
 --- a/test/help-test
 +++ b/test/help-test
 @@ -9,4 +9,14 @@ test_expect_success 'notmuch help' 'notmuch help'
  test_expect_success 'notmuch help tag' 'notmuch help tag'
  test_expect_success 'notmuch --version' 'notmuch --version'
  
 +test_begin_subtest notmuch --stderr=stderr help %
 +notmuch --stderr=stderr help %
 +test_expect_equal $(cat stderr) 
 +Sorry, % is not a known command. There's not much I can do to help.
 +
 +test_begin_subtest notmuch --stderr=- help %
 +notmuch --stderr=stderr help %

 Leftover line from copy-paste?

Apart from this, the whole series LGTM.

BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] cli: remove unused argument descriptions

2013-05-25 Thread Jani Nikula
Clean up leftovers from help system rework. These are no longer
needed. They are easy to resurrect and update if a need later arises.
---
 notmuch.c |   13 -
 1 file changed, 13 deletions(-)

diff --git a/notmuch.c b/notmuch.c
index f51a84f..267ce3d 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -28,7 +28,6 @@ typedef struct command {
 const char *name;
 command_function_t function;
 notmuch_bool_t create_config;
-const char *arguments;
 const char *summary;
 } command_t;
 
@@ -40,40 +39,28 @@ notmuch_command (notmuch_config_t *config, int argc, char 
*argv[]);
 
 static command_t commands[] = {
 { NULL, notmuch_command, TRUE,
-  NULL,
   Notmuch main command. },
 { setup, notmuch_setup_command, TRUE,
-  NULL,
   Interactively setup notmuch for first use. },
 { new, notmuch_new_command, FALSE,
-  [options...],
   Find and import new messages to the notmuch database. },
 { search, notmuch_search_command, FALSE,
-  [options...] search-terms [...],
   Search for messages matching the given search terms. },
 { show, notmuch_show_command, FALSE,
-  search-terms [...],
   Show all messages matching the search terms. },
 { count, notmuch_count_command, FALSE,
-  [options...] search-terms [...],
   Count messages matching the search terms. },
 { reply, notmuch_reply_command, FALSE,
-  [options...] search-terms [...],
   Construct a reply template for a set of messages. },
 { tag, notmuch_tag_command, FALSE,
-  +tag|-tag [...] [--] search-terms [...] ,
   Add/remove tags for all messages matching the search terms. },
 { dump, notmuch_dump_command, FALSE,
-  [filename] [--] [search-terms],
   Create a plain-text dump of the tags for each message. },
 { restore, notmuch_restore_command, FALSE,
-  [--accumulate] [filename],
   Restore the tags from the given dump file (see 'dump'). },
 { config, notmuch_config_command, FALSE,
-  [get|set] section.item [value ...],
   Get or set settings in the notmuch configuration file. },
 { help, notmuch_help_command, TRUE, /* create but don't save config */
-  [command],
   This message, or more detailed help for the named command. }
 };
 
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH v2] build: fix out-of-tree builds

2013-05-25 Thread Jani Nikula
Support for out-of-tree builds was added in
commit 3e4a9d60a9419621b08c647a306843d76c47c2cb
Author: Carl Worth cwo...@cworth.org
Date:   Wed Mar 9 15:02:42 2011 -0800

build: Add support for non-source-directory builds.

and broken in
commit 7beeb8c88a014ecbc53d8241f10683b3c4c16228
Author: David Bremner brem...@debian.org
Date:   Sat Nov 17 12:28:15 2012 -0400

test: initial performance testing infrastructure

Fix the build breakage.

Out-of-tree 'make test' has been broken since earlier than the above,
and remains broken, as does out-of-tree perf test, but at least the
build now works.

---

I didn't have the time to dig into the test and perf test breakage.
---
 Makefile|7 ---
 performance-test/Makefile.local |2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 73a8554..0428160 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,10 @@
 # given explicitly on the command line) so mention it first.
 all:
 
-# List all subdirectories here. Each contains its own Makefile.local
-subdirs := compat completion emacs lib man parse-time-string
-subdirs += performance-test util test
+# List all subdirectories here. Each contains its own Makefile.local.
+# Use of '=', without '+=', seems to be required for out-of-tree
+# builds to work.
+subdirs = compat completion emacs lib man parse-time-string performance-test 
util test
 
 # We make all targets depend on the Makefiles themselves.
 global_deps = Makefile Makefile.config Makefile.local \
diff --git a/performance-test/Makefile.local b/performance-test/Makefile.local
index 73aa963..e47219a 100644
--- a/performance-test/Makefile.local
+++ b/performance-test/Makefile.local
@@ -2,7 +2,7 @@
 
 dir := performance-test
 
-include $(dir)/version.sh
+include $(srcdir)/$(dir)/version.sh
 
 TIME_TEST_SCRIPT := ${dir}/notmuch-time-test
 MEMORY_TEST_SCRIPT := ${dir}/notmuch-memory-test
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] emacs: add show view bindings to move to previous/next thread

2013-05-25 Thread Jani Nikula
We have most of the plumbing in place, add the bindings M-n and M-p.

---

v2: reduce duplication by adding PREVIOUS argument to
notmuch-show-next-thread instead of adding a separate function for
moving to previous thread (Mark)
---
 emacs/notmuch-show.el |   28 
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d56154e..a903395 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -39,6 +39,7 @@
 
 (declare-function notmuch-call-notmuch-process notmuch (rest args))
 (declare-function notmuch-search-next-thread notmuch nil)
+(declare-function notmuch-search-previous-thread notmuch nil)
 (declare-function notmuch-search-show-thread notmuch nil)
 
 (defcustom notmuch-message-headers '(Subject To Cc Date)
@@ -1273,6 +1274,8 @@ reset based on the original query.
(define-key map P 'notmuch-show-previous-message)
(define-key map n 'notmuch-show-next-open-message)
(define-key map p 'notmuch-show-previous-open-message)
+   (define-key map (kbd M-n) 'notmuch-show-next-thread-show)
+   (define-key map (kbd M-p) 'notmuch-show-previous-thread-show)
(define-key map (kbd DEL) 'notmuch-show-rewind)
(define-key map   'notmuch-show-advance-and-archive)
(define-key map (kbd M-RET) 'notmuch-show-open-or-close-all)
@@ -1834,17 +1837,34 @@ argument, hide all of the messages.
   (interactive)
   (backward-button 1))
 
-(defun notmuch-show-next-thread (optional show-next)
-  Move to the next item in the search results, if any.
+(defun notmuch-show-next-thread (optional show previous)
+  Move to the next item in the search results, if any.
+
+If SHOW is non-nil, open the next item in a show
+buffer. Otherwise just highlight the next item in the search
+buffer. If PREVIOUS is non-nil, move to the previous item in the
+search results instead.
   (interactive P)
   (let ((parent-buffer notmuch-show-parent-buffer))
 (notmuch-kill-this-buffer)
 (when (buffer-live-p parent-buffer)
   (switch-to-buffer parent-buffer)
-  (notmuch-search-next-thread)
-  (if show-next
+  (if previous
+ (notmuch-search-previous-thread)
+   (notmuch-search-next-thread))
+  (if show
  (notmuch-search-show-thread)
 
+(defun notmuch-show-next-thread-show ()
+  Show the next thread in the search results, if any.
+  (interactive)
+  (notmuch-show-next-thread t))
+
+(defun notmuch-show-previous-thread-show ()
+  Show the previous thread in the search results, if any.
+  (interactive)
+  (notmuch-show-next-thread t t))
+
 (defun notmuch-show-archive-thread (optional unarchive)
   Archive each message in thread.
 
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/2] TODO: keybindings for next/previous thread done

2013-05-25 Thread Jani Nikula
---
 devel/TODO |2 --
 1 file changed, 2 deletions(-)

diff --git a/devel/TODO b/devel/TODO
index f63385d..844555e 100644
--- a/devel/TODO
+++ b/devel/TODO
@@ -34,8 +34,6 @@ current message/thread and make searches not return deleted 
messages
 by default, (unless the user asks explicitly for deleted messages in
 the search query).
 
-Add keybindings for next/previous thread.
-
 Add support to mute a thread (add a muted tag and then don't
 display threads in searches by default where any message of the thread
 has the muted tag).
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 0/8] packaging: fedora: general updates

2013-05-25 Thread David Bremner
Felipe Contreras felipe.contre...@gmail.com writes:

 On Sun, Apr 28, 2013 at 4:52 AM, Felipe Contreras
 felipe.contre...@gmail.com wrote:

 It doesn't seem the spec file is properly maintained, it should be much 
 better
 now, closer to Fedora's one, and with support for Ruby bindings.

 What about these?


Hi Felipe

At this point we wait for somebody (else) with Fedora expertise to
review the patches.

Maybe your ping will inspire someone. Or, at the risk of telling you
things you already know, maybe reviewing other people's patches will
make them keaner enough to review yours [1].

d

[1]: http://notmuchmail.org/contributing/

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 1/2] emacs: add show view bindings to move to previous/next thread

2013-05-25 Thread Mark Walters

Hi

 We have most of the plumbing in place, add the bindings M-n and M-p.

 ---

 v2: reduce duplication by adding PREVIOUS argument to
 notmuch-show-next-thread instead of adding a separate function for
 moving to previous thread (Mark)
 ---
  emacs/notmuch-show.el |   28 
  1 file changed, 24 insertions(+), 4 deletions(-)

 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
 index d56154e..a903395 100644
 --- a/emacs/notmuch-show.el
 +++ b/emacs/notmuch-show.el
 @@ -39,6 +39,7 @@
  
  (declare-function notmuch-call-notmuch-process notmuch (rest args))
  (declare-function notmuch-search-next-thread notmuch nil)
 +(declare-function notmuch-search-previous-thread notmuch nil)
  (declare-function notmuch-search-show-thread notmuch nil)
  
  (defcustom notmuch-message-headers '(Subject To Cc Date)
 @@ -1273,6 +1274,8 @@ reset based on the original query.
   (define-key map P 'notmuch-show-previous-message)
   (define-key map n 'notmuch-show-next-open-message)
   (define-key map p 'notmuch-show-previous-open-message)
 + (define-key map (kbd M-n) 'notmuch-show-next-thread-show)
 + (define-key map (kbd M-p) 'notmuch-show-previous-thread-show)
   (define-key map (kbd DEL) 'notmuch-show-rewind)
   (define-key map   'notmuch-show-advance-and-archive)
   (define-key map (kbd M-RET) 'notmuch-show-open-or-close-all)
 @@ -1834,17 +1837,34 @@ argument, hide all of the messages.
(interactive)
(backward-button 1))
  
 -(defun notmuch-show-next-thread (optional show-next)
 -  Move to the next item in the search results, if any.
 +(defun notmuch-show-next-thread (optional show previous)
 +  Move to the next item in the search results, if any.
 +
 +If SHOW is non-nil, open the next item in a show
 +buffer. Otherwise just highlight the next item in the search
 +buffer. If PREVIOUS is non-nil, move to the previous item in the
 +search results instead.
(interactive P)
(let ((parent-buffer notmuch-show-parent-buffer))
  (notmuch-kill-this-buffer)
  (when (buffer-live-p parent-buffer)
(switch-to-buffer parent-buffer)
 -  (notmuch-search-next-thread)
 -  (if show-next
 +  (if previous
 +   (notmuch-search-previous-thread)
 + (notmuch-search-next-thread))
 +  (if show
 (notmuch-search-show-thread)

Did you want this to not exit back to the search results if you do M-p
on the first result?  I attach a version below that does exit back (so
M-p and M-n behave the same.

Best wishes 

Mark

From 22f03457a4c1884d35cf3de32f55977b980b7960 Mon Sep 17 00:00:00 2001
From: Jani Nikula j...@nikula.org
Date: Sat, 25 May 2013 15:14:25 +0300
Subject: [PATCH 1/2] emacs: add show view bindings to move to previous/next
 thread

We have most of the plumbing in place, add the bindings M-n and M-p.
---
 emacs/notmuch-show.el |   30 +-
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d56154e..2b33007 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -39,6 +39,7 @@
 
 (declare-function notmuch-call-notmuch-process notmuch (rest args))
 (declare-function notmuch-search-next-thread notmuch nil)
+(declare-function notmuch-search-previous-thread notmuch nil)
 (declare-function notmuch-search-show-thread notmuch nil)
 
 (defcustom notmuch-message-headers '(Subject To Cc Date)
@@ -1273,6 +1274,8 @@ reset based on the original query.
(define-key map P 'notmuch-show-previous-message)
(define-key map n 'notmuch-show-next-open-message)
(define-key map p 'notmuch-show-previous-open-message)
+   (define-key map (kbd M-n) 'notmuch-show-next-thread-show)
+   (define-key map (kbd M-p) 'notmuch-show-previous-thread-show)
(define-key map (kbd DEL) 'notmuch-show-rewind)
(define-key map   'notmuch-show-advance-and-archive)
(define-key map (kbd M-RET) 'notmuch-show-open-or-close-all)
@@ -1834,16 +1837,33 @@ argument, hide all of the messages.
   (interactive)
   (backward-button 1))
 
-(defun notmuch-show-next-thread (optional show-next)
-  Move to the next item in the search results, if any.
+(defun notmuch-show-next-thread (optional show previous)
+  Move to the next item in the search results, if any.
+
+If SHOW is non-nil, open the next item in a show
+buffer. Otherwise just highlight the next item in the search
+buffer. If PREVIOUS is non-nil, move to the previous item in the
+search results instead.
   (interactive P)
   (let ((parent-buffer notmuch-show-parent-buffer))
 (notmuch-kill-this-buffer)
 (when (buffer-live-p parent-buffer)
   (switch-to-buffer parent-buffer)
-  (notmuch-search-next-thread)
-  (if show-next
- (notmuch-search-show-thread)
+  (and (if previous
+  (notmuch-search-previous-thread)
+(notmuch-search-next-thread))
+  show
+  (notmuch-search-show-thread)
+

Re: [PATCH 1/2] emacs: add show view bindings to move to previous/next thread

2013-05-25 Thread Jani Nikula
On Sat, 25 May 2013, Mark Walters markwalters1...@gmail.com wrote:
 Did you want this to not exit back to the search results if you do M-p
 on the first result?  I attach a version below that does exit back (so
 M-p and M-n behave the same.

Oh, that was just pure fail from my part. Sorry about that, Mark, and
thanks so much for fixing it. Your amended version is better.

Thanks,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


handle CPPFLAGS in configure and make

2013-05-25 Thread david
I wanted to enable hardening flags in the debian build (I guess other
distros will want to do the same); I realized this is made more
difficult by the fact that we don't handle CPPFLAGS in our build
system. Well, if it makes us feel any better, CMake had (has?) the
same bug.

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 3/3] build: pass CPPFLAGS to C and C++ compilers

2013-05-25 Thread david
From: David Bremner brem...@debian.org

This is used in particular by hardening flags.
---
 Makefile.local |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index c274f07..644623f 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -39,8 +39,8 @@ GPG_FILE=$(SHA1_FILE).asc
 PV_FILE=bindings/python/notmuch/version.py
 
 # Smash together user's values with our extra values
-FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) 
$(CONFIGURE_CFLAGS) $(extra_cflags)
-FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) 
$(extra_cflags) $(extra_cxxflags)
+FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(CFLAGS) 
$(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
+FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) 
$(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
 FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch 
$(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS)
 FINAL_NOTMUCH_LINKER = CC
 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
@@ -237,11 +237,11 @@ quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))
 
 %.o: %.cc $(global_deps)
@mkdir -p .deps/$(@D)
-   $(call quiet,CXX $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $ -o $@ -MD -MP -MF 
.deps/$*.d
+   $(call quiet,CXX $(CPPFLAGS) $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $ -o $@ 
-MD -MP -MF .deps/$*.d
 
 %.o: %.c $(global_deps)
@mkdir -p .deps/$(@D)
-   $(call quiet,CC $(CFLAGS)) -c $(FINAL_CFLAGS) $ -o $@ -MD -MP -MF 
.deps/$*.d
+   $(call quiet,CC $(CPPFLAGS) $(CFLAGS)) -c $(FINAL_CFLAGS) $ -o $@ -MD 
-MP -MF .deps/$*.d
 
 .PHONY : clean
 clean:
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/3] configure: grab CPPFLAGS from the environment.

2013-05-25 Thread david
From: David Bremner brem...@debian.org

This is needed in particular for hardening flags.
---
 configure |5 +
 1 file changed, 5 insertions(+)

diff --git a/configure b/configure
index 460fcfc..3ba1ec3 100755
--- a/configure
+++ b/configure
@@ -43,6 +43,7 @@ fi
 CC=${CC:-gcc}
 CXX=${CXX:-g++}
 CFLAGS=${CFLAGS:--O2}
+CPPFLAGS=${CPPFLAGS:-}
 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
 LDFLAGS=${LDFLAGS:-}
 XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}
@@ -91,6 +92,7 @@ First, some common variables can specified via environment 
variables:
 
CC  The C compiler to use
CFLAGS  Flags to pass to the C compiler
+CPPFLAGS   Flags to pass to the C preprocessor
CXX The C++ compiler to use
CXXFLAGSFlags to pass to the C compiler
LDFLAGS Flags to pass when linking
@@ -615,6 +617,9 @@ EMACS = emacs --quick
 # Default FLAGS for C compiler (can be overridden by user such as make 
CFLAGS=-g)
 CFLAGS = ${CFLAGS}
 
+# Default FLAGS for C preprocessor (can be overridden by user such as make 
CPPFLAGS=-I/usr/local/include)
+CPPFLAGS = ${CPPFLAGS}
+
 # Default FLAGS for C++ compiler (can be overridden by user such as make 
CXXFLAGS=-g)
 CXXFLAGS = ${CXXFLAGS}
 
-- 
1.7.10.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch