Re: Bug: ol-notmuch.el: calls `notmuch-show' with arbitrary search query

2019-11-27 Thread David Edmondson
On Wednesday, 2019-11-27 at 10:42:59 -07, Sean Whitton wrote:

> On Wed 27 Nov 2019 at 01:08PM +00, David Edmondson wrote:
>
>> On Tuesday, 2019-11-26 at 16:25:29 -07, Sean Whitton wrote:
>>
>>> On Tue 26 Nov 2019 at 10:52PM +00, David Edmondson wrote:
>>>
 The poor behaviour is just a side effect of the way that queries are
 composed to implement the filter functionality. Does the attached patch
 help?
>>>
>>> Unfortunately, it is still broken in my test case.
>>
>> Could you describe your test case please? (We could remove emacs-orgmode
>> for that conversation if you think it appropriate.)
>
> I have this function which calls notmuch-show-filter-thread:
>
> (defun spw--notmuch-show-filter-thread-patches ( reroll-count)
>   (interactive "P")
>   (let ((subject-filter
>  (if reroll-count
>  (let ((n (prefix-numeric-value reroll-count)))
>(if (= n 1)
>"(subject:/\\[.*PATCH[^v]*\\]/ or 
> subject:/\\[.*PATCH.*v1.*\\]/)"
>  (concat "subject:/\\[.*PATCH.*v" (number-to-string n) 
> ".*\\]/")))
>"subject:/\\[.*PATCH.*\\]/ ")))
> (notmuch-show-filter-thread
>  (concat "tag:unread or tag:flagged or ("
>  subject-filter
>  " and not subject:'Re:' and not subject:'Info received')"
>
> Copy-pasting the whole function since you mentioned you were interested
> in the notmuch patch review functionality I'm working on, but let me
> know if you want a narrower test case.

If this does what I think, which is to filter the current thread to show
only those messages that contain actual patches (with an optional
version number), then, with the previous patch I sent, it seems to work
just fine for me if the original `notmuch-show' query is something like
“thread:a or thread:b”, where those threads both contain both patches
and comments on the patches.

An example call I used initially is:

(notmuch-show "thread:{id:20191117222929.1064-1-j...@jb55.com} or 
thread:{id:20190419035659.28961-1-congdan...@gmail.com}")

Hopefully this is a query that will work for you as well. Limiting this
using your function behaves as I would expect.

It's a lot to ask, I know, but if you could provide a specific set of
messages with a corresponding initial query that fails for you after
limiting using your function, it would be helpful.

>>> The purpose of `notmuch-extract-thread-patches' is to extract a whole
>>> git-send-email(1) patch series at a time, because that is usually what
>>> one wants to do.  There are `notmuch-extract-message-patches' and
>>> `notmuch-show-pipe-message' for single patches.
>>
>> Then I think the approach that you have (wrapping the query in
>> thread:{}) makes perfect sense.
>
> To my mind, it makes sense only to the extent that committing hacky
> workarounds is something which makes sense :)

Well, if we stick to the idea that the first argument to `notmuch-show'
can only be a thread ID, then yes.

Given that thread IDs have some annoying properties, it would be
convenient to allow the caller to pass an arbitrary query.

If we fix anything that is broken by that, I'm happy to provide a patch
that changes the code (and any implicit or explicit documentation)
accordingly.

dme.
-- 
This is the time. This is the record of the time.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 0/7] Port notmuch-show's x/X bindings to notmuch-tree

2019-11-27 Thread Teemu Likonen
Teemu Likonen [2019-11-20T10:10:43+02] wrote:

> William Casarin [2019-11-17T14:29:22-08] wrote:
>> These patches bring notmuch-tree more in line with the user experience
>> of notmuch-show by adding the x/X bindings.
>
> I have not tested the patch set yet but I think it is very good idea
> to add x/X keybindings to make tree view work similarly to show view.

Now I have been using the patch set some days and it works as expected.
Usually I open a thread with M-TAB (notmuch-tree-from-search-thread) and
if I then find thread uninteresting I hit "X"
(notmuch-tree-archive-thread-then-exit) and continue browsing the thread
list.

I'm quite experienced with Emacs Lisp (and Common Lisp) but I don't know
Notmuch Emacs code to give educated comments on this patch set's code.
From user's side it works and I support this feature. Thanks!

-- 
///  OpenPGP key: 4E1055DC84E9DFF613D78557719D69D324539450
//  https://keys.openpgp.org/search?q=tliko...@iki.fi
/  https://keybase.io/tlikonen  https://github.com/tlikonen


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Bug: ol-notmuch.el: calls `notmuch-show' with arbitrary search query

2019-11-27 Thread Sean Whitton
[dropping Org-mode list per David's suggestion]

Hello,

On Wed 27 Nov 2019 at 01:08PM +00, David Edmondson wrote:

> On Tuesday, 2019-11-26 at 16:25:29 -07, Sean Whitton wrote:
>
>> On Tue 26 Nov 2019 at 10:52PM +00, David Edmondson wrote:
>>
>>> The poor behaviour is just a side effect of the way that queries are
>>> composed to implement the filter functionality. Does the attached patch
>>> help?
>>
>> Unfortunately, it is still broken in my test case.
>
> Could you describe your test case please? (We could remove emacs-orgmode
> for that conversation if you think it appropriate.)

I have this function which calls notmuch-show-filter-thread:

(defun spw--notmuch-show-filter-thread-patches ( reroll-count)
  (interactive "P")
  (let ((subject-filter
 (if reroll-count
 (let ((n (prefix-numeric-value reroll-count)))
   (if (= n 1)
   "(subject:/\\[.*PATCH[^v]*\\]/ or 
subject:/\\[.*PATCH.*v1.*\\]/)"
 (concat "subject:/\\[.*PATCH.*v" (number-to-string n) 
".*\\]/")))
   "subject:/\\[.*PATCH.*\\]/ ")))
(notmuch-show-filter-thread
 (concat "tag:unread or tag:flagged or ("
 subject-filter
 " and not subject:'Re:' and not subject:'Info received')"

Copy-pasting the whole function since you mentioned you were interested
in the notmuch patch review functionality I'm working on, but let me
know if you want a narrower test case.

>> The purpose of `notmuch-extract-thread-patches' is to extract a whole
>> git-send-email(1) patch series at a time, because that is usually what
>> one wants to do.  There are `notmuch-extract-message-patches' and
>> `notmuch-show-pipe-message' for single patches.
>
> Then I think the approach that you have (wrapping the query in
> thread:{}) makes perfect sense.

To my mind, it makes sense only to the extent that committing hacky
workarounds is something which makes sense :)

> Presumably this all arises because thread IDs are neither stable nor
> portable, so they are inappropriate to store in an external document (as
> an org-mode link in this case)?

Indeed.

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


Re: Bug: ol-notmuch.el: calls `notmuch-show' with arbitrary search query

2019-11-27 Thread David Edmondson
On Tuesday, 2019-11-26 at 16:25:29 -07, Sean Whitton wrote:

> On Tue 26 Nov 2019 at 10:52PM +00, David Edmondson wrote:
>
>> The poor behaviour is just a side effect of the way that queries are
>> composed to implement the filter functionality. Does the attached patch
>> help?
>
> Unfortunately, it is still broken in my test case.

Could you describe your test case please? (We could remove emacs-orgmode
for that conversation if you think it appropriate.)

>>> Further, my package 'mailscripts' tries to pass the current value of
>>> `notmuch-show-thread-id' to notmuch-extract-patch(1).
>>>
>>> https://git.spwhitton.name/mailscripts/tree/mailscripts.el#n72
>>>
>>> https://manpages.debian.org/notmuch-extract-patch
>>>
>>> If `notmuch-show-thread-id' contains a query which returns a single
>>> message, the wrong value is passed to notmuch-extract-patch(1), such
>>> that it may not extract all of the patches in the thread.
>>
>> It's not clear to me that this is broken.
>>
>> notmuch-extract-patch seems to be properly extracting patches from the
>> messages that match the query.
>>
>> If the current `notmuch-show' buffer query doesn't match the entire
>> thread, why should `notmuch-extract-thread-patches' be expected to apply
>> patches from the whole thread?
>
> The purpose of `notmuch-extract-thread-patches' is to extract a whole
> git-send-email(1) patch series at a time, because that is usually what
> one wants to do.  There are `notmuch-extract-message-patches' and
> `notmuch-show-pipe-message' for single patches.

Then I think the approach that you have (wrapping the query in
thread:{}) makes perfect sense.

> (I note that this is a mailscripts design question, not strictly
> relevant to the issue of ol-notmuch.el causing the
> notmuch-show-thread-id variable to be mispopulated.  Thank you for your
> engagement with mailscripts, regardless!)

Well, I'm interested in the functionality that it provides :-)

Presumably this all arises because thread IDs are neither stable nor
portable, so they are inappropriate to store in an external document (as
an org-mode link in this case)?

dme.
-- 
Hello? Is anybody home? Well, you don't know me, but I know you.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


notmuch release 0.29.3 now available

2019-11-27 Thread David Bremner

Where to obtain notmuch 0.29.3
===
  https://notmuchmail.org/releases/notmuch-0.29.3.tar.xz

Which can be verified with:

  https://notmuchmail.org/releases/notmuch-0.29.3.tar.xz.sha256.asc
  -BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

d5f704b9a72395e43303de9b1f4d8e14dd27bf3646fdbb374bb3dbb7d150dc35  
notmuch-0.29.3.tar.xz
-BEGIN PGP SIGNATURE-

iQIzBAEBCAAdFiEEkiyHYXwaY0SiY6fqA0U5G1WqFSEFAl3eb0sACgkQA0U5G1Wq
FSG+CA/9Ec4hpZKiPbwe9EFAafZ6YZBBkAJOblIjK5P3FSQ/p7DiKumAvEb2iTDJ
gqTxe07/pNfHaVbh3RvwBbsgCZ7dwEE72vLTrDhDcI9ly3u98aR1/FRkukhW6536
E3d3p9W65uyHPQer2guvVdlAFRrtEjnp9NX0krUoXs/pqs6qRJ6Zd1+Vvx/1aKK9
ai0TJGDhJL/ZTzs4i+SZO4y6K1W9Xe+QPThd11d1UYPKjlsGJPNhy/u/uUF1YpFI
sgomOAjUvLp1VsWbw/M21TvMfOeddTaBhJZ3876MT/RNR5qFdQkEpxSJNiN/TD8H
7Sn3TWtFVfgYYOWIo0nclwanq7p89EkgbWhuWlOVNx9nG8fMU7QMGPW5TjF63bjF
/1zPDprW+MTrsIfCGJXBeqHLZHjbQP8A9AT1uYTXg88Z0H1iRlfCqN53SgBQdJRD
I0iFVkDZ0IJvcdlDtrhvLxc2mS564at8lQctSpV8JxDGyZvEt4746MfeTzL/iXlH
bKkDyMnY8W/2+j0wnEO1YGB6tJW8lTHE3ZV9Kq2wJ8oPgDREpCP/T2KfOlC7lynl
5sqqm06YlJcI0q2suqTKGFNdExS5clhNjsRVJSmab9wZhfmVaTEhsspsZvNBBYPn
S7pGJlXncsoL6MDX5TvOewhZwHG+sVf/qsIzP3R9+eDieapF9cI=
=kgSf
-END PGP SIGNATURE-

  https://notmuchmail.org/releases/notmuch-0.29.3.tar.xz.asc
  (signed by David Bremner)

What's new in notmuch 0.29.3
=

General
---

Fix for use-after-free in notmuch_config_list_{key,val}.

Fix for double close of file in notmuch-dump.

Debian
--

Drop python2 support from shipped debian packaging.

What is notmuch
===
Notmuch is a system for indexing, searching, reading, and tagging
large collections of email messages in maildir or mh format. It uses
the Xapian library to provide fast, full-text search with a convenient
search syntax.

For more about notmuch, see https://notmuchmail.org



signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch