search query "replytoid:"

2015-06-13 Thread Suvayu Ali
Hi,

On Sat, Jun 13, 2015 at 02:47:00PM -0400, Xu Wang wrote:
> 
> Is it possible to search based on which message ID a message
> *responds* to? For example, suppose message id is MESSAGEID. I want to
> find all emails that responded to MESSAGEID. How to enter such a query
> into notmuch?

AFAIK, this is not possible.  Notmuch does not allow searching special
headers.  You could probably write a script using the threads output
format to get the thread, and then use formail to find the responses.

I however think you are probably approaching the problem incorrectly,
but that's just a guess.  More information about what is your goal and
why, would help.  Maybe there is another way to achieve what you want to
achieve.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.


Understanding the "replied" tag

2015-06-13 Thread Suvayu Ali
Hi,

On Sat, Jun 13, 2015 at 02:44:46PM -0400, Xu Wang wrote:
> 
> Thank you. The problem in the end is that I would like 'notmuch new'
> to not only schronize the 'reply' tag but to master handle the reply
> tag because notmuch knows which messages have been replied to (because
> it is aware of threads).

Sorry, I have no idea what you are saying.  It would help a lot if you
explicitly state what you tried, what you expected, and what you saw.
For example, you still haven't mentioned that you are using mutt-kz as
your MUA.  I know that because we had an earlier discussion on
mutt-users.  It is very hard to suggest something without knowing
precisely what you tried.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.


Understanding the "replied" tag

2015-06-13 Thread Austin Clements
Hi Xu. I may be misunderstanding your email, but it sounds like you want to 
know if a message has *any* reply message. That's not what the replied tag 
indicates. The replied tag indicates that *you* have sent a reply to a message. 
Mechanically, when you hit, say, r to start a reply and then send that message, 
notmuch tags the message you hit r on as "replied". That's the only time 
notmuch automatically sets this tag.

On June 11, 2015 10:25:44 AM PDT, Xu Wang  wrote:
>Dear all,
>
>First, I am extremely excited to be a part of this list now. notmuch
>has really helped me. Thank you go all individuals working to improve
>it and to help others to know how to use it.
>
>I would really like to know if a message has been replied to (e.g.
>using a certain message id). It seems that all I need to do is check
>for the "replied" tag. But often this tag is not there, even when
>there has been a reply (I have confirmed this through the thread
>display and checking the message that replied to the message to make
>sure it indeed has header "replied-to:").
>
>I have looked in mutt, and also I see many situations where there is
>no 'r' flag, especially for emails sent from me.
>
>The following returns true:
>notmuch config get maildir.synchronize_flags
>
>So at least both are giving same answer, but I'm not sure why not
>saying "replied" thread is correct.
>
>What is incorrect for my way of thinking about "replied"? Do I
>misunderstand what it is supposed to do or am I not updating the flags
>correctly?
>
>Kind regards,
>
>Xu
>___
>notmuch mailing list
>notmuch at notmuchmail.org
>http://notmuchmail.org/mailman/listinfo/notmuch



search query "replytoid:"

2015-06-13 Thread Xu Wang
Dear all,

Is it possible to search based on which message ID a message
*responds* to? For example, suppose message id is MESSAGEID. I want to
find all emails that responded to MESSAGEID. How to enter such a query
into notmuch?

Kind regards,

Xu


Understanding the "replied" tag

2015-06-13 Thread Xu Wang
On Thu, Jun 11, 2015 at 2:39 PM, Xu Wang  wrote:
> On Thu, Jun 11, 2015 at 2:25 PM, Jani Nikula  wrote:
>> On Thu, 11 Jun 2015, Xu Wang  wrote:
>>> Dear all,
>>>
>>> First, I am extremely excited to be a part of this list now. notmuch
>>> has really helped me. Thank you go all individuals working to improve
>>> it and to help others to know how to use it.
>>>
>>> I would really like to know if a message has been replied to (e.g.
>>> using a certain message id). It seems that all I need to do is check
>>> for the "replied" tag. But often this tag is not there, even when
>>> there has been a reply (I have confirmed this through the thread
>>> display and checking the message that replied to the message to make
>>> sure it indeed has header "replied-to:").
>>>
>>> I have looked in mutt, and also I see many situations where there is
>>> no 'r' flag, especially for emails sent from me.
>>>
>>> The following returns true:
>>> notmuch config get maildir.synchronize_flags
>>>
>>> So at least both are giving same answer, but I'm not sure why not
>>> saying "replied" thread is correct.
>>>
>>> What is incorrect for my way of thinking about "replied"? Do I
>>> misunderstand what it is supposed to do or am I not updating the flags
>>> correctly?
>>
>> Notmuch deals with the "replied" tag in two ways.
>>
>> First, the tag is synchronized with the maildir flag R, both ways. This
>> is the "R" in the filename after ":2,". See [1] for details.
>>
>> Second, the notmuch-emacs interface adds the "replied" tag upon sending
>> the reply. You can customize this tag, but note that only "replied" gets
>> synchronized to maildir flags.
>>
>> If you use a MUA that doesn't either add the R flag or call notmuch to
>> add the "replied" tag, you'll lose this bit of information.
>>
>> You might also find [2] relevant.
>>
>> BR,
>> Jani.
>>
>>
>> [1] http://cr.yp.to/proto/maildir.html
>> [2] http://notmuchmail.org/special-tags/
>
> Thank you so much, Jani. This is very informative to me. I think I
> have a good understanding now of what is going on.
>
> My question then is this:
>
> I trust notmuch more than mutt, because notmuch is aware of threads
> and all mail boxes. Also note that I often use gmail web interface to
> reply emails.
>
> Am I correct in the following: if notmuch wanted to, when I run
> "notmuch new", notmuch has the information that it could
> (theoretically) update and correct all of the "replied" tags. Is that
> correct? If so, my next question is: why doesn't it do that?
>
> I think I'm close to getting notmuch intution on its goals.
>
> Kind regards,

The following message is in response to Suvayu (I am now finally
subscribed to the list so I will have no future problem):

Thank you. The problem in the end is that I would like 'notmuch new'
to not only schronize the 'reply' tag but to master handle the reply
tag because notmuch knows which messages have been replied to (because
it is aware of threads).

Kind regards,

Xu


[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 02:24 PM, Jinwoo Lee  wrote:
> That error is from 'cd bindings/ruby && ruby extconf.rb --vendor' BTW.

The contents of mkmf.log are below.  It shows a warning about
-L/usr/local/lib and I don't have the directory /usr/local/lib on my
machine.  I'm not sure if that's the cause of the error though.  I don't
write Ruby and know nothing about it.

"xcrun clang -o conftest -I../../lib 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 
-I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT  
  -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. 
-L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. 
-L/usr/local/lib -Wl,--no-undefined   -arch x86_64 -arch i386   -lruby.2.0.0  
-lpthread -ldl -lobjc "
ld: warning: directory not found for option '-L/usr/local/lib'
ld: unknown option: --no-undefined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */



[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
That error is from 'cd bindings/ruby && ruby extconf.rb --vendor' BTW.


[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 02:11 PM, David Bremner  wrote:
> Jinwoo Lee  writes:
>
>>> I with configure has an option to skip the ruby-bindings build.
>>
>> `configure' seems to try to detect whether the ruby development tools
>> are installed.  It thinks I have them but I don't actually, and that's
>> why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
>> Makefile.config, everything's fine.
>
> Thanks for narrowing this down. Can you tell us the output of
>
> % ruby -e "require 'mkmf'" ; echo $?

This command succeeds and returns 0.

When I change the dependency of ruby-bindings from libnotmuch.so to
libnotmuch.dylib and run `make', I get errors like below.

Looks like mkmf.rb (I have no idea what this is) is provided by OS X by
default, but actually running it fails.

...
[snip]
...
checking for notmuch_database_create in libnotmuch.so... *** extconf.rb failed 
***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir

--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in
 `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:513:in
 `block in try_link0'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:88:in
 `mktmpdir'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:510:in
 `try_link0'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:534:in
 `try_link'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:720:in
 `try_func'
from extconf.rb:19:in `block in have_local_library'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in
 `block in checking_for'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in
 `block (2 levels) in postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in
 `open'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in
 `block in postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in
 `open'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in
 `postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in
 `checking_for'
from extconf.rb:17:in `have_local_library'
from extconf.rb:25:in `'
make: *** [ruby-bindings] Error 1



[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 01:46 PM, Jinwoo Lee  wrote:
> On Sat, Jun 13, 2015 at 12:59 PM, Jinwoo Lee  wrote:
>> This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
>> should be lib/libnotmuch.dylib on OS X.
>>
>> That makes `make' and `make install' fail.
>
> Even after I update the dependency to lib/libnotmuch.dylib, building
> ruby-bindings fails because I don't have the ruby development tools
> installed on my machine.
>
> I with configure has an option to skip the ruby-bindings build.

`configure' seems to try to detect whether the ruby development tools
are installed.  It thinks I have them but I don't actually, and that's
why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
Makefile.config, everything's fine.


[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 12:59 PM, Jinwoo Lee  wrote:
> This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
> should be lib/libnotmuch.dylib on OS X.
>
> That makes `make' and `make install' fail.

Even after I update the dependency to lib/libnotmuch.dylib, building
ruby-bindings fails because I don't have the ruby development tools
installed on my machine.

I with configure has an option to skip the ruby-bindings build.

>
> On Fri, Jun 12, 2015 at 11:37 PM, David Bremner  wrote:
>> David Bremner  writes:
>>
>>> Because ruby generates a Makefile, we have to use recursive make.
>>> Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
>>> in the parent directory.
>>
>> Pushed the first patch in the series. Let's see if anything breaks.
>>
>> d
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch


[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
should be lib/libnotmuch.dylib on OS X.

That makes `make' and `make install' fail.

On Fri, Jun 12, 2015 at 11:37 PM, David Bremner  wrote:
> David Bremner  writes:
>
>> Because ruby generates a Makefile, we have to use recursive make.
>> Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
>> in the parent directory.
>
> Pushed the first patch in the series. Let's see if anything breaks.
>
> d
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Syntactic sugar for range syntax

2015-06-13 Thread Robert Künnemann
Hi!

Thanks for your response!

On 11/06, Jani Nikula wrote:
>>  date:today-1week..today
>In other words, date:1w..
>The reference for relative dates is "now" if one is not specified.
>The minus sign means nothing, relative dates all refer to the past
>and are added together.
That's good enough for my purposes. The man page could be a bit
clearer on that, I'll try to send a patch later.

With kind regards, Robert Künnemann


[PATCH v5 3/3] emacs: Bind filter in search to 'l'

2015-06-13 Thread Mark Walters
Change the key binding for filter (or "limit") in search-mode. This
gives consistency with the new filter in show-mode, and frees 'f' for
forward-thread in the future.
---
 emacs/notmuch.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6564816..06e3b94 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -166,7 +166,7 @@ (defvar notmuch-search-mode-map
 (define-key map "o" 'notmuch-search-toggle-order)
 (define-key map "c" 'notmuch-search-stash-map)
 (define-key map "t" 'notmuch-search-filter-by-tag)
-(define-key map "f" 'notmuch-search-filter)
+(define-key map "l" 'notmuch-search-filter)
 (define-key map [mouse-1] 'notmuch-search-show-thread)
 (define-key map "*" 'notmuch-search-tag-all)
 (define-key map "a" 'notmuch-search-archive-thread)
@@ -983,7 +983,7 @@ (defun notmuch-search-toggle-order ()
   (notmuch-search-refresh-view))

 (defun notmuch-search-filter (query)
-  "Filter the current search results based on an additional query string.
+  "Filter or LIMIT the current search results based on an additional query 
string.

 Runs a new search matching only messages that match both the
 current search results AND the additional query string provided."
-- 
2.1.4



[PATCH v5 2/3] emacs: add a filter option to show

2015-06-13 Thread Mark Walters
Show the current thread with a different filter (i.e., open messages
in the thread matching the new query).

Bound to 'l' for "limit".

Note that it is not the same as filter in search mode as it replaces
the existing query rather than ANDing with it (but it does keep the
thread-id part of the query).
---
 emacs/notmuch-show.el | 12 
 1 file changed, 12 insertions(+)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index a978d3c..4dee34b 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -47,6 +47,7 @@
 (declare-function notmuch-tree "notmuch-tree"
  ( query query-context target buffer-name 
open-target))
 (declare-function notmuch-tree-get-message-properties "notmuch-tree" nil)
+(declare-function notmuch-read-query "notmuch" (prompt))

 (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
   "Headers that should be shown in a message, in this order.
@@ -1372,6 +1373,7 @@ (defvar notmuch-show-mode-map
 (define-key map (kbd "") 'notmuch-show-previous-button)
 (define-key map (kbd "TAB") 'notmuch-show-next-button)
 (define-key map "f" 'notmuch-show-forward-message)
+(define-key map "l" 'notmuch-show-filter-thread)
 (define-key map "r" 'notmuch-show-reply-sender)
 (define-key map "R" 'notmuch-show-reply)
 (define-key map "|" 'notmuch-show-pipe-message)
@@ -1660,6 +1662,16 @@ (defun notmuch-show-command-hook ()
 (save-excursion
   (funcall notmuch-show-mark-read-function (window-start) (window-end)

+(defun notmuch-show-filter-thread (query)
+  "Filter or LIMIT the current thread based on a new query string.
+
+Reshows the current thread with matches defined by the new query-string."
+  (interactive (list (notmuch-read-query "Filter thread: ")))
+  (let ((msg-id (notmuch-show-get-message-id)))
+(setq notmuch-show-query-context (if (string= query "") nil query))
+(notmuch-show-refresh-view t)
+(notmuch-show-goto-message msg-id)))
+
 ;; Functions for getting attributes of several messages in the current
 ;; thread.

-- 
2.1.4



[PATCH v5 1/3] emacs: split notmuch-show-apply-state

2015-06-13 Thread Mark Walters
Separate out a notmuch-show-goto-msg-id sub-function from
notmuch-show-apply-state. There should be no functional change but the
next patch will call the new function.
---
 emacs/notmuch-show.el | 18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 2a53461..a978d3c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1281,6 +1281,16 @@ (defun notmuch-show-get-query ()
  ")")
 notmuch-show-thread-id))

+(defun notmuch-show-goto-message (msg-id)
+  "Go to message with msg-id."
+  (goto-char (point-min))
+  (unless (loop if (string= msg-id (notmuch-show-get-message-id))
+   return t
+   until (not (notmuch-show-goto-message-next)))
+(goto-char (point-min))
+(message "Message-id not found."))
+  (notmuch-show-message-adjust))
+
 (defun notmuch-show-apply-state (state)
   "Apply STATE to the current buffer.

@@ -1298,13 +1308,7 @@ (defun notmuch-show-apply-state (state)
  until (not (notmuch-show-goto-message-next)))

 ;; Go to the previously open message.
-(goto-char (point-min))
-(unless (loop if (string= current (notmuch-show-get-message-id))
- return t
- until (not (notmuch-show-goto-message-next)))
-  (goto-char (point-min))
-  (message "Previously current message not found."))
-(notmuch-show-message-adjust)))
+(notmuch-show-goto-message current)))

 (defun notmuch-show-refresh-view ( reset-state)
   "Refresh the current view.
-- 
2.1.4



[PATCH v5 0/3] Add filter to emacs show mode

2015-06-13 Thread Mark Walters
The previous version of this patch was over 3 years ago at
id:1335658006-20161-1-git-send-email-markwalters1009 at gmail.com

The reason the patch stopped was that it marked messages read (removed
the unread tag) spuriously (see Austin's review
id:20120429005736.GK2704 at mit.edu) and this was difficult to
fix. However, now the unread handling has been updated this is no
longer a problem. (More precisely, since the unread handling is done
in the command loop hook the unread tag only gets updated after
notmuch has displayed the final result.)

There are two small questions with this version that I would
appreciate views on. First it binds the filter/limit to l since f is
already bound to forward in show mode. It changes the binding in
search mode to match but that may annoy a lot of people who have got f
for filter into muscle memory. If we prefer to leave the keybinding in
search mode as it is then we can just drop the final patch.

Secondly what should the behaviour be if the user just gives and empty
filter query? This patch just opens all messages in the thread (ie it
treats the query as matching everything). Alternatively, it could just
exit without refreshing the buffer in that case.

Best wishes

Mark


Mark Walters (3):
  emacs: split notmuch-show-apply-state
  emacs: add a filter option to show
  emacs: Bind filter in search to 'l'

 emacs/notmuch-show.el | 30 +++---
 emacs/notmuch.el  |  4 ++--
 2 files changed, 25 insertions(+), 9 deletions(-)

-- 
2.1.4



[RFC PATCH] emacs: show: show attachment size

2015-06-13 Thread Mark Walters
Display the attachment size in kB or MB in the part button. This uses
the content-length header and guesses the actual size from that, so
the value will be close but not exact.
---

This patch adds some text to the part button saying how big the part
is. This is particularly useful when running notmuch over ssh but may
be informative anyway.

One particular question is am I putting sizes on the correct parts?
This patch puts a size on all parts where we know the size and it is
not hidden ( part buttons of the form [ text/html (hidden) (30kB) ]
looked messy).

There are a couple of caveats with the patch. First the size is
approximate. This is because gmime/notmuch only outputs the encoded
size. We guess the true size is roughly 3/4 the encoded size if it is
base64 encoded and the encoded size otherwise. (See
id:20120807232414.GA22132 at hili.localdomain and Austin's reply.)

Secondly, lots of tests fail. This is expected as the output for any
message with attachment has changed. I thought I would see whether
people liked the idea, and which parts people think need a size before
fixing them.

Best wishes

Mark



emacs/notmuch-show.el | 26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 2a53461..f26e2f8 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -488,6 +488,25 @@ (define-button-type 'notmuch-show-part-button-type
   'face 'message-mml
   :supertype 'notmuch-button-type)

+(defun notmuch-show-part-pretty-size (part)
+  "Return a nicely formatted string of the approximate part size in kB or MB 
if known"
+  ;; We guess the size from the encoded length (which is all
+  ;; gmime tells us). If it is base64 encoded the size will be
+  ;; approximately 3/4 of the encoded size, otherwise (e.g. if it
+  ;; is quoted printable) the size is probably pretty close to
+  ;; the encoded size.
+  (let ((approx-size (if (string= (plist-get part :content-transfer-encoding) 
"base64")
+(/ (* (plist-get part :content-length) 3) 4)
+  (plist-get part :content-length
+(cond ((not approx-size)
+  nil)
+ ((< approx-size 100)
+  (format " (%s kB)" (1+ (/ approx-size 1000
+ ((< approx-size 1000)
+  (format " (%s.%s MB)" (/ approx-size 100) (% (/ approx-size 
10) 10)))
+ (t
+  (format " (%s MB)" (/ approx-size 100))
+
 (defun notmuch-show-insert-part-header (nth content-type declared-type 
 name comment)
   (let ((button)
(base-label (concat (when name (concat name ": "))
@@ -948,11 +967,16 @@ (defun notmuch-show-insert-bodypart (msg part depth 
 hide)
(> notmuch-show-max-text-part-size 0)
(> (length (plist-get part :content)) 
notmuch-show-max-text-part-size)))
 (beg (point))
+(pretty-size (unless hide (notmuch-show-part-pretty-size part)))
 ;; We omit the part button for the first (or only) part if
 ;; this is text/plain, or HIDE is 'no-buttons.
 (button (unless (or (equal hide 'no-buttons)
 (and (string= mime-type "text/plain") (<= nth 1)))
-  (notmuch-show-insert-part-header nth mime-type content-type 
(plist-get part :filename
+  (notmuch-show-insert-part-header nth
+   mime-type
+   content-type
+   (plist-get part :filename)
+   pretty-size)))
 ;; Hide the part initially if HIDE is t, or if it is too long
 ;; and we have a button to allow toggling (thus reply which
 ;; uses 'no-buttons automatically includes long parts)
-- 
2.1.4



[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread David Bremner
David Bremner  writes:

> Because ruby generates a Makefile, we have to use recursive make.
> Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
> in the parent directory.

Pushed the first patch in the series. Let's see if anything breaks.

d


[PATCH] emacs search: stash query

2015-06-13 Thread David Bremner
Mark Walters  writes:

> Add keybinding c q to stash the current query in search mode.
> ---
>

pushed.  If you're going to complain about the keybinding, please do it
soon before everyone else gets used to it.

d


Re: Understanding the replied tag

2015-06-13 Thread Xu Wang
Dear Suvayu and Austin,

Thank you for your attempts to understand my goals. I apologize for
the lack in the clarity of my previous messages. Thank you kindly for
your persistence and thank you to Suvayu for suggestions on adding
more information.

I am indeed using mutt-kz, along with offlineimap, on Ubuntu 15.04. I
have written the following information the other email thread I
started (perhaps I should have added it as a reply here, but I thought
it might be sufficiently a different topic). I will copy the
information I gave there on my goal here:

My goal is to do something like the following:
notmuch search tag:reply-required and not tag:replied

which was discussed here:
http://notmuchmail.org/pipermail/notmuch/2010/002558.html

However, instead of conditioning on tag:reply-required, I would like
to look at this for a specific message. For example, if I write an
important message, I can do the following:
save the message id, and then in 5 days set a cron script to check
whether my message was responded to. If it was not responded to I will
take some action to notify myself (haven't decided what yet).
It is the If it was not responded to part that this email thread is
about. I am now realizing that I cannot use mutt's tag replied
because I often send and read email from gmail or other IMap clients
(e.g. phone). Because of this (I believe), the reply tag does not get
set when it should (well not should but rather when I want it to).
For example, I often have

abc
-def
  - ghi

where the message def does not have the replied tag, even though it
was replied to (ghi replied to it). I think the reason is what I
suggested above. Yes, indeed Austin was correct about where my
misunderstanding was. I do indeed want to see if *any* reply was to a
certain message id, but the replied tag is apparently for my own
replying.

Because I cannot use the replied tag (unless I have misunderstood),
I thought I could just check using the message id with 'notmuch search
repliedto:messageid', but Suvayu points out that searching for this
is not supported.

Kind regards,

Xu

On Sat, Jun 13, 2015 at 7:12 PM, Austin Clements
acleme...@csail.mit.edu wrote:
 Hi Xu. I may be misunderstanding your email, but it sounds like you want to 
 know if a message has *any* reply message. That's not what the replied tag 
 indicates. The replied tag indicates that *you* have sent a reply to a 
 message. Mechanically, when you hit, say, r to start a reply and then send 
 that message, notmuch tags the message you hit r on as replied. That's the 
 only time notmuch automatically sets this tag.

 On June 11, 2015 10:25:44 AM PDT, Xu Wang xuwang...@gmail.com wrote:
Dear all,

First, I am extremely excited to be a part of this list now. notmuch
has really helped me. Thank you go all individuals working to improve
it and to help others to know how to use it.

I would really like to know if a message has been replied to (e.g.
using a certain message id). It seems that all I need to do is check
for the replied tag. But often this tag is not there, even when
there has been a reply (I have confirmed this through the thread
display and checking the message that replied to the message to make
sure it indeed has header replied-to:MSG-ID).

I have looked in mutt, and also I see many situations where there is
no 'r' flag, especially for emails sent from me.

The following returns true:
notmuch config get maildir.synchronize_flags

So at least both are giving same answer, but I'm not sure why not
saying replied thread is correct.

What is incorrect for my way of thinking about replied? Do I
misunderstand what it is supposed to do or am I not updating the flags
correctly?

Kind regards,

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

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


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread David Bremner
Jinwoo Lee jinwo...@gmail.com writes:


 ld: unknown option: --no-undefined
 clang: error: linker command failed with exit code 1 (use -v to see 
 invocation)

I wonder if this the actual relevant error. Can you try with the next
two patches in the series?

id:1433142542-2307-3-git-send-email-da...@tethera.net
id:1433142542-2307-4-git-send-email-da...@tethera.net

This first alone may fix it, but it would be good to know if the next
one breaks anything on Mac OS.



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


Re: search query replytoid:blah

2015-06-13 Thread David Bremner
Xu Wang xuwang...@gmail.com writes:

 Dear David and Suvayu,

 Thank you for your ideas. My goal is to do something like the following:
 notmuch search tag:reply-required and not tag:replied

 which was discussed here:
 http://notmuchmail.org/pipermail/notmuch/2010/002558.html


This recent blog report looks related to your goal:

https://tomasz.buchert.pl/blog/2015/06/14/notmuch-response/
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Understanding the replied tag

2015-06-13 Thread Austin Clements
Hi Xu. I may be misunderstanding your email, but it sounds like you want to 
know if a message has *any* reply message. That's not what the replied tag 
indicates. The replied tag indicates that *you* have sent a reply to a message. 
Mechanically, when you hit, say, r to start a reply and then send that message, 
notmuch tags the message you hit r on as replied. That's the only time 
notmuch automatically sets this tag.

On June 11, 2015 10:25:44 AM PDT, Xu Wang xuwang...@gmail.com wrote:
Dear all,

First, I am extremely excited to be a part of this list now. notmuch
has really helped me. Thank you go all individuals working to improve
it and to help others to know how to use it.

I would really like to know if a message has been replied to (e.g.
using a certain message id). It seems that all I need to do is check
for the replied tag. But often this tag is not there, even when
there has been a reply (I have confirmed this through the thread
display and checking the message that replied to the message to make
sure it indeed has header replied-to:MSG-ID).

I have looked in mutt, and also I see many situations where there is
no 'r' flag, especially for emails sent from me.

The following returns true:
notmuch config get maildir.synchronize_flags

So at least both are giving same answer, but I'm not sure why not
saying replied thread is correct.

What is incorrect for my way of thinking about replied? Do I
misunderstand what it is supposed to do or am I not updating the flags
correctly?

Kind regards,

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

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


Re: search query replytoid:blah

2015-06-13 Thread Xu Wang
On Sat, Jun 13, 2015 at 5:14 PM, David Bremner da...@tethera.net wrote:
 Xu Wang xuwang...@gmail.com writes:

 Dear all,

 Is it possible to search based on which message ID a message
 *responds* to? For example, suppose message id is MESSAGEID. I want to
 find all emails that responded to MESSAGEID. How to enter such a query
 into notmuch?

 Threads aren't exactly the concept you ask for, because the include the
 messages before the message-id in question as well. Nonetheless, maybe
 the following helps:


 % notmuch show $(notmuch search --output=threads $MESAGEID)

 or

 % notmuch search --output=messages $(notmuch search --output=threads 
 $MESAGEID)

Dear David and Suvayu,

Thank you for your ideas. My goal is to do something like the following:
notmuch search tag:reply-required and not tag:replied

which was discussed here:
http://notmuchmail.org/pipermail/notmuch/2010/002558.html

However, instead of conditioning on tag:reply-required, I would like
to look at this for a specific message. For example, if I write an
important message, I can do the following:
save the message id, and then in 5 days set a cron script to check
whether my message was responded to. If it was not responded to I will
take some action to notify myself (haven't decided what yet).
It is the If it was not responded to part that this email thread is
about. I am now realizing that I cannot use mutt's tag replied
because I often send and read email from gmail or other IMap clients
(e.g. phone). Because of this (I believe), the reply tag does not get
set when it should (well not should but rather when I want it to).
For example, I often have

abc
-def
  - ghi

where the message def does not have the replied tag, even though it
was replied to (ghi replied to it). I think the reason is what I
suggested above.

Because I cannot use the replied tag (unless I have misunderstood),
I thought I could just check using the message id with 'notmuch search
repliedto:messageid', but Suvayu points out that searching for this
is not supported.

Kind regards,

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


Re: Understanding the replied tag

2015-06-13 Thread Xu Wang
On Thu, Jun 11, 2015 at 2:25 PM, Jani Nikula j...@nikula.org wrote:
 On Thu, 11 Jun 2015, Xu Wang xuwang...@gmail.com wrote:
 Dear all,

 First, I am extremely excited to be a part of this list now. notmuch
 has really helped me. Thank you go all individuals working to improve
 it and to help others to know how to use it.

 I would really like to know if a message has been replied to (e.g.
 using a certain message id). It seems that all I need to do is check
 for the replied tag. But often this tag is not there, even when
 there has been a reply (I have confirmed this through the thread
 display and checking the message that replied to the message to make
 sure it indeed has header replied-to:MSG-ID).

 I have looked in mutt, and also I see many situations where there is
 no 'r' flag, especially for emails sent from me.

 The following returns true:
 notmuch config get maildir.synchronize_flags

 So at least both are giving same answer, but I'm not sure why not
 saying replied thread is correct.

 What is incorrect for my way of thinking about replied? Do I
 misunderstand what it is supposed to do or am I not updating the flags
 correctly?

 Notmuch deals with the replied tag in two ways.

 First, the tag is synchronized with the maildir flag R, both ways. This
 is the R in the filename after :2,. See [1] for details.

 Second, the notmuch-emacs interface adds the replied tag upon sending
 the reply. You can customize this tag, but note that only replied gets
 synchronized to maildir flags.

 If you use a MUA that doesn't either add the R flag or call notmuch to
 add the replied tag, you'll lose this bit of information.

 You might also find [2] relevant.

 BR,
 Jani.


 [1] http://cr.yp.to/proto/maildir.html
 [2] http://notmuchmail.org/special-tags/

Thank you so much, Jani. This is very informative to me. I think I
have a good understanding now of what is going on.

My question then is this:

I trust notmuch more than mutt, because notmuch is aware of threads
and all mail boxes. Also note that I often use gmail web interface to
reply emails.

Am I correct in the following: if notmuch wanted to, when I run
notmuch new, notmuch has the information that it could
(theoretically) update and correct all of the replied tags. Is that
correct? If so, my next question is: why doesn't it do that?

I think I'm close to getting notmuch intution on its goals.

Kind regards,

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


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread David Bremner
David Bremner da...@tethera.net writes:

 Because ruby generates a Makefile, we have to use recursive make.
 Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
 in the parent directory.

Pushed the first patch in the series. Let's see if anything breaks.

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


[PATCH v5 1/3] emacs: split notmuch-show-apply-state

2015-06-13 Thread Mark Walters
Separate out a notmuch-show-goto-msg-id sub-function from
notmuch-show-apply-state. There should be no functional change but the
next patch will call the new function.
---
 emacs/notmuch-show.el | 18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 2a53461..a978d3c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1281,6 +1281,16 @@ (defun notmuch-show-get-query ()
  ))
 notmuch-show-thread-id))
 
+(defun notmuch-show-goto-message (msg-id)
+  Go to message with msg-id.
+  (goto-char (point-min))
+  (unless (loop if (string= msg-id (notmuch-show-get-message-id))
+   return t
+   until (not (notmuch-show-goto-message-next)))
+(goto-char (point-min))
+(message Message-id not found.))
+  (notmuch-show-message-adjust))
+
 (defun notmuch-show-apply-state (state)
   Apply STATE to the current buffer.
 
@@ -1298,13 +1308,7 @@ (defun notmuch-show-apply-state (state)
  until (not (notmuch-show-goto-message-next)))
 
 ;; Go to the previously open message.
-(goto-char (point-min))
-(unless (loop if (string= current (notmuch-show-get-message-id))
- return t
- until (not (notmuch-show-goto-message-next)))
-  (goto-char (point-min))
-  (message Previously current message not found.))
-(notmuch-show-message-adjust)))
+(notmuch-show-goto-message current)))
 
 (defun notmuch-show-refresh-view (optional reset-state)
   Refresh the current view.
-- 
2.1.4

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


[PATCH v5 2/3] emacs: add a filter option to show

2015-06-13 Thread Mark Walters
Show the current thread with a different filter (i.e., open messages
in the thread matching the new query).

Bound to 'l' for limit.

Note that it is not the same as filter in search mode as it replaces
the existing query rather than ANDing with it (but it does keep the
thread-id part of the query).
---
 emacs/notmuch-show.el | 12 
 1 file changed, 12 insertions(+)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index a978d3c..4dee34b 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -47,6 +47,7 @@
 (declare-function notmuch-tree notmuch-tree
  (optional query query-context target buffer-name 
open-target))
 (declare-function notmuch-tree-get-message-properties notmuch-tree nil)
+(declare-function notmuch-read-query notmuch (prompt))
 
 (defcustom notmuch-message-headers '(Subject To Cc Date)
   Headers that should be shown in a message, in this order.
@@ -1372,6 +1373,7 @@ (defvar notmuch-show-mode-map
 (define-key map (kbd backtab) 'notmuch-show-previous-button)
 (define-key map (kbd TAB) 'notmuch-show-next-button)
 (define-key map f 'notmuch-show-forward-message)
+(define-key map l 'notmuch-show-filter-thread)
 (define-key map r 'notmuch-show-reply-sender)
 (define-key map R 'notmuch-show-reply)
 (define-key map | 'notmuch-show-pipe-message)
@@ -1660,6 +1662,16 @@ (defun notmuch-show-command-hook ()
 (save-excursion
   (funcall notmuch-show-mark-read-function (window-start) (window-end)
 
+(defun notmuch-show-filter-thread (query)
+  Filter or LIMIT the current thread based on a new query string.
+
+Reshows the current thread with matches defined by the new query-string.
+  (interactive (list (notmuch-read-query Filter thread: )))
+  (let ((msg-id (notmuch-show-get-message-id)))
+(setq notmuch-show-query-context (if (string= query ) nil query))
+(notmuch-show-refresh-view t)
+(notmuch-show-goto-message msg-id)))
+
 ;; Functions for getting attributes of several messages in the current
 ;; thread.
 
-- 
2.1.4

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


[PATCH v5 0/3] Add filter to emacs show mode

2015-06-13 Thread Mark Walters
The previous version of this patch was over 3 years ago at
id:1335658006-20161-1-git-send-email-markwalters1...@gmail.com

The reason the patch stopped was that it marked messages read (removed
the unread tag) spuriously (see Austin's review
id:20120429005736.gk2...@mit.edu) and this was difficult to
fix. However, now the unread handling has been updated this is no
longer a problem. (More precisely, since the unread handling is done
in the command loop hook the unread tag only gets updated after
notmuch has displayed the final result.)

There are two small questions with this version that I would
appreciate views on. First it binds the filter/limit to l since f is
already bound to forward in show mode. It changes the binding in
search mode to match but that may annoy a lot of people who have got f
for filter into muscle memory. If we prefer to leave the keybinding in
search mode as it is then we can just drop the final patch.

Secondly what should the behaviour be if the user just gives and empty
filter query? This patch just opens all messages in the thread (ie it
treats the query as matching everything). Alternatively, it could just
exit without refreshing the buffer in that case.

Best wishes

Mark


Mark Walters (3):
  emacs: split notmuch-show-apply-state
  emacs: add a filter option to show
  emacs: Bind filter in search to 'l'

 emacs/notmuch-show.el | 30 +++---
 emacs/notmuch.el  |  4 ++--
 2 files changed, 25 insertions(+), 9 deletions(-)

-- 
2.1.4

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


[PATCH v5 3/3] emacs: Bind filter in search to 'l'

2015-06-13 Thread Mark Walters
Change the key binding for filter (or limit) in search-mode. This
gives consistency with the new filter in show-mode, and frees 'f' for
forward-thread in the future.
---
 emacs/notmuch.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6564816..06e3b94 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -166,7 +166,7 @@ (defvar notmuch-search-mode-map
 (define-key map o 'notmuch-search-toggle-order)
 (define-key map c 'notmuch-search-stash-map)
 (define-key map t 'notmuch-search-filter-by-tag)
-(define-key map f 'notmuch-search-filter)
+(define-key map l 'notmuch-search-filter)
 (define-key map [mouse-1] 'notmuch-search-show-thread)
 (define-key map * 'notmuch-search-tag-all)
 (define-key map a 'notmuch-search-archive-thread)
@@ -983,7 +983,7 @@ (defun notmuch-search-toggle-order ()
   (notmuch-search-refresh-view))
 
 (defun notmuch-search-filter (query)
-  Filter the current search results based on an additional query string.
+  Filter or LIMIT the current search results based on an additional query 
string.
 
 Runs a new search matching only messages that match both the
 current search results AND the additional query string provided.
-- 
2.1.4

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


Re: Syntactic sugar for range syntax

2015-06-13 Thread Robert Künnemann

Hi!

Thanks for your response!

On 11/06, Jani Nikula wrote:

 date:today-1week..today

In other words, date:1w..
The reference for relative dates is now if one is not specified.
The minus sign means nothing, relative dates all refer to the past
and are added together.

That's good enough for my purposes. The man page could be a bit
clearer on that, I'll try to send a patch later.

With kind regards, Robert Künnemann
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Understanding the replied tag

2015-06-13 Thread Xu Wang
On Thu, Jun 11, 2015 at 2:39 PM, Xu Wang xuwang...@gmail.com wrote:
 On Thu, Jun 11, 2015 at 2:25 PM, Jani Nikula j...@nikula.org wrote:
 On Thu, 11 Jun 2015, Xu Wang xuwang...@gmail.com wrote:
 Dear all,

 First, I am extremely excited to be a part of this list now. notmuch
 has really helped me. Thank you go all individuals working to improve
 it and to help others to know how to use it.

 I would really like to know if a message has been replied to (e.g.
 using a certain message id). It seems that all I need to do is check
 for the replied tag. But often this tag is not there, even when
 there has been a reply (I have confirmed this through the thread
 display and checking the message that replied to the message to make
 sure it indeed has header replied-to:MSG-ID).

 I have looked in mutt, and also I see many situations where there is
 no 'r' flag, especially for emails sent from me.

 The following returns true:
 notmuch config get maildir.synchronize_flags

 So at least both are giving same answer, but I'm not sure why not
 saying replied thread is correct.

 What is incorrect for my way of thinking about replied? Do I
 misunderstand what it is supposed to do or am I not updating the flags
 correctly?

 Notmuch deals with the replied tag in two ways.

 First, the tag is synchronized with the maildir flag R, both ways. This
 is the R in the filename after :2,. See [1] for details.

 Second, the notmuch-emacs interface adds the replied tag upon sending
 the reply. You can customize this tag, but note that only replied gets
 synchronized to maildir flags.

 If you use a MUA that doesn't either add the R flag or call notmuch to
 add the replied tag, you'll lose this bit of information.

 You might also find [2] relevant.

 BR,
 Jani.


 [1] http://cr.yp.to/proto/maildir.html
 [2] http://notmuchmail.org/special-tags/

 Thank you so much, Jani. This is very informative to me. I think I
 have a good understanding now of what is going on.

 My question then is this:

 I trust notmuch more than mutt, because notmuch is aware of threads
 and all mail boxes. Also note that I often use gmail web interface to
 reply emails.

 Am I correct in the following: if notmuch wanted to, when I run
 notmuch new, notmuch has the information that it could
 (theoretically) update and correct all of the replied tags. Is that
 correct? If so, my next question is: why doesn't it do that?

 I think I'm close to getting notmuch intution on its goals.

 Kind regards,

The following message is in response to Suvayu (I am now finally
subscribed to the list so I will have no future problem):

Thank you. The problem in the end is that I would like 'notmuch new'
to not only schronize the 'reply' tag but to master handle the reply
tag because notmuch knows which messages have been replied to (because
it is aware of threads).

Kind regards,

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


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
should be lib/libnotmuch.dylib on OS X.

That makes `make' and `make install' fail.

On Fri, Jun 12, 2015 at 11:37 PM, David Bremner da...@tethera.net wrote:
 David Bremner da...@tethera.net writes:

 Because ruby generates a Makefile, we have to use recursive make.
 Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
 in the parent directory.

 Pushed the first patch in the series. Let's see if anything breaks.

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


search query replytoid:blah

2015-06-13 Thread Xu Wang
Dear all,

Is it possible to search based on which message ID a message
*responds* to? For example, suppose message id is MESSAGEID. I want to
find all emails that responded to MESSAGEID. How to enter such a query
into notmuch?

Kind regards,

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


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 12:59 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
 should be lib/libnotmuch.dylib on OS X.

 That makes `make' and `make install' fail.

Even after I update the dependency to lib/libnotmuch.dylib, building
ruby-bindings fails because I don't have the ruby development tools
installed on my machine.

I with configure has an option to skip the ruby-bindings build.


 On Fri, Jun 12, 2015 at 11:37 PM, David Bremner da...@tethera.net wrote:
 David Bremner da...@tethera.net writes:

 Because ruby generates a Makefile, we have to use recursive make.
 Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
 in the parent directory.

 Pushed the first patch in the series. Let's see if anything breaks.

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


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 01:46 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 On Sat, Jun 13, 2015 at 12:59 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
 should be lib/libnotmuch.dylib on OS X.

 That makes `make' and `make install' fail.

 Even after I update the dependency to lib/libnotmuch.dylib, building
 ruby-bindings fails because I don't have the ruby development tools
 installed on my machine.

 I with configure has an option to skip the ruby-bindings build.

`configure' seems to try to detect whether the ruby development tools
are installed.  It thinks I have them but I don't actually, and that's
why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
Makefile.config, everything's fine.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread David Bremner
Jinwoo Lee jinwo...@gmail.com writes:

 I with configure has an option to skip the ruby-bindings build.

 `configure' seems to try to detect whether the ruby development tools
 are installed.  It thinks I have them but I don't actually, and that's
 why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
 Makefile.config, everything's fine.

Thanks for narrowing this down. Can you tell us the output of

% ruby -e require 'mkmf' ; echo $?

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


Re: search query replytoid:blah

2015-06-13 Thread David Bremner
Xu Wang xuwang...@gmail.com writes:

 Dear all,

 Is it possible to search based on which message ID a message
 *responds* to? For example, suppose message id is MESSAGEID. I want to
 find all emails that responded to MESSAGEID. How to enter such a query
 into notmuch?

Threads aren't exactly the concept you ask for, because the include the
messages before the message-id in question as well. Nonetheless, maybe
the following helps:


% notmuch show $(notmuch search --output=threads $MESAGEID)

or

% notmuch search --output=messages $(notmuch search --output=threads $MESAGEID)
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 02:11 PM, David Bremner da...@tethera.net wrote:
 Jinwoo Lee jinwo...@gmail.com writes:

 I with configure has an option to skip the ruby-bindings build.

 `configure' seems to try to detect whether the ruby development tools
 are installed.  It thinks I have them but I don't actually, and that's
 why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
 Makefile.config, everything's fine.

 Thanks for narrowing this down. Can you tell us the output of

 % ruby -e require 'mkmf' ; echo $?

This command succeeds and returns 0.

When I change the dependency of ruby-bindings from libnotmuch.so to
libnotmuch.dylib and run `make', I get errors like below.

Looks like mkmf.rb (I have no idea what this is) is provided by OS X by
default, but actually running it fails.

...
[snip]
...
checking for notmuch_database_create in libnotmuch.so... *** extconf.rb failed 
***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir

--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in
 `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:513:in
 `block in try_link0'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:88:in
 `mktmpdir'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:510:in
 `try_link0'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:534:in
 `try_link'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:720:in
 `try_func'
from extconf.rb:19:in `block in have_local_library'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in
 `block in checking_for'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in
 `block (2 levels) in postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in
 `open'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in
 `block in postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in
 `open'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in
 `postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in
 `checking_for'
from extconf.rb:17:in `have_local_library'
from extconf.rb:25:in `main'
make: *** [ruby-bindings] Error 1

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


Re: Understanding the replied tag

2015-06-13 Thread Suvayu Ali
Hi,

On Sat, Jun 13, 2015 at 02:44:46PM -0400, Xu Wang wrote:
 
 Thank you. The problem in the end is that I would like 'notmuch new'
 to not only schronize the 'reply' tag but to master handle the reply
 tag because notmuch knows which messages have been replied to (because
 it is aware of threads).

Sorry, I have no idea what you are saying.  It would help a lot if you
explicitly state what you tried, what you expected, and what you saw.
For example, you still haven't mentioned that you are using mutt-kz as
your MUA.  I know that because we had an earlier discussion on
mutt-users.  It is very hard to suggest something without knowing
precisely what you tried.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: search query replytoid:blah

2015-06-13 Thread Suvayu Ali
Hi,

On Sat, Jun 13, 2015 at 02:47:00PM -0400, Xu Wang wrote:
 
 Is it possible to search based on which message ID a message
 *responds* to? For example, suppose message id is MESSAGEID. I want to
 find all emails that responded to MESSAGEID. How to enter such a query
 into notmuch?

AFAIK, this is not possible.  Notmuch does not allow searching special
headers.  You could probably write a script using the threads output
format to get the thread, and then use formail to find the responses.

I however think you are probably approaching the problem incorrectly,
but that's just a guess.  More information about what is your goal and
why, would help.  Maybe there is another way to achieve what you want to
achieve.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
That error is from 'cd bindings/ruby  ruby extconf.rb --vendor' BTW.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 02:24 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 That error is from 'cd bindings/ruby  ruby extconf.rb --vendor' BTW.

The contents of mkmf.log are below.  It shows a warning about
-L/usr/local/lib and I don't have the directory /usr/local/lib on my
machine.  I'm not sure if that's the cause of the error though.  I don't
write Ruby and know nothing about it.

xcrun clang -o conftest -I../../lib 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 
-I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT  
  -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. 
-L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. 
-L/usr/local/lib -Wl,--no-undefined   -arch x86_64 -arch i386   -lruby.2.0.0  
-lpthread -ldl -lobjc 
ld: warning: directory not found for option '-L/usr/local/lib'
ld: unknown option: --no-undefined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include ruby.h
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

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