[notmuch] [PATCH 3/3] Add a --libdir option to ./configure

2010-03-12 Thread Ingmar Vanhassel
This allows packagers to specify to which directory libraries should be
installed.

Signed-off-by: Ingmar Vanhassel 
---
 Makefile.local |6 +++---
 configure  |7 +++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 31ab534..e139395 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -27,15 +27,15 @@ notmuch.1.gz: notmuch.1
$(call quiet,gzip) --stdout $^ > $@

 install: all notmuch.1.gz
-   for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/lib/ \
+   for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(libdir)/ \
$(DESTDIR)$(prefix)/include/ $(DESTDIR)$(prefix)/share/man/man1 
; \
do \
install -d $$d ; \
done ;
install notmuch $(DESTDIR)$(prefix)/bin/
-   install lib/$(SONAME) $(DESTDIR)$(prefix)/lib/
+   install lib/$(SONAME) $(DESTDIR)$(libdir)/
install lib/notmuch.h $(DESTDIR)$(prefix)/include/
-   ln -sf $(SONAME) $(DESTDIR)$(prefix)/lib/libnotmuch.so
+   ln -sf $(SONAME) $(DESTDIR)$(libdir)/libnotmuch.so
install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
 ifeq ($(MAKECMDGOALS), install)
@echo ""
diff --git a/configure b/configure
index a2af672..1caff94 100755
--- a/configure
+++ b/configure
@@ -11,6 +11,7 @@ XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config-1.1 
xapian-config}
 # Set the defaults for values the user can specify with command-line
 # options.
 PREFIX=/usr/local
+LIBDIR=${PREFIX}/lib

 usage ()
 {
@@ -49,6 +50,7 @@ Additionally, various options can be specified on the 
configure
 command line.

--prefix=PREFIX Install files in PREFIX [$PREFIX]
+   --libdir=LIBDIR Install libraries in LIBDIR [$LIBDIR]

 By default, "make install" will install the resulting program to
 $PREFIX/bin, documentation to $PREFIX/share, etc. You can
@@ -67,6 +69,8 @@ for option; do
exit 0
 elif [ "${option%%=*}" = '--prefix' ] ; then
PREFIX="${option#*=}"
+elif [ "${option%%=*}" = '--libdir' ] ; then
+   LIBDIR="${option#*=}"
 else
echo "Unrecognized option: ${option}."
echo "See:"
@@ -271,6 +275,9 @@ CXXFLAGS = ${CXXFLAGS}
 # The prefix to which notmuch should be installed
 prefix = ${PREFIX}

+# The directory to which notmuch libraries should be installed
+libdir = ${LIBDIR}
+
 # The directory to which emacs lisp files should be installed
 emacs_lispdir=${emacs_lispdir}

-- 
1.7.0.2



[notmuch] [PATCH 2/3] Fix target dependencies for multiple jobs

2010-03-12 Thread Ingmar Vanhassel
From: Saleem Abdulrasool <compn...@compnerd.org>

Signed-off-by: Ingmar Vanhassel 
---
 lib/Makefile.local |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/Makefile.local b/lib/Makefile.local
index f848946..7105070 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -18,9 +18,12 @@ libnotmuch_cxx_srcs =\
$(dir)/thread.cc

 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
-$(dir)/libnotmuch.so : $(libnotmuch_modules)
+
+$(dir)/$(SONAME) : $(libnotmuch_modules)
$(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -shared 
-Wl,-soname=$(SONAME) -o $@
-   ln -sf $(SONAME) $@
+
+$(dir)/libnotmuch.so: $(dir)/$(SONAME)
+   ln -fs $(SONAME) $@

 SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
-CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/libnotmuch.so *.so
+CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/libnotmuch.so 
*.so
-- 
1.7.0.2



[notmuch] [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h

2010-03-12 Thread Ingmar Vanhassel
From: Ben Gamari <bgamari.f...@gmail.com>

Signed-off-by: Ingmar Vanhassel 
---
 .gitignore |1 +
 Makefile   |1 +
 Makefile.local |   10 +++---
 lib/Makefile.local |9 +
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index efa98fb..daf8094 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@ tags
 .deps
 notmuch
 notmuch.1.gz
+libnotmuch.so*
 *.[ao]
 *~
 .*.swp
diff --git a/Makefile b/Makefile
index 46f001c..80eedd0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+SONAME = libnotmuch.so.1
 WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
 WARN_CFLAGS=$(WARN_CXXFLAGS) -Wmissing-declarations

diff --git a/Makefile.local b/Makefile.local
index 3c2a629..31ab534 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -20,18 +20,22 @@ notmuch_client_srcs =   \
json.c

 notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
-notmuch: $(notmuch_client_modules) lib/notmuch.a
-   $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -o $@
+notmuch: $(notmuch_client_modules) lib/libnotmuch.so
+   $(call quiet,CC,$(LDFLAGS)) -Llib -lnotmuch $(filter-out 
lib/libnotmuch.so,$^) $(FINAL_LDFLAGS) -o $@

 notmuch.1.gz: notmuch.1
$(call quiet,gzip) --stdout $^ > $@

 install: all notmuch.1.gz
-   for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 ; \
+   for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/lib/ \
+   $(DESTDIR)$(prefix)/include/ $(DESTDIR)$(prefix)/share/man/man1 
; \
do \
install -d $$d ; \
done ;
install notmuch $(DESTDIR)$(prefix)/bin/
+   install lib/$(SONAME) $(DESTDIR)$(prefix)/lib/
+   install lib/notmuch.h $(DESTDIR)$(prefix)/include/
+   ln -sf $(SONAME) $(DESTDIR)$(prefix)/lib/libnotmuch.so
install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
 ifeq ($(MAKECMDGOALS), install)
@echo ""
diff --git a/lib/Makefile.local b/lib/Makefile.local
index 495b27e..f848946 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -1,5 +1,5 @@
 dir := lib
-extra_cflags += -I$(dir)
+extra_cflags += -I$(dir) -fPIC

 libnotmuch_c_srcs =\
$(dir)/libsha1.c\
@@ -18,8 +18,9 @@ libnotmuch_cxx_srcs = \
$(dir)/thread.cc

 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
-$(dir)/notmuch.a: $(libnotmuch_modules)
-   $(call quiet,AR) rcs $@ $^
+$(dir)/libnotmuch.so : $(libnotmuch_modules)
+   $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -shared 
-Wl,-soname=$(SONAME) -o $@
+   ln -sf $(SONAME) $@

 SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
-CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.a
+CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/libnotmuch.so *.so
-- 
1.7.0.2



[notmuch] (no subject)

2010-03-12 Thread Ingmar Vanhassel
I was just going to mail an updated series for this. I'd definitely like to see
this upstream.

I amended the first patch to install the notmuch.h header.

The second patch from a friend of mine fixes a parallel make issue I ran into
when I tested one of your intiial patches. I ran this patch by you ages on
#notmuch, not sure why it isn't included, not sure why you didn't included it?

The third patch adds a way to configure where to install libraries.
On Exherbo x86_64 we install 64 bit libraries to /usr/lib64/ so I need a switch
to configure this.

Regards,
Ingmar



[notmuch] (no subject)

2010-03-12 Thread Ingmar Vanhassel
I'd very much like to see this upstream.

Here's my updated series for this.

I amended your first patch to make it install the notmuch.h header too.

The second patch fixed some parallel make issue I had while testing your 
series. We discussed this
ages ago on #notmuch, I don't remember the details at the moment, and I can't 
check my logs right
now. Any reason why this isn't included in your current patch?

The third patch adds a configure switch to configure where to install 
libraries. It has one issue
I'm aware off. Setting --prefix=/usr without setting --libdir does the wrong 
thing. This should
probably be fixed, but I don't have any immediate ideas how to do this.

So, series tested by me and Michael Forney, and I'm using it for my notmuch, 
please apply. :)

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


[notmuch] [PATCH] Build and link against notmuch shared library

2010-01-23 Thread Ingmar Vanhassel
On Sat, 23 Jan 2010 02:58:53 +0200, Felipe Contreras  wrote:
> On Wed, Jan 20, 2010 at 10:35 PM, Ben Gamari  
> wrote:
> > ??libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) 
> > $(libnotmuch_cxx_srcs:.cc=.o)
> > -$(dir)/notmuch.a: $(libnotmuch_modules)
> > - ?? ?? ?? $(call quiet,AR) rcs $@ $^
> > +$(dir)/$(SONAME): $(libnotmuch_modules)
> > + ?? ?? ?? $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) 
> > -Wl,-soname=$(SONAME) -shared -o $@
> 
> Does it need to be CXX? Why not CC instead?

Xapian and the notmuch wrapper 'parts' are written in C++.

-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config

2009-12-05 Thread Ingmar Vanhassel
Excerpts from Carl Worth's message of Sat Dec 05 01:56:56 +0100 2009:
> Cool. At least not everyone thinks I'm crazy then. That's
> encouraging. :-)

I'm not convinced that re-implementing lots of things that autoconf
already handles properly & portably is the better route to go. It's
purely a waste of time. Hence, I'll be happy to send patches to use
autoconf, if you change your mind on the subject.

Now when you say you hate automake & libtool, then I'll wholeheartedly
agree with you.

-Ingmar
-- 
Exherbo KDE, X.org maintainer


Re: [notmuch] [PATCH 1/3] fix configure script to handle --prefix= and properly create Makefile.config

2009-12-05 Thread Ingmar Vanhassel
Excerpts from Carl Worth's message of Sat Dec 05 01:56:56 +0100 2009:
 Cool. At least not everyone thinks I'm crazy then. That's
 encouraging. :-)

I'm not convinced that re-implementing lots of things that autoconf
already handles properly  portably is the better route to go. It's
purely a waste of time. Hence, I'll be happy to send patches to use
autoconf, if you change your mind on the subject.

Now when you say you hate automake  libtool, then I'll wholeheartedly
agree with you.

-Ingmar
-- 
Exherbo KDE, X.org maintainer
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] [PATCH] Use libgcrypt for hashing.

2009-11-28 Thread Ingmar Vanhassel
Excerpts from Mikhail Gusarov's message of Sat Nov 28 04:31:15 +0100 2009:
> 
> Twas brillig at 21:28:03 27.11.2009 UTC-06 when jeff at ocjtech.us did gyre 
> and
> gimble:
> 
>  JCO> Instead of including a private implementation of the SHA1 hash
> 
> xserver went this road, and now it has
> --with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto in
> configure.

>From a distribution & security point of view I'd much rather be able to
choose one hashing library & use that as widely as possible, rather than
having every application ship its own copy.

>  JCO> This means less code of our own to maintain and
> 
> As libsha1 maintainer I'm volunteering to maintain in-tree copy in
> notmuch :)

Right, but on top of that, it would still be preferable to keep the
option for packagers to use a system library instead.
Most distributions have a rather strict policy to use system libraries
over internal copies.

-- 
Exherbo KDE, X.org maintainer


Re: [notmuch] [PATCH] Use libgcrypt for hashing.

2009-11-27 Thread Ingmar Vanhassel
Excerpts from Mikhail Gusarov's message of Sat Nov 28 04:31:15 +0100 2009:
 
 Twas brillig at 21:28:03 27.11.2009 UTC-06 when j...@ocjtech.us did gyre and
 gimble:
 
  JCO Instead of including a private implementation of the SHA1 hash
 
 xserver went this road, and now it has
 --with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto in
 configure.

From a distribution  security point of view I'd much rather be able to
choose one hashing library  use that as widely as possible, rather than
having every application ship its own copy.

  JCO This means less code of our own to maintain and
 
 As libsha1 maintainer I'm volunteering to maintain in-tree copy in
 notmuch :)

Right, but on top of that, it would still be preferable to keep the
option for packagers to use a system library instead.
Most distributions have a rather strict policy to use system libraries
over internal copies.

-- 
Exherbo KDE, X.org maintainer
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] [PATCH] notmuch: Add Maildir directory name as tag name for messages

2009-11-26 Thread Ingmar Vanhassel
Excerpts from Michiel Buddingh''s message of Thu Nov 26 22:12:02 +0100 2009:
> Haven't tested it, but it seems you can put
> 
> [core]
> whitespace = trailing-space,space-before-tab
> 
> into your ~/.gitconfig now.  I've also set emacs to mark trailing
> whitespace with big red markers.

I think it should be in notmuch/.gitattributes, which doesn't relies on
new contributors to set that up. It also doesn't force this on for every
git repo one has.


-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH] Makefile: Enable backslash escapes for echo.

2009-11-26 Thread Ingmar Vanhassel
Excerpts from Stefan Schmidt's message of Thu Nov 26 09:17:15 +0100 2009:
> This fixes a visual glitch during a silent compile.
> Before:
> Use "make V=1" to see the verbose compile lines.\n  CC  debugger.o
>   CCgmime-filter-reply.o
> 
> After:
> Use "make V=1" to see the verbose compile lines.
>   CCdebugger.o
>   CCgmime-filter-reply.o
> 
> Signed-off-by: Stefan Schmidt 

Looks right, works here with bash, dash & zsh, so:

Reviewed-by: Ingmar Vanhassel 

Thanks!

> ---
>  Makefile |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 2cd1b1b..2d19a6e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -41,7 +41,7 @@ include Makefile.config
>  # user how to enable verbose compiles.
>  ifeq ($(V),)
>  quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"
> -quiet = @echo $(quiet_DOC)$(eval quiet_DOC:=)"  $1$@"; $($1)
> +quiet = @echo -e $(quiet_DOC)$(eval quiet_DOC:=)"  $1$@"; $($1)
>  endif
>  # The user has explicitly enabled quiet compilation.
>  ifeq ($(V),0)
-- 
Exherbo KDE, X.org maintainer


[notmuch] Gmane

2009-11-25 Thread Ingmar Vanhassel
In case anyone's interested, I've submitted this list to gmane:
http://dir.gmane.org/gmane.mail.notmuch.general

Maybe someone who was on this list from the very beginning can submit an
archive to them, for future reference.

-Ingmar
-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH] Support multiple configuration files via $NOTMUCH_CONFIG

2009-11-23 Thread Ingmar Vanhassel
Excerpts from Alec Berryman's message of Sun Nov 22 06:18:26 +0100 2009:
> If present, $NOTMUCH_CONFIG will be used as the configuration file
> location.

I'm a bit late to the party, but how about adding the more generic
NOTMUCH_OPTIONS, and --config-file, -c options to pass the path to the
configuration file?

-- 
Exherbo KDE, X.org maintainer


[notmuch] [patch] Trivial fix for non-root install

2009-11-23 Thread Ingmar Vanhassel
Excerpts from Brett Viren's message of Mon Nov 23 16:31:47 +0100 2009:
> Installing as a normal user fails because the bash completion config
> files try to install into /etc.  This trivial patch fixes this.

NAK

Your patch breaks the more common case of installing as root user. It
now installs into /usr/etc where bash completions most likely won't be
found.

> diff --git a/Makefile.config b/Makefile.config
> index ddc7436..c04d57a 100644
> --- a/Makefile.config
> +++ b/Makefile.config
> @@ -1,3 +1,2 @@
> -prefix = /usr/local
> -bash_completion_dir = /etc/bash_completion.d
> +bash_completion_dir = $(prefix)/etc/bash_completion.d
>  CFLAGS += -DHAVE_VALGRIND
> 
> 
> -Brett.
-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH] Add SCons build files.

2009-11-22 Thread Ingmar Vanhassel
Personally I'd say we have better things to work on than maintaining
multiple buildsystems for notmuch. Or than resolving possible packaging
bugs originating in the use of different buildsystems.

GNU has a very wide install bas, it's has a low footprint,  and it
happened to be the choice of the initial developers. All of this makes
it the best choice imo.

While I don't want to start a discussion on the merits of various
buildsystems, I'll mention that, in my role as a packager, I'd choose
just about anything over scons.

My 2 cents,
Ingmar

-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH 2/2] bash-completion: Move to contrib

2009-11-20 Thread Ingmar Vanhassel
Signed-off-by: Ingmar Vanhassel 
---
 Makefile.local |2 +-
 .../notmuch-completion.bash|0
 2 files changed, 1 insertions(+), 1 deletions(-)
 rename notmuch-completion.bash => contrib/notmuch-completion.bash (100%)

Move to contrib/ for consistency with zsh completion.

diff --git a/Makefile.local b/Makefile.local
index ecd4ceb..74a72aa 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -33,7 +33,7 @@ install: all notmuch.1.gz
done ;
install notmuch $(DESTDIR)$(prefix)/bin/
install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
-   install notmuch-completion.bash \
+   install contrib/notmuch-completion.bash \
$(DESTDIR)/etc/bash_completion.d/notmuch

 install-emacs: install emacs
diff --git a/notmuch-completion.bash b/contrib/notmuch-completion.bash
similarity index 100%
rename from notmuch-completion.bash
rename to contrib/notmuch-completion.bash
-- 
1.6.5.2.433.g23cdb



[notmuch] [PATCH 1/2] zsh-completion: Initial zsh-completion for notmuch

2009-11-20 Thread Ingmar Vanhassel
Signed-off-by: Ingmar Vanhassel 
---
 contrib/notmuch-completion.zsh |   74 
 1 files changed, 74 insertions(+), 0 deletions(-)
 create mode 100644 contrib/notmuch-completion.zsh

Moved & renamed as you suggested.

diff --git a/contrib/notmuch-completion.zsh b/contrib/notmuch-completion.zsh
new file mode 100644
index 000..67a9aba
--- /dev/null
+++ b/contrib/notmuch-completion.zsh
@@ -0,0 +1,74 @@
+#compdef notmuch
+
+# ZSH completion for `notmuch`
+# Copyright ?? 2009 Ingmar Vanhassel 
+
+_notmuch_commands()
+{
+  local -a notmuch_commands
+  notmuch_commands=(
+'setup:interactively set up notmuch for first use'
+'new:find and import any new message to the database'
+'search:search for messages matching the search terms, display matching 
threads as results'
+'reply:constructs a reply template for a set of messages'
+'show:show all messages matching the search terms'
+'tag:add or remove tags for all messages matching the search terms'
+'dump:creates a plain-text dump of the tags of each message'
+'restore:restores the tags from the given file'
+'help:show details on a command'
+  )
+
+  _describe -t command 'command' notmuch_commands
+}
+
+_notmuch_dump()
+{
+  _files
+}
+
+_notmuch_help_topics()
+{
+  local -a notmuch_help_topics
+  notmuch_help_topics=(
+'search-terms:show common search-terms syntax'
+  )
+  _describe -t notmuch-help-topics 'topic' notmuch_help_topics
+}
+
+_notmuch_help()
+{
+  _alternative \
+_notmuch_commands \
+_notmuch_help_topics
+}
+
+_notmuch_restore()
+{
+  _files
+}
+
+_notmuch_search()
+{
+  _arguments -s : \
+'--max-threads=[display only the first x threads from the search 
results]:number of threads to show: ' \
+'--first=[omit the first x threads from the search results]:number of 
threads to omit: ' \
+'--sort=[sort results]:sorting:((newest-first\:"reverse chronological 
order" oldest-first\:"chronological order"))'
+}
+
+_notmuch()
+{
+  if (( CURRENT > 2 )) ; then
+local cmd=${words[2]}
+curcontext="${curcontext%:*:*}:notmuch-$cmd"
+(( CURRENT-- ))
+shift words
+_call_function ret _notmuch_$cmd
+return ret
+  else
+_notmuch_commands
+  fi
+}
+
+_notmuch "$@"
+
+# vim: set sw=2 sts=2 ts=2 et ft=zsh :
-- 
1.6.5.2.433.g23cdb



[notmuch] [PATCH] notmuch: improve installation of emacs mode

2009-11-19 Thread Ingmar Vanhassel
Excerpts from Jeffrey C. Ollie's message of Thu Nov 19 15:27:02 +0100 2009:
> 1) Add a separate targets to build and install emacs mode.
> 
> 2) Don't hardcode the installation directory, instead use emacs'
>pkg-config module.
> 
> 3) Install a byte compiled version of the emacs mode.
> 
> 4) Install the emacs mode in emacs' site-start directory so that it
>gets loaded automatically.
> 
> 5) Ignore byte-compiled emacs files.
> 
> Signed-off-by: Jeffrey C. Ollie 

Reviewed-by: Ingmar Vanhassel 

Thanks again!

> ---
>  .gitignore |2 +-
>  Makefile   |6 ++
>  Makefile.local |   15 ---
>  3 files changed, 19 insertions(+), 4 deletions(-)
> 
> diff --git a/.gitignore b/.gitignore
> index 8417d60..7d3c543 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -5,4 +5,4 @@ notmuch.1.gz
>  *.[ao]
>  *~
>  .*.swp
> -
> +*.elc
> diff --git a/Makefile b/Makefile
> index 023b2ec..17fa4a2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -7,6 +7,9 @@ CFLAGS=-O2
>  extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc)
>  extra_cxxflags := $(shell xapian-config --cxxflags)
>  
> +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir)
> +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir)
> +
>  # Now smash together user's values with our extra values
>  override CFLAGS += $(WARN_FLAGS) $(extra_cflags)
>  override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)
> @@ -28,6 +31,9 @@ include Makefile.config
>  %.o: %.c
>  $(CC) -c $(CFLAGS) $< -o $@
>  
> +%.elc: %.el
> +emacs -batch -f batch-byte-compile $<
> +
>  .deps/%.d: %.c
>  @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
>  $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \
> diff --git a/Makefile.local b/Makefile.local
> index 6bc01a5..2bb4521 100644
> --- a/Makefile.local
> +++ b/Makefile.local
> @@ -1,5 +1,7 @@
>  all: notmuch notmuch.1.gz
>  
> +emacs: notmuch.elc
> +
>  notmuch_client_srcs =\
>  notmuch.c\
>  notmuch-config.c\
> @@ -25,15 +27,22 @@ notmuch.1.gz: notmuch.1
>  
>  install: all notmuch.1.gz
>  for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \
> -$(DESTDIR)/$(prefix)/share/emacs/site-lisp/
> $(DESTDIR)/etc/bash_completion.d/ ; \
> +$(DESTDIR)/etc/bash_completion.d/ ; \
>  do \
>  install -d $$d ; \
>  done ;
>  install notmuch $(DESTDIR)$(prefix)/bin/
>  install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
> -install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/
>  install notmuch-completion.bash \
>  $(DESTDIR)/etc/bash_completion.d/notmuch
>  
> +install-emacs: install emacs
> +for d in $(DESTDIR)/$(emacs_startdir) ; \
> +do \
> +install -d $$d ; \
> +done ;
> +install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir)
> +install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir)
> +
>  SRCS  := $(SRCS) $(notmuch_client_srcs)
> -CLEAN := $(CLEAN) notmuch $(notmuch_client_modules)
> +CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) notmuch.elc
-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH] notmuch: improve installation of emacs mode

2009-11-19 Thread Ingmar Vanhassel
Excerpts from Jeffrey C. Ollie's message of Thu Nov 19 14:12:48 +0100 2009:
> 1) Add a separate install target to install emacs mode.

Thanks

> 2) Don't hardcode the installation directory, instead use emacs'
>pkg-config module.
> 
> 3) Install a byte compiled version of the emacs mode.
> 
> 4) Install the emacs mode in emacs' site-start directory so that it
>gets loaded automatically.
> 
> Signed-off-by: Jeffrey C. Ollie 
> ---
>  Makefile   |6 ++
>  Makefile.local |   13 ++---
>  2 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 023b2ec..17fa4a2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -7,6 +7,9 @@ CFLAGS=-O2
>  extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc)
>  extra_cxxflags := $(shell xapian-config --cxxflags)
>  
> +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir)
> +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir)
> +
>  # Now smash together user's values with our extra values
>  override CFLAGS += $(WARN_FLAGS) $(extra_cflags)
>  override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)
> @@ -28,6 +31,9 @@ include Makefile.config
>  %.o: %.c
>  $(CC) -c $(CFLAGS) $< -o $@
>  
> +%.elc: %.el
> +emacs -batch -f batch-byte-compile $<
> +

Looking at this ..

>  .deps/%.d: %.c
>  @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
>  $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.; \
> diff --git a/Makefile.local b/Makefile.local
> index 6bc01a5..e4a27e5 100644
> --- a/Makefile.local
> +++ b/Makefile.local
> @@ -1,4 +1,4 @@
> -all: notmuch notmuch.1.gz
> +all: notmuch notmuch.1.gz notmuch.elc

.. notmuch.elc requires emacs to build

Maybe make emacs && make install-emacs?

>  
>  notmuch_client_srcs =\
>  notmuch.c\
> @@ -25,15 +25,22 @@ notmuch.1.gz: notmuch.1
>  
>  install: all notmuch.1.gz
>  for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \
> -$(DESTDIR)/$(prefix)/share/emacs/site-lisp/
> $(DESTDIR)/etc/bash_completion.d/ ; \
> +$(DESTDIR)/etc/bash_completion.d/ ; \
>  do \
>  install -d $$d ; \
>  done ;
>  install notmuch $(DESTDIR)$(prefix)/bin/
>  install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
> -install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/
>  install notmuch-completion.bash \
>  $(DESTDIR)/etc/bash_completion.d/notmuch
>  
> +install-emacs: install notmuch.elc
> +for d in $(DESTDIR)/$(emacs_startdir) ; \
> +do \
> +install -d $$d ; \
> +done ;
> +install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir)
> +install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir)
> +
>  SRCS  := $(SRCS) $(notmuch_client_srcs)
>  CLEAN := $(CLEAN) notmuch $(notmuch_client_modules)
-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH] notmuch: improve installation of emacs mode

2009-11-19 Thread Ingmar Vanhassel
Excerpts from Jeffrey C. Ollie's message of Thu Nov 19 07:18:50 +0100 2009:
> 1) Don't hardcode the installation directory, instead use emacs'
>pkg-config module.
> 
> 2) Install a byte compiled version of the emacs mode.
> 
> 3) Install the emacs mode in emacs' site-start directory so that it
>gets loaded automatically.

Your patch makes emacs required to do make install, which is a no-go
imo. Notmuch can be used without emacs. Shouldn't installing the emac
mode be a seperate target?

-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH] Makefile: Create elisp install directory explicitly

2009-11-19 Thread Ingmar Vanhassel
When doing a DESTDIR install, this directory likely won't exist, and
installing notmuch.el will fail.

See 0d4b5292
---
 Makefile.local |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 27e42ba..6bc01a5 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -25,7 +25,7 @@ notmuch.1.gz: notmuch.1

 install: all notmuch.1.gz
for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \
-   $(DESTDIR)/etc/bash_completion.d/ ; \
+   $(DESTDIR)/$(prefix)/share/emacs/site-lisp/ 
$(DESTDIR)/etc/bash_completion.d/ ; \
do \
install -d $$d ; \
done ;
-- 
1.6.5.2.433.g23cdb



[notmuch] [PATCH 1/2] zsh: Initial zsh-completion for notmuch

2009-11-19 Thread Ingmar Vanhassel
Excerpts from Carl Worth's message of Thu Nov 19 01:51:51 +0100 2009:
> On Wed, 18 Nov 2009 23:50:40 +0100, Ingmar Vanhassel  
> wrote:
> > Signed-off-by: Ingmar Vanhassel 
> > ---
> >  _notmuch |   74 
> > ++
> >  1 files changed, 74 insertions(+), 0 deletions(-)
> >  create mode 100644 _notmuch
> 
> Looks nice. Could you also add a Makefile.local target to install this
> in the right place so that it actually does something?

Sure, any suggestions on the name? Or did you mean to add it to the
install target?

> And I'd like it to have a more descriptive name in the source tree (such
> as notmuch-completion.zsh).

Alright, will do. I just named it what it'll be installed as, but either
works.

> Thanks,
> 
> -Carl
-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH 2/2] .gitignore: Add common editor droppings

2009-11-18 Thread Ingmar Vanhassel
---
 .gitignore |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index d277c5a..a210779 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,6 @@
 notmuch
 notmuch.1.gz
 *.[ao]
+*~
+.*.swp

-- 
1.6.5.2.433.g23cdb



[notmuch] [PATCH 1/2] zsh: Initial zsh-completion for notmuch

2009-11-18 Thread Ingmar Vanhassel
Signed-off-by: Ingmar Vanhassel 
---
 _notmuch |   74 ++
 1 files changed, 74 insertions(+), 0 deletions(-)
 create mode 100644 _notmuch

diff --git a/_notmuch b/_notmuch
new file mode 100644
index 000..00c9248
--- /dev/null
+++ b/_notmuch
@@ -0,0 +1,74 @@
+#compdef notmuch
+
+# ZSH completion for `notmuch`
+# Copyright 2009 Ingmar Vanhassel 
+
+_notmuch_commands()
+{
+  local -a notmuch_commands
+  notmuch_commands=(
+'setup:interactively set up notmuch for first use'
+'new:find and import any new message to the database'
+'search:search for messages matching the search terms, display matching 
threads as results'
+'reply:constructs a reply template for a set of messages'
+'show:show all messages matching the search terms'
+'tag:add or remove tags for all messages matching the search terms'
+'dump:creates a plain-text dump of the tags of each message'
+'restore:restores the tags from the given file'
+'help:show details on a command'
+  )
+
+  _describe -t command 'command' notmuch_commands
+}
+
+_notmuch_dump()
+{
+  _files
+}
+
+_notmuch_help_topics()
+{
+  local -a notmuch_help_topics
+  notmuch_help_topics=(
+'search-terms:show common search-terms syntax'
+  )
+  _describe -t notmuch-help-topics 'topic' notmuch_help_topics
+}
+
+_notmuch_help()
+{
+  _alternative \
+_notmuch_commands \
+_notmuch_help_topics
+}
+
+_notmuch_restore()
+{
+  _files
+}
+
+_notmuch_search()
+{
+  _arguments -s : \
+'--max-threads=[display only the first x threads from the search 
results]:number of threads to show: ' \
+'--first=[omit the first x threads from the search results]:number of 
threads to omit: ' \
+'--sort=[sort results]:sorting:((newest-first\:"reverse chronological 
order" oldest-first\:"chronological order"))'
+}
+
+_notmuch()
+{
+  if (( CURRENT > 2 )) ; then
+local cmd=${words[2]}
+curcontext="${curcontext%:*:*}:notmuch-$cmd"
+(( CURRENT-- ))
+shift words
+_call_function ret _notmuch_$cmd
+return ret
+  else
+_notmuch_commands
+  fi
+}
+
+_notmuch "$@"
+
+# vim: set sw=2 sts=2 ts=2 et ft=zsh :
-- 
1.6.5.2.433.g23cdb



[notmuch] [PATCH] Typsos

2009-11-18 Thread Ingmar Vanhassel
---
 Makefile|4 ++--
 README  |6 +++---
 gmime-filter-reply.h|2 +-
 lib/database.cc |2 +-
 lib/index.cc|2 +-
 lib/message.cc  |2 +-
 lib/messages.c  |2 +-
 lib/notmuch-private.h   |2 +-
 lib/notmuch.h   |   10 +-
 lib/sha1.c  |2 +-
 lib/thread.cc   |2 +-
 notmuch-completion.bash |2 +-
 notmuch-new.c   |4 ++--
 notmuch-search.c|2 +-
 notmuch.1   |4 ++--
 notmuch.el  |   10 +-
 show-message.c  |2 +-
 17 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/Makefile b/Makefile
index 436dacf..96aaa73 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Default FLAGS, (can be overriden by user such as "make CFLAGS=-O2")
+# Default FLAGS, (can be overridden by user such as "make CFLAGS=-O2")
 WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum
 CFLAGS=-O2

@@ -14,7 +14,7 @@ override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) 
$(extra_cxxflags)
 override LDFLAGS += `pkg-config --libs glib-2.0 gmime-2.4 talloc` \
`xapian-config --libs`

-# Include our local Makfile.local first so that its first target is default
+# Include our local Makefile.local first so that its first target is default
 include Makefile.local
 include lib/Makefile.local

diff --git a/README b/README
index 40f05ab..27af77f 100644
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ Notmuch - thread-based email index, search and tagging.
 Notmuch is a system for indexing, searching, reading, and tagging
 large collections of email messages. It uses the Xapian library to
 provide fast, full-text search of very large collection of email with
-a very convenient search syntas.
+a very convenient search syntax.

 Notmuch is free software, released under the GNU General Public
 License version 3 (or later).
@@ -45,7 +45,7 @@ obtaining a more sophisticated interface:
notmuch.el file in this distribution.

If someone were to write a curses-based interface, or similar,
-   it might also be reasonable to buil on the "notmuch"
+   it might also be reasonable to build on the "notmuch"
command-line interface.

  2. Build on top of the notmuch library interface.
@@ -67,4 +67,4 @@ still in development. We would appreciate any contributions 
to these
 efforts.


-   
\ No newline at end of file
+   
diff --git a/gmime-filter-reply.h b/gmime-filter-reply.h
index 41cbc13..b7cbc6b 100644
--- a/gmime-filter-reply.h
+++ b/gmime-filter-reply.h
@@ -40,7 +40,7 @@ typedef struct _GMimeFilterReplyClass GMimeFilterReplyClass;
  * @saw_nl: previous char was a \n
  * @saw_angle: previous char was a >
  *
- * A filter to insert/remove reply markers (lines begining with >)
+ * A filter to insert/remove reply markers (lines beginning with >)
  **/
 struct _GMimeFilterReply {
GMimeFilter parent_object;
diff --git a/lib/database.cc b/lib/database.cc
index 3c8d626..27597cf 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -180,7 +180,7 @@ notmuch_status_to_string (notmuch_status_t status)
 case NOTMUCH_STATUS_TAG_TOO_LONG:
return "Tag value is too long (exceeds NOTMUCH_TAG_MAX)";
 case NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW:
-   return "Unblanced number of calls to notmuch_message_freeze/thaw";
+   return "Unbalanced number of calls to notmuch_message_freeze/thaw";
 default:
 case NOTMUCH_STATUS_LAST_STATUS:
return "Unknown error status value";
diff --git a/lib/index.cc b/lib/index.cc
index 65b83b3..80df64b 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -198,7 +198,7 @@ _index_mime_part (notmuch_message_t *message,
if (i == 1)
continue;
if (i > 1)
-   fprintf (stderr, "Warning: Unexpected extra parts of 
mutlipart/signed. Indexing anyway.\n");
+   fprintf (stderr, "Warning: Unexpected extra parts of 
multipart/signed. Indexing anyway.\n");
}
_index_mime_part (message,
  g_mime_multipart_get_part (multipart, i));
diff --git a/lib/message.cc b/lib/message.cc
index a4b090b..1d6623f 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -144,7 +144,7 @@ _notmuch_message_create (const void *talloc_owner,
 }

 /* Create a new notmuch_message_t object for a specific message ID,
- * (which may or may not already exist in the databas).
+ * (which may or may not already exist in the database).
  *
  * Here, 'talloc owner' is an optional talloc context to which the new
  * message will belong. This allows for the caller to not bother
diff --git a/lib/messages.c b/lib/messages.c
index a588f8f..2f7c283 100644
--- a/lib/messages.c
+++ b/lib/messages.c
@@ -47,7 +47,7 @@ _notmuch_message_list_create (const void *ctx)
 return list;
 }

-/* Append 'node' (which can of course point to an aribtrarily