[notmuch] (no subject)

2010-03-12 Thread ing...@exherbo.org
> ubuntu 9.10 and I don't have LDPATH set at all. Thanks, I will try to
> fix that.

Oh, nevermind what I said earlier.

Verify that  /usr/local/lib is in /etc/ld.so.conf. If not add it there. Then 
run ldconfig
after installing notmuch, then it should work. Doing everything with the 
package manager makes
you forget the basics.

Regards,
Ingmar



[notmuch] [PATCH] notmuch-config: make new message tags configurable

2010-03-12 Thread Ben Gamari
Add a new_tags option in the [messages] section of the configuration
file to allow the user to specify which tags should be added to new
messages by notmuch new.
---
 notmuch-client.h |8 ++
 notmuch-config.c |   63 ++
 notmuch-new.c|   14 +--
 3 files changed, 77 insertions(+), 8 deletions(-)

diff --git a/notmuch-client.h b/notmuch-client.h
index c80b39c..1830584 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -171,6 +171,14 @@ notmuch_config_set_user_other_email (notmuch_config_t 
*config,
 const char *other_email[],
 size_t length);

+char **
+notmuch_config_get_new_tags (notmuch_config_t *config,
+size_t *length);
+void
+notmuch_config_set_new_tags (notmuch_config_t *config,
+const char *new_tags[],
+size_t length);
+
 notmuch_bool_t
 debugger_is_active (void);

diff --git a/notmuch-config.c b/notmuch-config.c
index 95430db..b492bc1 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -37,6 +37,12 @@ static const char database_config_comment[] =
 " Notmuch will store its database within a sub-directory of the path\n"
 " configured here named \".notmuch\".\n";

+static const char messages_config_comment[] =
+" Messages configuration\n"
+"\n"
+" The only value supported here is 'new_tags' which lists the tags that\n"
+" should be applied to new messages.\n";
+
 static const char user_config_comment[] =
 " User configuration\n"
 "\n"
@@ -62,6 +68,8 @@ struct _notmuch_config {
 char *user_primary_email;
 char **user_other_email;
 size_t user_other_email_length;
+char **new_tags;
+size_t new_tags_length;
 };

 static int
@@ -169,6 +177,7 @@ notmuch_config_open (void *ctx,
 {
 GError *error = NULL;
 int is_new = 0;
+size_t tmp;
 char *notmuch_config_env = NULL;

 if (is_new_ret)
@@ -199,6 +208,8 @@ notmuch_config_open (void *ctx,
 config->user_primary_email = NULL;
 config->user_other_email = NULL;
 config->user_other_email_length = 0;
+config->new_tags = NULL;
+config->new_tags_length = 0;

 if (! g_key_file_load_from_file (config->key_file,
 config->filename,
@@ -264,6 +275,11 @@ notmuch_config_open (void *ctx,
}
 }

+if (notmuch_config_get_new_tags (config, ) == NULL) {
+const char *tags[] = { "unread", "inbox" };
+   notmuch_config_set_new_tags (config, tags, 2);
+}
+
 /* When we create a new configuration file here, we  add some
  * comments to help the user understand what can be done. */
 if (is_new) {
@@ -271,6 +287,8 @@ notmuch_config_open (void *ctx,
toplevel_config_comment, NULL);
g_key_file_set_comment (config->key_file, "database", NULL,
database_config_comment, NULL);
+   g_key_file_set_comment (config->key_file, "messages", NULL,
+   messages_config_comment, NULL);
g_key_file_set_comment (config->key_file, "user", NULL,
user_config_comment, NULL);
 }
@@ -452,3 +470,48 @@ notmuch_config_set_user_other_email (notmuch_config_t 
*config,
 talloc_free (config->user_other_email);
 config->user_other_email = NULL;
 }
+
+char **
+notmuch_config_get_new_tags (notmuch_config_t *config,
+size_t *length)
+{
+char **tags;
+size_t tags_length;
+unsigned int i;
+
+if (config->new_tags == NULL) {
+   tags = g_key_file_get_string_list (config->key_file,
+  "messages", "new_tags",
+  _length, NULL);
+   if (tags) {
+   config->new_tags = talloc_size (config,
+   sizeof (char *) *
+   (tags_length + 1));
+   for (i = 0; i < tags_length; i++)
+   config->new_tags[i] = talloc_strdup (config->new_tags,
+tags[i]);
+   config->new_tags[i] = NULL;
+
+   g_strfreev (tags);
+
+   config->new_tags_length = tags_length;
+   }
+}
+
+*length = config->new_tags_length;
+return config->new_tags;
+}
+
+void
+notmuch_config_set_new_tags (notmuch_config_t *config,
+const char *new_tags[],
+size_t length)
+{
+g_key_file_set_string_list (config->key_file,
+   "messages", "new_tags",
+   new_tags, length);
+
+talloc_free (config->new_tags);
+config->new_tags = NULL;
+}
+
diff --git a/notmuch-new.c b/notmuch-new.c
index 44b50aa..dd5a5a0 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -35,6 +35,8 @@ typedef struct 

[notmuch] [PATCH] Configurable tags for notmuch new

2010-03-12 Thread Ben Gamari
Hey all,

I had some time today to finally put together a patch to make the tags used by
notmuch new configurable. I added a [messages] section to the .notmuch-config
to hold this new option, although this can be easily changed. Let me know what
you think! Thanks!

- Ben


[notmuch] (no subject)

2010-03-12 Thread Sebastian Spaeth
On Fri, 12 Mar 2010 15:43:10 +, ingmar at exherbo.org wrote:
> What's the value of LDPATH in your environment? It should contain 
> /usr/local/lib.
> If it doesn't that's not an issue with the patch, but with your 
> installation/distro

ubuntu 9.10 and I don't have LDPATH set at all. Thanks, I will try to
fix that.

Sebastian


[notmuch] Notmuch command interface

2010-03-12 Thread Sebastian Spaeth
On Fri, 12 Mar 2010 16:03:34 +0100, Michal Sojka  wrote:
> On Fri, 12 Mar 2010, Sebastian Spaeth wrote:
> > > Unfortunately, I didn't make much progress in implementating this, but
> > > it's definitely a priority for me because I want to get rid of slow
> > > notmuchsync.
> > 
> > notmuchsync master is now using the json output, by the way. I think
> > that suppressing the output of msg bodies in notmuch show will help
> > notmuchsync performance *a lot*.
> 
> I've just tried it :-(
>   File "/usr/lib/pymodules/python2.5/simplejson/decoder.py", line 353, in 
> raw_decode
> raise ValueError("No JSON object could be decoded")
> ValueError: No JSON object could be decoded

Wow, that is bad. All it does is taking "nomuch show" output and feeding
it to the json parser. That probably means that the json was not valid
(which would be bad).

Having said that, I remember that I got that when I used a notmuch that
doesn't include the notmuch tags in the json output, ie you need notmuch
from current master less than 26h ago. Do you use that?

Also Python 2.6 is a requirement, but I see you used that already...
Sebastian 


[notmuch] [PATCH] Change From and Bcc when creating reply draft buffer

2010-03-12 Thread Sebastian Spaeth
On Fri, 12 Mar 2010 10:22:09 -0500, Jameson Rollins  wrote:
> To me it seems the issue here is the distinction between the notmuch
> CLI, and any other reader UI that uses it.  AFAICT, the CLI actually has
> no need to know what "your" email address is, so I don't see why it
> should be configured in the notmuch config.  Your reader on the other
> hand does need to know, so it should be set there.

+1. Except for making the "from:~me" synonym available for searches :)

> This is related to another current pet peeve of mine which is that
> notmuch puts my email address in the Bcc: field in my response template.
> I do not want to bcc myself on my responses.  Generally, I don't think
> it should be the business of the CLI to set any of the header fields in
> mail that I send out.

+1 I agree. The mailer should be putting a BCC in, if that is what the
user wants, not notmuch

Sebastian


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

2010-03-12 Thread Sebastian Spaeth
On Thu, 11 Mar 2010 14:41:09 -0800 (PST), Ben Gamari  wrote:
> On Thu, 04 Mar 2010 09:25:45 +0100, "Sebastian Spaeth"  SSpaeth.de> wrote:
> > I just tried out this patch to compile notmuch as a shared library and
> > while producing lib/libnotmuch.so.1 it fails to find notmuch later:
> 
> Try the version I just posted. It will apply against master and builds on my 
> machine.

Using the updated patch and a stock cworth/master I still got that
error. Using the updated patchset that was just posted and builds on
your work, it compiled and installed fine (but failed to find
libnotmuch.so.1 in /usr/local/lib)

I don't think I have a special setup on this box, so I wonder why it did
not work for me.

spaetz


[notmuch] Notmuch command interface

2010-03-12 Thread Michal Sojka
On Fri, 12 Mar 2010, Sebastian Spaeth wrote:
> > Unfortunately, I didn't make much progress in implementating this, but
> > it's definitely a priority for me because I want to get rid of slow
> > notmuchsync.
> 
> notmuchsync master is now using the json output, by the way. I think
> that suppressing the output of msg bodies in notmuch show will help
> notmuchsync performance *a lot*.

I've just tried it :-(

+ /home/wsh/src/notmuchsync/notmuchsync -s -n -d
20100312 15:59:37 - DEBUG - Execute ['notmuch', 'show', '--format=json', 
'1265813977..1270997977']
Traceback (most recent call last):
  File "/home/wsh/src/notmuchsync/notmuchsync", line 76, in 
all_mails=all_mails)
  File "/home/wsh/src/notmuchsync/notmuch/notmuch.py", line 434, in syncTags
msgs = self.show(searchterm, wholeThread=False)
  File "/home/wsh/src/notmuchsync/notmuch/notmuch.py", line 372, in show
json_forest = json.loads(stdout)
  File "/usr/lib/pymodules/python2.5/simplejson/__init__.py", line 307, in loads
return _default_decoder.decode(s)
  File "/usr/lib/pymodules/python2.5/simplejson/decoder.py", line 335, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/pymodules/python2.5/simplejson/decoder.py", line 353, in 
raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Do you know what's wrong? I use notmuch based on commit
d30049d2b9fd5eb113cd99e88d6fa7b40c36d3c5 (current master).

Michal


[notmuch] (no subject)

2010-03-12 Thread Sebastian Spaeth
On Fri, 12 Mar 2010 14:47:33 +0100, Ingmar Vanhassel  
wrote:
> Here's my updated series for this.

Ben Gamaris original patch gives me an "-lnotmuch" not found failure
during compilation.
Your patchset compiles fine and installs /usr/local/bin/notmuch and
/usr/local/lib/libnotmuch.so.1. However, it doesn't find it when running
and exits saying libnotmuch.so not found.

I don't know anything about LD_LIBRARY_PATH and friends, but using the
default Makefile options (which use /usr/local as prefix) a standard
install should still work :-).

Looking eagerly forward to a shared notmuch library.

spaetz


[notmuch] Notmuch command interface

2010-03-12 Thread Sebastian Spaeth
> Unfortunately, I didn't make much progress in implementating this, but
> it's definitely a priority for me because I want to get rid of slow
> notmuchsync.

notmuchsync master is now using the json output, by the way. I think
that suppressing the output of msg bodies in notmuch show will help
notmuchsync performance *a lot*.

Sebastian


[notmuch] (no subject)

2010-03-12 Thread ing...@exherbo.org
> Ben Gamaris original patch gives me an "-lnotmuch" not found failure
> during compilation.
> Your patchset compiles fine and installs /usr/local/bin/notmuch and
> /usr/local/lib/libnotmuch.so.1. However, it doesn't find it when running
> and exits saying libnotmuch.so not found.

Right, that was the error the second patch fixes. Sorry, honestly couldn't
remember, thanks for testing!

> I don't know anything about LD_LIBRARY_PATH and friends, but using the
> default Makefile options (which use /usr/local as prefix) a standard
> install should still work :-).

What's the value of LDPATH in your environment? It should contain 
/usr/local/lib.
If it doesn't that's not an issue with the patch, but with your 
installation/distro
afaik.



[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 

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 

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] [PATCH] Move notmuch-show functionality to notmuch-show.el

2010-03-12 Thread David Edmondson
To ease the transition to a JSON based implementation of
`notmuch-show', move the current implementation into a separate file.

Signed-off-by: David Edmondson 
---
 emacs/Makefile.local  |2 +-
 emacs/notmuch-show.el |  982 +
 emacs/notmuch.el  |  960 +---
 3 files changed, 984 insertions(+), 960 deletions(-)
 create mode 100644 emacs/notmuch-show.el

diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 17ede86..6bd8617 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -1,5 +1,5 @@
 dir := emacs
-emacs_sources := $(dir)/notmuch.el
+emacs_sources := $(dir)/notmuch.el $(dir)/notmuch-show.el

 emacs_bytecode := $(subst .el,.elc,$(emacs_sources))

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
new file mode 100644
index 000..dd6343d
--- /dev/null
+++ b/emacs/notmuch-show.el
@@ -0,0 +1,982 @@
+;; notmuch-show.el --- display notmuch messages within emacs
+;;
+;; Copyright ? Carl Worth
+;;
+;; 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: Carl Worth 
+
+;; This is an part of an emacs-based interface to the notmuch mail system.
+
+(defvar notmuch-show-stash-map
+  (let ((map (make-sparse-keymap)))
+(define-key map "c" 'notmuch-show-stash-cc)
+(define-key map "d" 'notmuch-show-stash-date)
+(define-key map "F" 'notmuch-show-stash-filename)
+(define-key map "f" 'notmuch-show-stash-from)
+(define-key map "i" 'notmuch-show-stash-message-id)
+(define-key map "s" 'notmuch-show-stash-subject)
+(define-key map "T" 'notmuch-show-stash-tags)
+(define-key map "t" 'notmuch-show-stash-to)
+map)
+  "Submap for stash commands"
+  )
+
+(fset 'notmuch-show-stash-map notmuch-show-stash-map)
+
+(defvar notmuch-show-mode-map
+  (let ((map (make-sparse-keymap)))
+(define-key map "?" 'notmuch-help)
+(define-key map "q" 'kill-this-buffer)
+(define-key map (kbd "C-p") 'notmuch-show-previous-line)
+(define-key map (kbd "C-n") 'notmuch-show-next-line)
+(define-key map (kbd "M-TAB") 'notmuch-show-previous-button)
+(define-key map (kbd "TAB") 'notmuch-show-next-button)
+(define-key map "s" 'notmuch-search)
+(define-key map "m" 'message-mail)
+(define-key map "f" 'notmuch-show-forward-current)
+(define-key map "r" 'notmuch-show-reply)
+(define-key map "|" 'notmuch-show-pipe-message)
+(define-key map "w" 'notmuch-show-save-attachments)
+(define-key map "V" 'notmuch-show-view-raw-message)
+(define-key map "v" 'notmuch-show-view-all-mime-parts)
+(define-key map "c" 'notmuch-show-stash-map)
+(define-key map "b" 'notmuch-show-toggle-current-body)
+(define-key map "h" 'notmuch-show-toggle-current-header)
+(define-key map "-" 'notmuch-show-remove-tag)
+(define-key map "+" 'notmuch-show-add-tag)
+(define-key map "x" 'notmuch-show-archive-thread-then-exit)
+(define-key map "a" 'notmuch-show-archive-thread)
+(define-key map "P" 'notmuch-show-previous-message)
+(define-key map "N" 'notmuch-show-next-message)
+(define-key map "p" 'notmuch-show-previous-open-message)
+(define-key map "n" 'notmuch-show-next-open-message)
+(define-key map (kbd "DEL") 'notmuch-show-rewind)
+(define-key map " " 'notmuch-show-advance-and-archive)
+map)
+  "Keymap for \"notmuch show\" buffers.")
+(fset 'notmuch-show-mode-map notmuch-show-mode-map)
+
+(defvar notmuch-show-signature-regexp "\\(-- ?\\|_+\\)$"
+  "Pattern to match a line that separates content from signature.
+
+The regexp can (and should) include $ to match the end of the
+line, but should not include ^ to match the beginning of the
+line. This is because notmuch may have inserted additional space
+for indentation at the beginning of the line. But notmuch will
+move past the indentation when testing this pattern, (so that the
+pattern can still test against the entire line).")
+
+(defvar notmuch-show-signature-button-format
+  "[ %d-line signature. Click/Enter to toggle visibility. ]"
+  "String used to construct button text for hidden signatures
+
+Can use up to one integer format parameter, i.e. %d")
+
+(defvar notmuch-show-citation-button-format
+  "[ %d more citation lines. Click/Enter to toggle visibility. ]"
+  "String used to construct button text for hidden citations.
+
+Can use up to one 

[notmuch] [PATCH] Add the emacs directory to the load-path when byte compiling

2010-03-12 Thread David Edmondson
When the emacs UI is split into multiple files they are likely to be
interdependent. Adding the emacs directory to the load-path means that
one file will be able to `require' another.

Signed-off-by: David Edmondson 
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 46f001c..f0b96e0 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ quiet ?= $($1)
$(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@

 %.elc: %.el
-   $(call quiet,EMACS) -batch -f batch-byte-compile $<
+   $(call quiet,EMACS) -batch -L emacs -f batch-byte-compile $<

 .deps/%.d: %.c $(global_deps)
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
-- 
1.7.0


dme.
-- 
David Edmondson, http://dme.org


[notmuch] [PATCH] Add the emacs directory to the load-path when byte compiling.

2010-03-12 Thread David Edmondson
Sorry, I just (re?)read the submission guidelines. I'll send another
version that attempts to comply.

dme.
-- 
David Edmondson, http://dme.org


[notmuch] [PATCH] Add the emacs directory to the load-path when byte compiling.

2010-03-12 Thread David Edmondson
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 46f001c..f0b96e0 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ quiet ?= $($1)
$(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@

 %.elc: %.el
-   $(call quiet,EMACS) -batch -f batch-byte-compile $<
+   $(call quiet,EMACS) -batch -L emacs -f batch-byte-compile $<

 .deps/%.d: %.c $(global_deps)
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
-- 
1.7.0



[notmuch] [PATCH] Change From and Bcc when creating reply draft buffer

2010-03-12 Thread Jameson Rollins
On Fri, 12 Mar 2010 08:49:35 +0100, Michal Sojka  wrote:
> Hmm, I understand. My worry about this approach is the following: Now it
> is very straightforward to start using notmuch. You only answer a few
> questions when you run notmuch for the first time and then it works. If
> we apply your patch, some additional configuration is needed and a
> novice might not know how to do it.

To me it seems the issue here is the distinction between the notmuch
CLI, and any other reader UI that uses it.  AFAICT, the CLI actually has
no need to know what "your" email address is, so I don't see why it
should be configured in the notmuch config.  Your reader on the other
hand does need to know, so it should be set there.

This is related to another current pet peeve of mine which is that
notmuch puts my email address in the Bcc: field in my response template.
I do not want to bcc myself on my responses.  Generally, I don't think
it should be the business of the CLI to set any of the header fields in
mail that I send out.

In short, the CLI should deal with indexing my mail.  It really has no
need to know who I am.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20100312/17577baf/attachment.pgp>


[notmuch] Notmuch command interface

2010-03-12 Thread Sebastian Spaeth
> To avoid breaking the current behavior, what if the set of tags applied to 
> new/moved/deleted(?) messages could be set on the command line or some 
> other library interface, while just perhaps defaulting to unread/inbox? 
> This would support both the current behavior and a hooks-like workflow 
> without notmuch itself treating any tags (new, unread, inbox, etc.) as 
> "special".

+1. For some, the default "inbox unread" might just be the correct
thing, while others may want "new". I know that I don't need any special
tag for new mails, as I applied the "sync maildir flags" patch. So
configurable in .notmuch-config with a default of "inbox unread" to keep
behavior consistent seems the best way to me.

Sebastian


[notmuch] [PATCH] Change From and Bcc when creating reply draft buffer

2010-03-12 Thread James Vasile
On Fri, 12 Mar 2010 08:49:35 +0100, Michal Sojka  wrote:
> On Thu, 11 Mar 2010, James Vasile wrote:
> > On Thu, 11 Mar 2010 17:22:41 +0100, Michal Sojka  
> > wrote:
> > > thanks for clarification. It all sounds reasonable. The only problem I
> > > can see now is that if I create a new account on my machine and run
> > > emacs there, then the value of user-mail-address is @
> > > which doesn't refer to existing mailbox. I think that the header should
> > > only be rewritten if these variables are known to have valid values. Do
> > > you know how to do this?
> > > 
> > 
> > I explicitly set these in my .emacs file, so I don't do any detection.
> > If you could define "valid" I suppose you could test for such things.
> > 
> > Something like the following works for me.  I run mail-profile-foo with
> > M-x or run it automatically with profile-guessing/setting routines.
> > When I get the system ironed out, I'll emit patches and a wiki entry.
> > 
> > (defun message-mode-set-profile ()
> >   (save-excursion
> > (when (string= "message-mode" major-mode)
> >   (goto-char (point-min))
> >   (when (re-search-forward "^From: " nil t)
> > (kill-line)
> > (insert (format "%s <%s>" user-full-name user-mail-address)))
> > 
> >   (goto-char (point-min))
> >   (when (re-search-forward "^Bcc: " nil t)
> > (kill-line)
> > (insert (format "%s <%s>" user-full-name user-mail-address))
> > 
> > (defun mail-profile-hv ()
> >   (interactive)
> >   (setq mail-host-address "hackervisions.org"
> >   user-full-name "James Vasile"
> >   message-sendmail-extra-arguments '("-a" "hv")
> >   user-mail-address "james at hackervisions.org")
> >   (message-mode-set-profile)
> >   user-mail-address)
> > (mail-profile-hv)
> > 
> > 
> 
> Hmm, I understand. My worry about this approach is the following: Now it
> is very straightforward to start using notmuch. You only answer a few
> questions when you run notmuch for the first time and then it works. If
> we apply your patch, some additional configuration is needed and a
> novice might not know how to do it.

I disagree as to how much time notmuch currently takes.  To get a
workable setup, you need to answer a few questions, setup offlineimap,
write a tagging script, setup up folders, apply a bunch of patches,
etc.  

I've been telling people to wait 6 months instead of trying notmuch.
That's based on how much work it is to setup, incomplete MUA, bugs, etc.

> So at least notmuch should tell the user what and where needs to be
> configured. Or better, provide some sane default which can be overridden
> in a way you want it.
> 
> That's only my opinion. I personally would have no problem with
> additional configuration, but on the other side I like programs which do
> not steel my time if it is not necessary.

That's a fair point.  I hope notmuch gets easier over time, and one of
the things I'd like to implement is sane defaults.  As notmuch gets more
user friendly, I'd like to make the pieces I write less onerous to
configure.

For example, I have some stub code for a default profile that pulls
values from ~/.notmuch.  Then if the user doesn't do the setup, things
should be not much different than they are now.

-J


[notmuch] Notmuch command interface

2010-03-12 Thread Michal Sojka
On Thu, 11 Mar 2010, David A Benjamin wrote:
> On Thu, 11 Mar 2010, Ben Gamari wrote:
> > While the notmuch command-line interface is fantastic, there defintely are 
> > a few
> > gaps which hurt performance. Since I've been following, I've seen several
> > threads on how to handle message addition and initial tagging[1][2]. I 
> > recall
> > that some time ago Carl had the idea of applying only a 'new' tag during 
> > notmuch
> > new. I strongly supported this proposal yet it seems that nothing ever 
> > became of
> > it. Is there a reason for this? Would a patch be accepted?
> >
> 
> To avoid breaking the current behavior, what if the set of tags applied to 
> new/moved/deleted(?) messages could be set on the command line or some 
> other library interface, while just perhaps defaulting to unread/inbox? 
> This would support both the current behavior and a hooks-like workflow 
> without notmuch itself treating any tags (new, unread, inbox, etc.) as 
> "special".

Hi,

in id:87ljecmnbd.fsf at steelpick.localdomain, I outlined my idea about
mail store abstraction. To go on with the idea, I think that the set of
initial tags should be determined by mail store implementation.
Currently I think that new messages should be tagged as follows:

1) immutable file-based mail store: inbox + unread (backward compatibility
   with current notmuch)

2) Maildir-based mail store: inbox + tags derived from maildir flags.

3) git-based mail store: arbitrary tags stored in git repository (perhaps
   by MDA).

In 3) you could therfore use any policy you want to do initial tagging
of your messages. What do you think?

Unfortunately, I didn't make much progress in implementating this, but
it's definitely a priority for me because I want to get rid of slow
notmuchsync.

Cheers,
Michal


[notmuch] [PATCH] Change From and Bcc when creating reply draft buffer

2010-03-12 Thread Michal Sojka
On Thu, 11 Mar 2010, James Vasile wrote:
> On Thu, 11 Mar 2010 17:22:41 +0100, Michal Sojka  
> wrote:
> > thanks for clarification. It all sounds reasonable. The only problem I
> > can see now is that if I create a new account on my machine and run
> > emacs there, then the value of user-mail-address is @
> > which doesn't refer to existing mailbox. I think that the header should
> > only be rewritten if these variables are known to have valid values. Do
> > you know how to do this?
> > 
> 
> I explicitly set these in my .emacs file, so I don't do any detection.
> If you could define "valid" I suppose you could test for such things.
> 
> Something like the following works for me.  I run mail-profile-foo with
> M-x or run it automatically with profile-guessing/setting routines.
> When I get the system ironed out, I'll emit patches and a wiki entry.
> 
> (defun message-mode-set-profile ()
>   (save-excursion
> (when (string= "message-mode" major-mode)
>   (goto-char (point-min))
>   (when (re-search-forward "^From: " nil t)
>   (kill-line)
>   (insert (format "%s <%s>" user-full-name user-mail-address)))
> 
>   (goto-char (point-min))
>   (when (re-search-forward "^Bcc: " nil t)
>   (kill-line)
>   (insert (format "%s <%s>" user-full-name user-mail-address))
> 
> (defun mail-profile-hv ()
>   (interactive)
>   (setq mail-host-address "hackervisions.org"
>   user-full-name "James Vasile"
>   message-sendmail-extra-arguments '("-a" "hv")
>   user-mail-address "james at hackervisions.org")
>   (message-mode-set-profile)
>   user-mail-address)
> (mail-profile-hv)
> 
> 

Hmm, I understand. My worry about this approach is the following: Now it
is very straightforward to start using notmuch. You only answer a few
questions when you run notmuch for the first time and then it works. If
we apply your patch, some additional configuration is needed and a
novice might not know how to do it.

So at least notmuch should tell the user what and where needs to be
configured. Or better, provide some sane default which can be overridden
in a way you want it.

That's only my opinion. I personally would have no problem with
additional configuration, but on the other side I like programs which do
not steel my time if it is not necessary.

Bye
-Michal


[notmuch] [PATCH] Add the emacs directory to the load-path when byte compiling.

2010-03-12 Thread David Edmondson
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 46f001c..f0b96e0 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ quiet ?= $($1)
$(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $ -o $@
 
 %.elc: %.el
-   $(call quiet,EMACS) -batch -f batch-byte-compile $
+   $(call quiet,EMACS) -batch -L emacs -f batch-byte-compile $
 
 .deps/%.d: %.c $(global_deps)
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
-- 
1.7.0

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


[notmuch] [PATCH] Add the emacs directory to the load-path when byte compiling

2010-03-12 Thread David Edmondson
When the emacs UI is split into multiple files they are likely to be
interdependent. Adding the emacs directory to the load-path means that
one file will be able to `require' another.

Signed-off-by: David Edmondson d...@dme.org
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 46f001c..f0b96e0 100644
--- a/Makefile
+++ b/Makefile
@@ -68,7 +68,7 @@ quiet ?= $($1)
$(call quiet,CC,$(CFLAGS)) -c $(FINAL_CFLAGS) $ -o $@
 
 %.elc: %.el
-   $(call quiet,EMACS) -batch -f batch-byte-compile $
+   $(call quiet,EMACS) -batch -L emacs -f batch-byte-compile $
 
 .deps/%.d: %.c $(global_deps)
@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
-- 
1.7.0


dme.
-- 
David Edmondson, http://dme.org
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[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


Re: [notmuch] Notmuch command interface

2010-03-12 Thread Sebastian Spaeth
 Unfortunately, I didn't make much progress in implementating this, but
 it's definitely a priority for me because I want to get rid of slow
 notmuchsync.

notmuchsync master is now using the json output, by the way. I think
that suppressing the output of msg bodies in notmuch show will help
notmuchsync performance *a lot*.

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


Re: [notmuch] (no subject)

2010-03-12 Thread Sebastian Spaeth
On Fri, 12 Mar 2010 14:47:33 +0100, Ingmar Vanhassel ing...@exherbo.org wrote:
 Here's my updated series for this.

Ben Gamaris original patch gives me an -lnotmuch not found failure
during compilation.
Your patchset compiles fine and installs /usr/local/bin/notmuch and
/usr/local/lib/libnotmuch.so.1. However, it doesn't find it when running
and exits saying libnotmuch.so not found.

I don't know anything about LD_LIBRARY_PATH and friends, but using the
default Makefile options (which use /usr/local as prefix) a standard
install should still work :-).

Looking eagerly forward to a shared notmuch library.

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


Re: [notmuch] [PATCH] Change From and Bcc when creating reply draft buffer

2010-03-12 Thread Jameson Rollins
On Fri, 12 Mar 2010 08:49:35 +0100, Michal Sojka sojk...@fel.cvut.cz wrote:
 Hmm, I understand. My worry about this approach is the following: Now it
 is very straightforward to start using notmuch. You only answer a few
 questions when you run notmuch for the first time and then it works. If
 we apply your patch, some additional configuration is needed and a
 novice might not know how to do it.

To me it seems the issue here is the distinction between the notmuch
CLI, and any other reader UI that uses it.  AFAICT, the CLI actually has
no need to know what your email address is, so I don't see why it
should be configured in the notmuch config.  Your reader on the other
hand does need to know, so it should be set there.

This is related to another current pet peeve of mine which is that
notmuch puts my email address in the Bcc: field in my response template.
I do not want to bcc myself on my responses.  Generally, I don't think
it should be the business of the CLI to set any of the header fields in
mail that I send out.

In short, the CLI should deal with indexing my mail.  It really has no
need to know who I am.

jamie.


pgpYm5JQPX5uP.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [notmuch] [PATCH] Change From and Bcc when creating reply draft buffer

2010-03-12 Thread Sebastian Spaeth
On Fri, 12 Mar 2010 10:22:09 -0500, Jameson Rollins 
jroll...@finestructure.net wrote:
 To me it seems the issue here is the distinction between the notmuch
 CLI, and any other reader UI that uses it.  AFAICT, the CLI actually has
 no need to know what your email address is, so I don't see why it
 should be configured in the notmuch config.  Your reader on the other
 hand does need to know, so it should be set there.

+1. Except for making the from:~me synonym available for searches :)

 This is related to another current pet peeve of mine which is that
 notmuch puts my email address in the Bcc: field in my response template.
 I do not want to bcc myself on my responses.  Generally, I don't think
 it should be the business of the CLI to set any of the header fields in
 mail that I send out.

+1 I agree. The mailer should be putting a BCC in, if that is what the
user wants, not notmuch

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


Re: [notmuch] Notmuch command interface

2010-03-12 Thread Sebastian Spaeth
On Fri, 12 Mar 2010 16:03:34 +0100, Michal Sojka sojk...@fel.cvut.cz wrote:
 On Fri, 12 Mar 2010, Sebastian Spaeth wrote:
   Unfortunately, I didn't make much progress in implementating this, but
   it's definitely a priority for me because I want to get rid of slow
   notmuchsync.
  
  notmuchsync master is now using the json output, by the way. I think
  that suppressing the output of msg bodies in notmuch show will help
  notmuchsync performance *a lot*.
 
 I've just tried it :-(
   File /usr/lib/pymodules/python2.5/simplejson/decoder.py, line 353, in 
 raw_decode
 raise ValueError(No JSON object could be decoded)
 ValueError: No JSON object could be decoded

Wow, that is bad. All it does is taking nomuch show output and feeding
it to the json parser. That probably means that the json was not valid
(which would be bad).

Having said that, I remember that I got that when I used a notmuch that
doesn't include the notmuch tags in the json output, ie you need notmuch
from current master less than 26h ago. Do you use that?

Also Python 2.6 is a requirement, but I see you used that already...
Sebastian 
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [notmuch] (no subject)

2010-03-12 Thread Sebastian Spaeth
On Fri, 12 Mar 2010 15:43:10 +, ing...@exherbo.org wrote:
 What's the value of LDPATH in your environment? It should contain 
 /usr/local/lib.
 If it doesn't that's not an issue with the patch, but with your 
 installation/distro

ubuntu 9.10 and I don't have LDPATH set at all. Thanks, I will try to
fix that.

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


Re: [notmuch] (no subject)

2010-03-12 Thread ingmar
 ubuntu 9.10 and I don't have LDPATH set at all. Thanks, I will try to
 fix that.

Oh, nevermind what I said earlier.

Verify that  /usr/local/lib is in /etc/ld.so.conf. If not add it there. Then 
run ldconfig
after installing notmuch, then it should work. Doing everything with the 
package manager makes
you forget the basics.

Regards,
Ingmar

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