unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* (no subject)
@ 2009-11-25  2:03 Bart Trojanowski
  0 siblings, 0 replies; 28+ messages in thread
From: Bart Trojanowski @ 2009-11-25  2:03 UTC (permalink / raw)
  To: notmuch

Hi,

I find this patch useful for searching my mail.  I realize that the
option is horrendously long, and I would take any suggestions to shorten
it or to use a short op, like -m.

-Bart

^ permalink raw reply	[flat|nested] 28+ messages in thread

* (no subject)
  2009-12-25 19:53 [PATCH] notmuch.el: add a submap (on "z" for "ztash") to stash things david
@ 2009-12-27  3:51 ` david
  0 siblings, 0 replies; 28+ messages in thread
From: david @ 2009-12-27  3:51 UTC (permalink / raw)
  To: notmuch

Thanks to Micah Anderson on IRC for pointing out that the previous
version of this patch broke '?' in notmuch-show mode.  This was
arguably a bug in the notmuch help code, fixed in patch 2 of the
series.  I wouldn't be surprised if 'map-keymap' could be used other
places in the code, but I kept things minimal-ish.  The first patch 
has been revised to actually include documentation strings (blush).

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Notmuch shared library
@ 2010-03-11 22:37 Ben Gamari
  2010-03-11 22:37 ` [PATCH] Build and link against notmuch " Ben Gamari
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Ben Gamari @ 2010-03-11 22:37 UTC (permalink / raw)
  To: notmuch

Hey all,

Here's a rebased version of my shared library patch. It's pretty similar to the
last version and should build against a clean tree (I'd recommend git clean -fxd).
Let me know if you have any build issues.

In the eyes of the powers that be, what is the long-term status of this patch?
It's been pretty painless to rebase, but it would be nice to merge at some
point. Then perhaps we could focus a bit on the bindings situation. Just a
thought.

Cheers,

- Ben

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH] Build and link against notmuch shared library
  2010-03-11 22:37 Notmuch shared library Ben Gamari
@ 2010-03-11 22:37 ` Ben Gamari
  2010-03-12 13:41 ` (no subject) Ingmar Vanhassel
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 28+ messages in thread
From: Ben Gamari @ 2010-03-11 22:37 UTC (permalink / raw)
  To: notmuch

---
 .gitignore         |    1 +
 Makefile           |    1 +
 Makefile.local     |    9 ++++++---
 lib/Makefile.local |   11 ++++++-----
 4 files changed, 14 insertions(+), 8 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..38cecd1 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -20,18 +20,21 @@ 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)/share/man/man1 \
+		$(DESTDIR)$(prefix)/lib/ ; \
 	do \
 		install -d $$d ; \
 	done ;
 	install notmuch $(DESTDIR)$(prefix)/bin/
+	install lib/$(SONAME) $(DESTDIR)$(prefix)/lib/
+	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..a6462ae 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -1,5 +1,5 @@
-dir := lib
-extra_cflags += -I$(dir)
+dir=lib
+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

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* (no subject)
  2010-03-11 22:37 Notmuch shared library Ben Gamari
  2010-03-11 22:37 ` [PATCH] Build and link against notmuch " Ben Gamari
@ 2010-03-12 13:41 ` Ingmar Vanhassel
  2010-03-15 17:58   ` Ben Gamari
  2010-03-12 13:47 ` Ingmar Vanhassel
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 28+ messages in thread
From: Ingmar Vanhassel @ 2010-03-12 13:41 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* (no subject)
  2010-03-11 22:37 Notmuch shared library Ben Gamari
  2010-03-11 22:37 ` [PATCH] Build and link against notmuch " Ben Gamari
  2010-03-12 13:41 ` (no subject) Ingmar Vanhassel
@ 2010-03-12 13:47 ` Ingmar Vanhassel
  2010-03-12 15:02   ` Sebastian Spaeth
  2010-04-01  7:54   ` Notmuch shared library Carl Worth
  2010-03-12 13:47 ` [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h Ingmar Vanhassel
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 28+ messages in thread
From: Ingmar Vanhassel @ 2010-03-12 13:47 UTC (permalink / raw)
  To: notmuch

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. :)

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h
  2010-03-11 22:37 Notmuch shared library Ben Gamari
                   ` (2 preceding siblings ...)
  2010-03-12 13:47 ` Ingmar Vanhassel
@ 2010-03-12 13:47 ` Ingmar Vanhassel
  2010-03-28  2:44   ` Ben Gamari
  2010-03-12 13:47 ` [PATCH 2/3] Fix target dependencies for multiple jobs Ingmar Vanhassel
  2010-03-12 13:47 ` [PATCH 3/3] Add a --libdir option to ./configure Ingmar Vanhassel
  5 siblings, 1 reply; 28+ messages in thread
From: Ingmar Vanhassel @ 2010-03-12 13:47 UTC (permalink / raw)
  To: notmuch

From: Ben Gamari <bgamari.foss@gmail.com>

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
---
 .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

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 2/3] Fix target dependencies for multiple jobs
  2010-03-11 22:37 Notmuch shared library Ben Gamari
                   ` (3 preceding siblings ...)
  2010-03-12 13:47 ` [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h Ingmar Vanhassel
@ 2010-03-12 13:47 ` Ingmar Vanhassel
  2010-03-12 13:47 ` [PATCH 3/3] Add a --libdir option to ./configure Ingmar Vanhassel
  5 siblings, 0 replies; 28+ messages in thread
From: Ingmar Vanhassel @ 2010-03-12 13:47 UTC (permalink / raw)
  To: notmuch; +Cc: Saleem Abdulrasool

From: Saleem Abdulrasool <compnerd@compnerd.org>

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
---
 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

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 3/3] Add a --libdir option to ./configure
  2010-03-11 22:37 Notmuch shared library Ben Gamari
                   ` (4 preceding siblings ...)
  2010-03-12 13:47 ` [PATCH 2/3] Fix target dependencies for multiple jobs Ingmar Vanhassel
@ 2010-03-12 13:47 ` Ingmar Vanhassel
  5 siblings, 0 replies; 28+ messages in thread
From: Ingmar Vanhassel @ 2010-03-12 13:47 UTC (permalink / raw)
  To: notmuch

This allows packagers to specify to which directory libraries should be
installed.

Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
---
 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

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: (no subject)
  2010-03-12 13:47 ` Ingmar Vanhassel
@ 2010-03-12 15:02   ` Sebastian Spaeth
  2010-03-15 16:20     ` Sebastian Spaeth
  2010-04-01  7:54   ` Notmuch shared library Carl Worth
  1 sibling, 1 reply; 28+ messages in thread
From: Sebastian Spaeth @ 2010-03-12 15:02 UTC (permalink / raw)
  To: Ingmar Vanhassel, notmuch

On Fri, 12 Mar 2010 14:47:33 +0100, Ingmar Vanhassel <ingmar@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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: (no subject)
@ 2010-03-12 15:43 ingmar
  2010-03-12 16:06 ` Sebastian Spaeth
  0 siblings, 1 reply; 28+ messages in thread
From: ingmar @ 2010-03-12 15:43 UTC (permalink / raw)
  To: notmuch

> 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.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: (no subject)
  2010-03-12 15:43 ingmar
@ 2010-03-12 16:06 ` Sebastian Spaeth
  0 siblings, 0 replies; 28+ messages in thread
From: Sebastian Spaeth @ 2010-03-12 16:06 UTC (permalink / raw)
  To: ingmar, notmuch

On Fri, 12 Mar 2010 15:43:10 +0000, ingmar@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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: (no subject)
@ 2010-03-12 18:46 ingmar
  2010-03-15 16:22 ` Sebastian Spaeth
  0 siblings, 1 reply; 28+ messages in thread
From: ingmar @ 2010-03-12 18:46 UTC (permalink / raw)
  To: notmuch

> 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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: (no subject)
  2010-03-12 15:02   ` Sebastian Spaeth
@ 2010-03-15 16:20     ` Sebastian Spaeth
  0 siblings, 0 replies; 28+ messages in thread
From: Sebastian Spaeth @ 2010-03-15 16:20 UTC (permalink / raw)
  To: Ingmar Vanhassel, notmuch

On Fri, 12 Mar 2010 16:02:03 +0100, "Sebastian Spaeth" <Sebastian@SSpaeth.de> wrote:
> On Fri, 12 Mar 2010 14:47:33 +0100, Ingmar Vanhassel <ingmar@exherbo.org> wrote:
> 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.

DOH, a simple "sudo ldconfig" fixed the issue on a stock Ubuntu on my
box. Your patch series works fine.



I just tested the shared lib by creating a small python binding to libnotmuch
which can be found here: http://bitbucket.org/spaetz/cnotmuch
(It basically does not bind many things yet :-), but it demos that it
works in general).

This is my sample session:
>>>from cnotmuch import notmuch
>>>db = notmuch.Database()
>>>db.get_path()
'/home/spaetz/mail'
>>>tags = db.get_all_tags()
inited tags with 44762960 'Notmuch DB /home/spaetz/mail'
>>>for tag in tags: 
>>>  print tag
inbox
...
maildir::draft
Freeing the Tags now

#---------------------------------------------

>>>db = notmuch.Database("/home/spaetz/mailHAHA")
NotmuchError: Could not open the specified database

#---------------------------------------------

>>>tags = notmuch.Database("/home/spaetz/mail").get_all_tags()
>>>del(tags)
Freeing the Tags now
Freeing the database now

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: (no subject)
  2010-03-12 18:46 (no subject) ingmar
@ 2010-03-15 16:22 ` Sebastian Spaeth
  0 siblings, 0 replies; 28+ messages in thread
From: Sebastian Spaeth @ 2010-03-15 16:22 UTC (permalink / raw)
  To: notmuch

On Fri, 12 Mar 2010 18:46:02 +0000, ingmar@exherbo.org wrote:
> > 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.

As, I just said in a different reply. Running "sudo ldconfig" fixed it on
a stock Ubuntu system.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: (no subject)
  2010-03-12 13:41 ` (no subject) Ingmar Vanhassel
@ 2010-03-15 17:58   ` Ben Gamari
  0 siblings, 0 replies; 28+ messages in thread
From: Ben Gamari @ 2010-03-15 17:58 UTC (permalink / raw)
  To: Ingmar Vanhassel, notmuch

On Fri, 12 Mar 2010 14:41:22 +0100, Ingmar Vanhassel <ingmar@exherbo.org> wrote:
> I was just going to mail an updated series for this. I'd definitely like to see
> this upstream.
> 
I agree. It would be quite nice to finally have to this merged.

> 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?

Oops, I guess I lost track of it. My bad, things have been pretty scattered in
my world recently. Either way, it looks like you have the shared library thing
covered with this patch set. It is definitely much more refined than mine. I'd
definitely be in favor of this going in. Thanks for your work.

- Ben

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h
  2010-03-12 13:47 ` [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h Ingmar Vanhassel
@ 2010-03-28  2:44   ` Ben Gamari
  0 siblings, 0 replies; 28+ messages in thread
From: Ben Gamari @ 2010-03-28  2:44 UTC (permalink / raw)
  To: Ingmar Vanhassel, notmuch

Does anyone have this queued up to be merged upstream? I think we're beginning
to see the need for a library at this point and as far as I can see, this is an
excellent patch for it.

- Ben

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>

On Fri, 12 Mar 2010 14:47:34 +0100, Ingmar Vanhassel <ingmar@exherbo.org> wrote:
> From: Ben Gamari <bgamari.foss@gmail.com>
> 
> Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
> ---
>  .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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Notmuch shared library
  2010-03-12 13:47 ` Ingmar Vanhassel
  2010-03-12 15:02   ` Sebastian Spaeth
@ 2010-04-01  7:54   ` Carl Worth
  2010-04-01  9:10     ` Sebastian Spaeth
                       ` (2 more replies)
  1 sibling, 3 replies; 28+ messages in thread
From: Carl Worth @ 2010-04-01  7:54 UTC (permalink / raw)
  To: Ingmar Vanhassel, notmuch

[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]

On Fri, 12 Mar 2010 14:47:33 +0100, Ingmar Vanhassel <ingmar@exherbo.org> wrote:
> I'd very much like to see this upstream.

Me too. ;-) Sorry for the long delay.

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

A very nice addition.

> The second patch fixed some parallel make issue I had while testing
> your series.

As is this. I ran into this problem immediately when testing the first
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.

This configure option is nice too, but the problem you pointed out was
serious, (so, thanks for noting it). I went ahead and fixed this.

I also spent some time making sure I (think I) understand how library
sonames and library versions work. I did several investigations with
libtool that convinced me it adds problems without any tangible benefit,
(at least for the target platforms I'm aware of people using with
notmuch).

I finished this by establishing a 3-part library interface version,
(initially 1.0.0), along with careful documentation in the Makefile on
how to increment it. And of course, I ended up touching up about a
half-dozen issues in the Makefiles along the way.

We'll still want to add functions/macros to the library to make the
library version available to the user. And I do want to still add some
symbol hiding and potentially some symbol versioning to the library. But
I'm not making the patch series block on that.

Finally, I'm a tiny bit annoyed that now after a fresh checkout of
notmuch and "make" that one can't easily run ./notmuch without either
installing the library (or fiddling with LD_LIBRARY_PATH). I've got some
ideas on how to simplify that, but I'm not sure if any are good or worth
it.

Anyway, this patch series is now pushed with my changes on top. Thanks,
Ben and Ingmar!

-Carl




[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Notmuch shared library
  2010-04-01  7:54   ` Notmuch shared library Carl Worth
@ 2010-04-01  9:10     ` Sebastian Spaeth
  2010-04-01 11:10     ` Michal Sojka
  2010-04-01 11:47     ` [PATCH] Makefile: Create include directory when installing headers Michal Sojka
  2 siblings, 0 replies; 28+ messages in thread
From: Sebastian Spaeth @ 2010-04-01  9:10 UTC (permalink / raw)
  To: notmuch

On Thu, 01 Apr 2010 00:54:16 -0700, Carl Worth <cworth@cworth.org> wrote:
> Finally, I'm a tiny bit annoyed that now after a fresh checkout of
> notmuch and "make" that one can't easily run ./notmuch without either
> installing the library (or fiddling with LD_LIBRARY_PATH). I've got some
> ideas on how to simplify that, but I'm not sure if any are good or worth
> it.

That was admittedly a very nice feature. And as I have proposed (but not
send any patch :-)). I would argue that a --shared and a --static option
(or whatever configure standard policy is for that) would make sense
that links notmuch either dynamically or statically.

But thanks for doing this work. Much appreciated
Sebastian

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Notmuch shared library
  2010-04-01  7:54   ` Notmuch shared library Carl Worth
  2010-04-01  9:10     ` Sebastian Spaeth
@ 2010-04-01 11:10     ` Michal Sojka
  2010-04-01 11:24       ` martin f krafft
  2010-04-01 11:47     ` [PATCH] Makefile: Create include directory when installing headers Michal Sojka
  2 siblings, 1 reply; 28+ messages in thread
From: Michal Sojka @ 2010-04-01 11:10 UTC (permalink / raw)
  To: Carl Worth, Ingmar Vanhassel, notmuch

On Thu, 01 Apr 2010, Carl Worth wrote:
> Finally, I'm a tiny bit annoyed that now after a fresh checkout of
> notmuch and "make" that one can't easily run ./notmuch without either
> installing the library (or fiddling with LD_LIBRARY_PATH). I've got some
> ideas on how to simplify that, but I'm not sure if any are good or worth
> it.

Hi,

this can be solved by the following patch, but I don't know how portable
it is. You can see the efect of this by

$ objdump -x notmuch|grep RPATH

diff --git a/Makefile.local b/Makefile.local
index 32b8f4a..2a1b55d 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -20,7 +20,7 @@ extra_cxxflags :=
 # Smash together user's values with our extra values
 FINAL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
-FINAL_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS)
+FINAL_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS) -Wl,-rpath,\$$ORIGIN/lib -z origin --enable-new-dtags
 
 all: notmuch notmuch.1.gz
 ifeq ($(MAKECMDGOALS),)

--Michal

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: Notmuch shared library
  2010-04-01 11:10     ` Michal Sojka
@ 2010-04-01 11:24       ` martin f krafft
  2010-04-01 11:41         ` martin f krafft
  2010-04-01 12:12         ` Carl Worth
  0 siblings, 2 replies; 28+ messages in thread
From: martin f krafft @ 2010-04-01 11:24 UTC (permalink / raw)
  To: Michal Sojka; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

also sprach Michal Sojka <sojkam1@fel.cvut.cz> [2010.04.01.1310 +0200]:
> this can be solved by the following patch, but I don't know how portable
> it is. You can see the efect of this by

Please avoid rpath. The better solution is probably to create
a wrapper for notmuch, which prepends to LD_LIBRARY_PATH.

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
when everything is coming your way, you're in the wrong lane.
 
spamtraps: madduck.bogus@madduck.net

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Notmuch shared library
  2010-04-01 11:24       ` martin f krafft
@ 2010-04-01 11:41         ` martin f krafft
  2010-04-01 12:12         ` Carl Worth
  1 sibling, 0 replies; 28+ messages in thread
From: martin f krafft @ 2010-04-01 11:41 UTC (permalink / raw)
  To: Michal Sojka, Carl Worth, Ingmar Vanhassel, notmuch

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

also sprach martin f krafft <madduck@madduck.net> [2010.04.01.1324 +0200]:
> Please avoid rpath. The better solution is probably to create
> a wrapper for notmuch, which prepends to LD_LIBRARY_PATH.

E.g. http://wiki.debian.org/RpathIssue

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
a common mistake that people make
when trying to design something completely foolproof
was to underestimate the ingenuity of complete fools.
                                 -- douglas adams, "mostly harmless"
 
spamtraps: madduck.bogus@madduck.net

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH] Makefile: Create include directory when installing headers
  2010-04-01  7:54   ` Notmuch shared library Carl Worth
  2010-04-01  9:10     ` Sebastian Spaeth
  2010-04-01 11:10     ` Michal Sojka
@ 2010-04-01 11:47     ` Michal Sojka
  2010-04-01 12:13       ` Carl Worth
  2 siblings, 1 reply; 28+ messages in thread
From: Michal Sojka @ 2010-04-01 11:47 UTC (permalink / raw)
  To: notmuch

When I wanted to create a debian package from the current master, make
install failed because of non-existent include directory. This patch
fixes this minor issue.
---
 lib/Makefile.local |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/Makefile.local b/lib/Makefile.local
index 0fd843a..85b010e 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -54,6 +54,7 @@ install-$(dir):
 	$(call quiet_install_data, $(dir)/$(LIBNAME) $(DESTDIR)$(libdir)/)
 	$(call quiet_symlink, $(LIBNAME) $(DESTDIR)$(libdir)/$(SONAME))
 	$(call quiet_symlink, $(LIBNAME) $(DESTDIR)$(libdir)/$(LINKER_NAME))
+	$(call quiet_mkdir, $(DESTDIR)$(prefix)/include/)
 	$(call quiet_install_data, $(dir)/notmuch.h $(DESTDIR)$(prefix)/include/)
 
 SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
-- 
1.7.0.2

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: Notmuch shared library
  2010-04-01 11:24       ` martin f krafft
  2010-04-01 11:41         ` martin f krafft
@ 2010-04-01 12:12         ` Carl Worth
  2010-04-01 12:44           ` Michal Sojka
  1 sibling, 1 reply; 28+ messages in thread
From: Carl Worth @ 2010-04-01 12:12 UTC (permalink / raw)
  To: martin f krafft, Michal Sojka; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 989 bytes --]

On Thu, 1 Apr 2010 13:24:22 +0200, martin f krafft <madduck@madduck.net> wrote:
> also sprach Michal Sojka <sojkam1@fel.cvut.cz> [2010.04.01.1310 +0200]:
> > this can be solved by the following patch, but I don't know how portable
> > it is. You can see the efect of this by
> 
> Please avoid rpath. The better solution is probably to create
> a wrapper for notmuch, which prepends to LD_LIBRARY_PATH.

So now should actually list some of the ideas I had:

1. Use rpath for the local notmuch, (and use chrpath to remove it at the
   time of "make install").

2. Create a little shell script that calls LD_LIBRARY_PATH locally, but
   then install the real program, (not very unlike what libtool does).

3. Create a static program locally, but install a shared version.

4. Create a static program by default, and make distributions pass a
   --shared option to get the shared version that they want.

I can see advantages and disadvantages to each approach.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH] Makefile: Create include directory when installing headers
  2010-04-01 11:47     ` [PATCH] Makefile: Create include directory when installing headers Michal Sojka
@ 2010-04-01 12:13       ` Carl Worth
  0 siblings, 0 replies; 28+ messages in thread
From: Carl Worth @ 2010-04-01 12:13 UTC (permalink / raw)
  To: Michal Sojka, notmuch

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

On Thu,  1 Apr 2010 13:47:45 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
> When I wanted to create a debian package from the current master, make
> install failed because of non-existent include directory. This patch
> fixes this minor issue.

Thanks. This is merged now.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Notmuch shared library
  2010-04-01 12:12         ` Carl Worth
@ 2010-04-01 12:44           ` Michal Sojka
  2010-04-01 22:09             ` Carl Worth
  0 siblings, 1 reply; 28+ messages in thread
From: Michal Sojka @ 2010-04-01 12:44 UTC (permalink / raw)
  To: Carl Worth, martin f krafft; +Cc: notmuch

On Thu, 01 Apr 2010, Carl Worth wrote:
> On Thu, 1 Apr 2010 13:24:22 +0200, martin f krafft <madduck@madduck.net> wrote:
> > also sprach Michal Sojka <sojkam1@fel.cvut.cz> [2010.04.01.1310 +0200]:
> > > this can be solved by the following patch, but I don't know how portable
> > > it is. You can see the efect of this by
> > 
> > Please avoid rpath. The better solution is probably to create
> > a wrapper for notmuch, which prepends to LD_LIBRARY_PATH.
> 
> So now should actually list some of the ideas I had:
> 
> 1. Use rpath for the local notmuch, (and use chrpath to remove it at the
>    time of "make install").
> 
> 2. Create a little shell script that calls LD_LIBRARY_PATH locally, but
>    then install the real program, (not very unlike what libtool does).
> 
> 3. Create a static program locally, but install a shared version.
> 
> 4. Create a static program by default, and make distributions pass a
>    --shared option to get the shared version that they want.

I'd like to be able to run gdb easily on non-installed notmuch, so I'm
fine with 1, 3 and 4.

-Michal

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: Notmuch shared library
  2010-04-01 12:44           ` Michal Sojka
@ 2010-04-01 22:09             ` Carl Worth
  0 siblings, 0 replies; 28+ messages in thread
From: Carl Worth @ 2010-04-01 22:09 UTC (permalink / raw)
  To: Michal Sojka, martin f krafft; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

On Thu, 01 Apr 2010 14:44:36 +0200, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
> On Thu, 01 Apr 2010, Carl Worth wrote:
> > 1. Use rpath for the local notmuch, (and use chrpath to remove it at the
> >    time of "make install").
> > 
> > 3. Create a static program locally, but install a shared version.
> > 
> > 4. Create a static program by default, and make distributions pass a
> >    --shared option to get the shared version that they want.
> 
> I'd like to be able to run gdb easily on non-installed notmuch, so I'm
> fine with 1, 3 and 4.

I really like the idea of (1) but it might cause a dependency on
chrpath, which would be obnoxious. Otherwise, it would require linking
the final application twice.

But if we're going to link twice, we might as well just do that (3).

I now don't see any advantage of (4) over (3). It's easy to compile both
static and shared, so there's not much reason to be able to disable one
or the other.

So I've now made the default "make" create a static "notmuch" binary and
a shared "notmuch-shared" binary. Then, "make install" installs
"notmuch-shared" but renames it to "notmuch".

The other reason I really wanted something like this is to be able to
ensure that the test suite tests the locally-compiled library, (and not
some installed version that the dynamic linker finds).

-Carl (happy to stay away from the pain of wrapper scripts)

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [No Subject]
  2012-04-15  2:17 ` [PATCH v2] " Jameson Graef Rollins
@ 2012-04-15 17:23   ` Tomi Ollila
  0 siblings, 0 replies; 28+ messages in thread
From: Tomi Ollila @ 2012-04-15 17:23 UTC (permalink / raw)
  To: Jameson Graef Rollins, Notmuch Mail

On Sun, Apr 15 2012, Jameson Graef Rollins <jrollins@finestructure.net> wrote:

> A previous patch [0] replaced blank subject lines with '[No Subject]'
> in search and show mode.  Apparently this was needed to circumvent
> some bug in the printing code, but there was no need for it search or
> show, and it is definitely not desirable, so we undo it here (a revert
> is no longer feasible).  We should not be modifying strings in the
> original message without good reason, or without a clear indication
> that we are doing so, neither of which apply in this case.  For
> further discussion see [0].
>
> [0] id:"1327918561-16245-3-git-send-email-dme@dme.org"
> ---

I agree. LGTM.

Tomi

> Sorry, there was a small bug in the previous version (notmuch-print.el
> was mistakenly modified).
>
>  emacs/notmuch-show.el |    5 +----
>  emacs/notmuch.el      |    5 ++---
>  2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 30b26d1..1e55099 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1075,7 +1075,7 @@ function is used."
>        (run-hooks 'notmuch-show-hook))
>  
>      ;; Set the header line to the subject of the first message.
> -    (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject)))))
> +    (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))))
>  
>  (defun notmuch-show-capture-state ()
>    "Capture the state of the current buffer.
> @@ -1375,9 +1375,6 @@ current thread."
>  (defun notmuch-show-get-depth ()
>    (notmuch-show-get-prop :depth))
>  
> -(defun notmuch-show-get-pretty-subject ()
> -  (notmuch-prettify-subject (notmuch-show-get-subject)))
> -
>  (defun notmuch-show-set-tags (tags)
>    "Set the tags of the current message."
>    (notmuch-show-set-prop :tags tags)
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index ba833e6..326645d 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -507,7 +507,7 @@ Complete list of currently available key bindings:
>    "Display the currently selected thread."
>    (interactive)
>    (let ((thread-id (notmuch-search-find-thread-id))
> -	(subject (notmuch-prettify-subject (notmuch-search-find-subject))))
> +	(subject (notmuch-search-find-subject)))
>      (if (> (length thread-id) 0)
>  	(notmuch-show thread-id
>  		      (current-buffer)
> @@ -877,8 +877,7 @@ non-authors is found, assume that all of the authors match."
>  		      ;; We currently just throw away excluded matches.
>  		      (unless (eq (aref count 1) ?0)
>  			(let ((beg (point)))
> -			  (notmuch-search-show-result date count authors
> -						      (notmuch-prettify-subject subject) tags)
> +			  (notmuch-search-show-result date count authors subject tags)
>  			  (notmuch-search-color-line beg (point) tag-list)
>  			  (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
>  			  (put-text-property beg (point) 'notmuch-search-authors authors)
> -- 
> 1.7.9.5
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2012-04-15 17:23 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 22:37 Notmuch shared library Ben Gamari
2010-03-11 22:37 ` [PATCH] Build and link against notmuch " Ben Gamari
2010-03-12 13:41 ` (no subject) Ingmar Vanhassel
2010-03-15 17:58   ` Ben Gamari
2010-03-12 13:47 ` Ingmar Vanhassel
2010-03-12 15:02   ` Sebastian Spaeth
2010-03-15 16:20     ` Sebastian Spaeth
2010-04-01  7:54   ` Notmuch shared library Carl Worth
2010-04-01  9:10     ` Sebastian Spaeth
2010-04-01 11:10     ` Michal Sojka
2010-04-01 11:24       ` martin f krafft
2010-04-01 11:41         ` martin f krafft
2010-04-01 12:12         ` Carl Worth
2010-04-01 12:44           ` Michal Sojka
2010-04-01 22:09             ` Carl Worth
2010-04-01 11:47     ` [PATCH] Makefile: Create include directory when installing headers Michal Sojka
2010-04-01 12:13       ` Carl Worth
2010-03-12 13:47 ` [PATCH 1/3] Build and link against notmuch shared library, install notmuch.h Ingmar Vanhassel
2010-03-28  2:44   ` Ben Gamari
2010-03-12 13:47 ` [PATCH 2/3] Fix target dependencies for multiple jobs Ingmar Vanhassel
2010-03-12 13:47 ` [PATCH 3/3] Add a --libdir option to ./configure Ingmar Vanhassel
  -- strict thread matches above, loose matches on Subject: below --
2012-04-15  0:08 [PATCH] emacs: do not modify subject in search or show Jameson Graef Rollins
2012-04-15  2:17 ` [PATCH v2] " Jameson Graef Rollins
2012-04-15 17:23   ` [No Subject] Tomi Ollila
2010-03-12 18:46 (no subject) ingmar
2010-03-15 16:22 ` Sebastian Spaeth
2010-03-12 15:43 ingmar
2010-03-12 16:06 ` Sebastian Spaeth
2009-12-25 19:53 [PATCH] notmuch.el: add a submap (on "z" for "ztash") to stash things david
2009-12-27  3:51 ` (no subject) david
2009-11-25  2:03 Bart Trojanowski

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).