Re: "search --path=directory/" is lame(-ish)

2022-01-27 Thread David Bremner
David Edmondson  writes:

> Adding a terminal slash to a directory name when using --path causes the
> search to fail. Removing the terminal slash produces results.
>
> Given that many shells will add the terminal slash during completion,
> this is lame(-ish).

This bug should be fixed as of 2c1d1107f5dacdb4a2c514909fd96f45f83e2f3c
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: "search --path=directory/" is lame(-ish)

2017-03-29 Thread David Bremner
David Edmondson  writes:

> Adding a terminal slash to a directory name when using --path causes the
> search to fail. Removing the terminal slash produces results.
>
> Given that many shells will add the terminal slash during completion,
> this is lame(-ish).

This would be relatively straightforward to impliment on top of

 id:20170324121436.28978-2-da...@tethera.net

In particular add a filter to strip trailing / in the non-regex case.

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


"search --path=directory/" is lame(-ish)

2014-10-31 Thread David Bremner
David Edmondson  writes:

>
> Could we always prune a trailing slash from the path: component of a
> query before using it?
>

As I understand it, this is complicated by the fact that we pass the
whole string to Xapian to be parsed as a query, so we don't really know
where the path: terms are. We could in principle preprocess the string
(more) but that seems to be pretty fragile, and we'd have to minimally
deal with quoting of e.g. paths with spaces in them.

d


Re: search --path=directory/ is lame(-ish)

2014-10-31 Thread David Bremner
David Edmondson d...@dme.org writes:


 Could we always prune a trailing slash from the path: component of a
 query before using it?


As I understand it, this is complicated by the fact that we pass the
whole string to Xapian to be parsed as a query, so we don't really know
where the path: terms are. We could in principle preprocess the string
(more) but that seems to be pretty fragile, and we'd have to minimally
deal with quoting of e.g. paths with spaces in them.

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


"search --path=directory/" is lame(-ish)

2014-10-30 Thread David Edmondson
On Wed, Oct 29 2014, Jani Nikula wrote:
> On Wed, 29 Oct 2014, David Edmondson  wrote:
>> Adding a terminal slash to a directory name when using --path causes the
>> search to fail. Removing the terminal slash produces results.
>
> I think you mean path:, not --path.

Yes, sorry.

> Anyway, the reason for this behaviour is that the path components are
> indexed as boolean terms, not unlike tags, just with a different
> namespace. It's all parsed in Xapian, not in Notmuch. Adding the /
> variants would mean indexing twice the amount of terms.

Could we always prune a trailing slash from the path: component of a
query before using it?

>> Given that many shells will add the terminal slash during completion,
>> this is lame(-ish).
>
> Given that path: expects a relative path from the maildir root, not just
> any path, and the notmuch bash completion script (if you happen to use
> bash) does exactly this, without adding the slash, I'm not too worried.

I'm almost always doing this in Emacs shell-mode, manipulating the
pathnames on the fly. This means that I can adapt, of course.


Re: search --path=directory/ is lame(-ish)

2014-10-30 Thread David Edmondson
On Wed, Oct 29 2014, Jani Nikula wrote:
 On Wed, 29 Oct 2014, David Edmondson d...@dme.org wrote:
 Adding a terminal slash to a directory name when using --path causes the
 search to fail. Removing the terminal slash produces results.

 I think you mean path:, not --path.

Yes, sorry.

 Anyway, the reason for this behaviour is that the path components are
 indexed as boolean terms, not unlike tags, just with a different
 namespace. It's all parsed in Xapian, not in Notmuch. Adding the /
 variants would mean indexing twice the amount of terms.

Could we always prune a trailing slash from the path: component of a
query before using it?

 Given that many shells will add the terminal slash during completion,
 this is lame(-ish).

 Given that path: expects a relative path from the maildir root, not just
 any path, and the notmuch bash completion script (if you happen to use
 bash) does exactly this, without adding the slash, I'm not too worried.

I'm almost always doing this in Emacs shell-mode, manipulating the
pathnames on the fly. This means that I can adapt, of course.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


"search --path=directory/" is lame(-ish)

2014-10-29 Thread Jani Nikula
On Wed, 29 Oct 2014, David Edmondson  wrote:
> Adding a terminal slash to a directory name when using --path causes the
> search to fail. Removing the terminal slash produces results.

I think you mean path:, not --path. Anyway, the reason for this
behaviour is that the path components are indexed as boolean terms, not
unlike tags, just with a different namespace. It's all parsed in Xapian,
not in Notmuch. Adding the / variants would mean indexing twice the
amount of terms.

This could be fixed with our own query parser (somewhere at the other
end of the rainbow), but for the time being I don't see a reasonable
fix.

> Given that many shells will add the terminal slash during completion,
> this is lame(-ish).

Given that path: expects a relative path from the maildir root, not just
any path, and the notmuch bash completion script (if you happen to use
bash) does exactly this, without adding the slash, I'm not too worried.

None of this should be taken as disagreeing with you, though! ;)


BR,
Jani.


"search --path=directory/" is lame(-ish)

2014-10-29 Thread Tomi Ollila
On Wed, Oct 29 2014, David Edmondson  wrote:

> Adding a terminal slash to a directory name when using --path causes the
> search to fail. Removing the terminal slash produces results.
>
> Given that many shells will add the terminal slash during completion,
> this is lame(-ish).

Except zsh(1) which adds it, but when pressing enter to complete command
execution, the trailing slash is removed -- at least in my configuration...

... Nevertheless, I agree that the "feature" we have is at least a bit lame ;D

Tomi


"search --path=directory/" is lame(-ish)

2014-10-29 Thread David Edmondson
Adding a terminal slash to a directory name when using --path causes the
search to fail. Removing the terminal slash produces results.

Given that many shells will add the terminal slash during completion,
this is lame(-ish).


search --path=directory/ is lame(-ish)

2014-10-29 Thread David Edmondson
Adding a terminal slash to a directory name when using --path causes the
search to fail. Removing the terminal slash produces results.

Given that many shells will add the terminal slash during completion,
this is lame(-ish).
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: search --path=directory/ is lame(-ish)

2014-10-29 Thread Tomi Ollila
On Wed, Oct 29 2014, David Edmondson d...@dme.org wrote:

 Adding a terminal slash to a directory name when using --path causes the
 search to fail. Removing the terminal slash produces results.

 Given that many shells will add the terminal slash during completion,
 this is lame(-ish).

Except zsh(1) which adds it, but when pressing enter to complete command
execution, the trailing slash is removed -- at least in my configuration...

... Nevertheless, I agree that the feature we have is at least a bit lame ;D

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