Re: [PATCH] Don't bother checking for mbox files

2016-03-13 Thread Edward Betts
Keith Packard  wrote:
> Postfix adds mbox-style From lines when used in combination with
> maildrop or .forward files. If they have another line starting with
> 'From ' in them, notmuch complains about them not being mail files.
> 
> If we assume the user hasn't screwed up and misconfigured their mail
> system, then we can safely ignore whether the file started with an
> mbox header and just parse it as a single-message file.

I think it is fine to go ahead with this change. At the same time the
behaviour of Postfix should be corrected so it doesn't add mbox-style From
lines to mails in maildir format.

The same problem existed in the Debian exim4 config. I filed a bug, it was
fixed: https://bugs.debian.org/769396

Here is a bug in maildrop suggesting that it should strip the mbox-style From
line from the top of mails: https://bugs.debian.org/737383

-- 
Edward.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] use notmuch_database_open_verbose

2016-03-13 Thread Patrick Totzke
As far as I understand the bindings, the returned message is not needed
because the return
value of `Database._open` (line 212) contains information about the type of
error that occurred.
This is passed on two lines below if the open-call was unsuccessful.

The docstrings for this method are not ideal (the mentioned "status"
parameter is actually called "mode") but in terms of functionality it seems
ok.

On 12 March 2016 at 16:33, David Bremner  wrote:

> David Bremner  writes:
>
> >> -"""notmuch_database_open"""
> >> -_open = nmlib.notmuch_database_open
> >> +"""notmuch_database_open_verbose"""
> >> +_open = nmlib.notmuch_database_open_verbose
> >>  _open.argtypes = [c_char_p, c_uint, POINTER(NotmuchDatabaseP)]
> >>  _open.restype = c_uint
> >
> > I expect you probably want to add the new binding, rather than replacing
> > the old one. Otherwise updating the bindings will break all bindings
> > using scripts.
>
> Oh silly me. That's not actually exposed to the python API, so that's
> fine. On the other hand, don't you want to update the argument types and
> do something useful (throw an exception?) with the returned message?  As
> it stands you lose information.
>
> d
>
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: hello: promote '?' as the universal help key

2016-03-13 Thread Jani Nikula
Move the brief help text at the bottom of the hello screen to the
notmuch-hello-mode help, and promote '?' as the universal help key
across Notmuch. This unclutters the hello screen, and allows for a
more verbose description in the mode help. Hopefully, this change is
useful for both experienced and new users alike.

While at it, improve the links to Notmuch and hello screen
customization.

---

This obsoletes
id:1450026221-23286-1-git-send-email-j...@nikula.org
---
 emacs/notmuch-hello.el | 44 +-
 test/emacs.expected-output/notmuch-hello   |  7 +---
 .../emacs.expected-output/notmuch-hello-long-names |  7 +---
 .../notmuch-hello-no-saved-searches|  7 +---
 .../emacs.expected-output/notmuch-hello-with-empty |  7 +---
 5 files changed, 42 insertions(+), 30 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index b42e0f24148a..8a31f9a1c52c 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -672,6 +672,31 @@ with `notmuch-hello-query-counts'."
 (defun notmuch-hello-mode ()
  "Major mode for convenient notmuch navigation. This is your entry portal into 
notmuch.
 
+Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
+or click on a saved search to view matching threads. Edit saved
+searches with the `edit' button. Type `\\[notmuch-jump-search]'
+in any Notmuch screen for quick access to saved searches that
+have shortcut keys.
+
+Type new searches in the search box and hit RET to view matching
+threads. Hit RET in a recent search box to re-submit a previous
+search. Edit it first if you like. Save a recent search to saved
+searches with the `save' button.
+
+Hit `\\[notmuch-search]' or `\\[notmuch-tree]' in any Notmuch
+screen to search for messages and view matching threads or
+messages, respectively. Recent searches are available in the
+minibuffer history.
+
+Expand the all tags view with the `show' button (and collapse
+again with the `hide' button). Hit RET or click on a tag name to
+view matching threads.
+
+Hit `\\[notmuch-refresh-this-buffer]' to refresh the screen and
+`\\[notmuch-bury-or-kill-this-buffer]' to quit.
+
+The screen may be customized via `\\[customize]'.
+
 Complete list of currently available key bindings:
 
 \\{notmuch-hello-mode-map}"
@@ -907,20 +932,19 @@ following:
 (defun notmuch-hello-insert-footer ()
   "Insert the notmuch-hello footer."
   (let ((start (point)))
-(widget-insert "Type a search query and hit RET to view matching 
threads.\n")
-(when notmuch-search-history
-  (widget-insert "Hit RET to re-submit a previous search. Edit it first if 
you like.\n")
-  (widget-insert "Save recent searches with the `save' button.\n"))
-(when notmuch-saved-searches
-  (widget-insert "Edit saved searches with the `edit' button.\n"))
-(widget-insert "Hit RET or click on a saved search or tag name to view 
matching threads.\n")
-(widget-insert "`=' to refresh this screen. `s' to search messages. `q' to 
quit.\n")
+(widget-insert "Hit `?' for context-sensitive help in any Notmuch 
screen.\n")
+(widget-insert "Customize ")
+(widget-create 'link
+  :notify (lambda (&rest ignore)
+(customize-group 'notmuch))
+  :button-prefix "" :button-suffix ""
+  "Notmuch")
+(widget-insert " or ")
 (widget-create 'link
   :notify (lambda (&rest ignore)
 (customize-variable 'notmuch-hello-sections))
   :button-prefix "" :button-suffix ""
-  "Customize")
-(widget-insert " this page.")
+  "this page.")
 (let ((fill-column (- (window-width) notmuch-hello-indent)))
   (center-region start (point)
 
diff --git a/test/emacs.expected-output/notmuch-hello 
b/test/emacs.expected-output/notmuch-hello
index 9ba4cfc1d560..89186082f8a9 100644
--- a/test/emacs.expected-output/notmuch-hello
+++ b/test/emacs.expected-output/notmuch-hello
@@ -8,8 +8,5 @@ Search: 
.
 
 All tags: [show]
 
-Type a search query and hit RET to view matching threads.
-   Edit saved searches with the `edit' button.
-  Hit RET or click on a saved search or tag name to view matching threads.
-  `=' to refresh this screen. `s' to search messages. `q' to quit.
-   Customize this page.
+Hit `?' for context-sensitive help in any Notmuch screen.
+ Customize Notmuch or this page.
diff --git a/test/emacs.expected-output/notmuch-hello-long-names 
b/test/emacs.expected-output/notmuch-hello-long-names
index 1c8d6eb624b9..da0f3525325d 100644
--- a/test/emacs.expected-output/notmuch-hello-long-names
+++ b/test/emacs.expected-output/notmuch-hello-long-names
@@ -11,8 +11,5 @@ All tags: [hide]
  52 a-very-long-tag   52 inbox 52 unread
 

Re: [PATCH] use notmuch_database_open_verbose

2016-03-13 Thread David Bremner
Patrick Totzke  writes:

> As far as I understand the bindings, the returned message is not needed
> because the return
> value of `Database._open` (line 212) contains information about the type of
> error that occurred.
> This is passed on two lines below if the open-call was unsuccessful.
>
> The docstrings for this method are not ideal (the mentioned "status"
> parameter is actually called "mode") but in terms of functionality it seems
> ok.

The error_message parameter (potentially) contains additional
information about an error. In any case, you're passing one too few
arguments to n_d_open_verbose, which doesn't seem like a good idea.

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


Re: [PATCH] Don't bother checking for mbox files

2016-03-13 Thread Jani Nikula
On Sun, 13 Mar 2016, Edward Betts  wrote:
> Keith Packard  wrote:
>> Postfix adds mbox-style From lines when used in combination with
>> maildrop or .forward files. If they have another line starting with
>> 'From ' in them, notmuch complains about them not being mail files.
>> 
>> If we assume the user hasn't screwed up and misconfigured their mail
>> system, then we can safely ignore whether the file started with an
>> mbox header and just parse it as a single-message file.
>
> I think it is fine to go ahead with this change. At the same time the
> behaviour of Postfix should be corrected so it doesn't add mbox-style From
> lines to mails in maildir format.

I disagree with making the change (as-is, at least).

In general, Notmuch does not support mboxes. We expect maildir style one
message per file mail storage. We support single-message mboxes as a
special case, in part because, as you note, there's plenty of other
software that adds the mbox "From " line even though delivering to
maildir.

I think it's misleading and confusing to the users to accept and index
the first message of mboxes, and silently ignore the rest (or worse,
index all of the mbox and associate the text with the first message). I
think we should reject multi-message mboxes, because we have no code to
handle them. This patch throws away that check.

Now, IIUC, the problem here is not that the files actually are
multi-message mboxes. We could use a sample message (even a crafted one)
that exhibits the problem, so we could add a test case, and fix Notmuch
to deal with it gracefully (if we decide catering to potentially broken
other software is the way to go), while retaining the code to reject
multi-message mboxes. With the test case, we'd also avoid accidentally
breaking this in the future.

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


Re: [PATCH v1 0/3] Improve the acquisition of text parts.

2016-03-13 Thread Mark Walters

This looks good to me +1. However, it would be sensible to get testing 
in a greater variety of charsets/encodings

Best wishes

Mark


On Tue, 08 Mar 2016, David Edmondson  wrote:
> Improve the acquisition of text parts.
>
> This affects the new "reply" behaviour and the rendering of
> application/octet-stream parts that are treated as text.
>
>
> David Edmondson (3):
>   emacs: `notmuch-show-insert-part-multipart/encrypted' should not
> assume the presence of a button.
>   emacs: Neaten `notmuch-show-insert-bodypart-internal'.
>   emacs: Improve the acquisition of text parts.
>
>  emacs/notmuch-lib.el  | 73 
> ++-
>  emacs/notmuch-show.el | 28 +---
>  2 files changed, 43 insertions(+), 58 deletions(-)
>
> -- 
> 2.1.4
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: (emacs) Parsing problems replying to encrypted html

2016-03-13 Thread Jani Nikula
On Sat, 12 Mar 2016, David Edmondson  wrote:
> Is "reply" from search mode a common pattern of use? Currently it seems
> generally un-useful (the thread has to contain just a single message -
> not just a single matching message).

I wish we could make it useful again. It was one of the neat features of
notmuch to be able to reply to multiple messages at once. Either all
messages in a thread from search view, or all expanded messages in a
thread from show view. We threw this out to make it easier to improve
the normal reply code.

As to whether it was a common pattern or not, I don't recall a single
complaint after the feature was dropped.

BR,
Jani.

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


Re: Bug#817964: notmuch: indexing daemon

2016-03-13 Thread Justus Winter
Quoting David Bremner (2016-03-12 12:24:47)
> Paul Wise  writes:
> > I expect the right interface to use for notifications of filesystem
> > events is inotify since fanotify doesn't send rename events. This would
> > require one inotify per directory.

Fwiw, afew does exactly that.

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