Commit Graph

622 Commits

Author SHA1 Message Date
3cd150f289 parser: handle implicit 'and not' 2017-11-04 12:59:48 +02:00
d18e0a1d84 query: don't be too eager matching field names
only match shortcuts when the field length was 1.
2017-11-02 08:06:48 +02:00
65863e46cd parser: fix and-not precedence
For now, don't treat "and not" specially; this gets us back into a
somewhat working state. At some point, we probably _do_ want to
special-case and_not though (since Xapian supports it).
2017-10-31 07:18:14 +02:00
ea2ffe23ae mu: fix quoting/unquoting parameters 2017-10-30 22:06:36 +02:00
363075a6fd doc: tickle
Don't error out when asked for tickle docs.
2017-10-30 21:15:47 +02:00
4ca6b527b7 mu: use correct conversion for size
This changed with the new parser.
2017-10-30 21:14:20 +02:00
6053c1ec1f mu: fix clang build
casting error
2017-10-30 08:25:43 +02:00
57b5fe6156 mu: some optimizations
add fast-path for (common) plain-ascii. fix silly static misuse.

should improve indexing with some single-digit percentage.
2017-10-29 13:34:57 +02:00
55ffb524db tokenizer: clean unicode-aware 2017-10-28 14:13:09 +03:00
0e5e8b6bce parser: add more tests 2017-10-28 14:12:50 +03:00
509500a9d2 server: update query processing
fix quoting issues with mu4e
2017-10-27 18:43:33 +03:00
6ce7c89488 phrases: only allow for index fields 2017-10-27 18:42:58 +03:00
fe18603843 parser: fix some post-c++14 code
don't require anything post c++14
2017-10-27 18:40:37 +03:00
160d3ec036 query-parser: cleanup source string
Ensure there's no non-' ' whitespace, and no trailing/leading spaces.
2017-10-27 01:21:57 +03:00
7cd7d118e2 query-parser: support phrase queries 2017-10-26 21:31:22 +03:00
17c97d4606 mu: remove some dead code 2017-10-25 23:50:17 +03:00
2d966ee2ad tests: remove obsolete tests 2017-10-25 23:50:17 +03:00
aa07c4a27c update commands for new query parser 2017-10-25 23:50:17 +03:00
5e9cafea59 integrate new query parser 2017-10-25 23:50:17 +03:00
b75f9f508b lib: implement new query parser
mu's query parser is the piece of software that turns your queries
into something the Xapian database can understand. So, if you query
"maildir:/inbox and subject:bla" this must be translated into a
Xapian::Query object which will retrieve the sought after messages.

Since mu's beginning, almost a decade ago, this parser was based on
Xapian's default Xapian::QueryParser. It works okay, but wasn't really
designed for the mu use-case, and had a bit of trouble with anything
that's not A..Z (think: spaces, special characters, unicode etc.).

Over the years, mu added quite a bit of pre-processing trickery to
deal with that. Still, there were corner cases and bugs that were
practically unfixable.

The solution to all of this is to have a custom query processor that
replaces Xapian's, and write it from the ground up to deal with the
special characters etc. I wrote one, as part of my "future, post-1.0
mu" reseach project, and I have now backported it to the mu 0.9.19.

From a technical perspective, this is a major cleanup, and allows us
to get rid of much of the fragile preprocessing both for indexing and
querying. From and end-user perspective this (hopefully) means that
many of the little parsing issues are gone, and it opens the way for
some new features.

From an end-user perspective:
- better support for special characters.
- regexp search! yes, you can now search for regular expressions, e.g.
      subject:/h.ll?o/
  will find subjects with hallo, hello, halo,  philosophy, ...

  As you can imagine, this can be a _heavy_ operation on the database,
  and might take quite a bit longer than a normal query; but it can be
  quite useful.
2017-10-24 22:55:35 +03:00
97cb519788 cosmetic 2017-08-27 17:33:21 +03:00
6eceb5eee3 mu: include signers in signature report
Include the names/email address of signer in the reports, so we can use
them in mu4e.
2017-08-27 17:32:23 +03:00
61341486d2 Support gmime 3.0 2017-07-30 16:47:38 +02:00
4014e3d210 mu: cosmetics 2017-07-02 10:46:08 +03:00
588d227171 Simplify logic of mu_str_remove_ctrl_in_place. Add tests. 2017-06-24 13:26:10 +02:00
99423234b8 mu: fix some compiler warnings 2017-06-24 12:20:16 +02:00
855a8a5c5e mu: properly escape include file-names (forward)
We weren't properly escaping filenames when returning them for
forwarding. Let's do so now.
2017-04-09 11:31:39 +03:00
d4b0b1c3b5 Merge pull request #1031 from avar/add-mu_home-env-variable
Add support for specifying --muhome via MU_HOME in the environment
2017-03-05 15:52:30 +02:00
ce88e76569 cosmetics 2017-03-05 15:32:02 +02:00
11d0515376 mu: allow for negative first param in sexp date spec
The first parameter xx in a (:date xx yy zz) can be negative in some
cases, e.g. to specify pre-1970 dates.
2017-03-05 15:32:02 +02:00
18b8ce249f Add support for specifying --muhome via MU_HOME in the environment
When you have multiple mu home directories, e.g. for the use case
detailed in my "Changing mu4e-{maildir,mu-home} from a context hook"
post to the mailing list it's quite inconvenient to have to hammer out
"mu --muhome=.. find .." every time you want to run some ad-hoc
command.

This allows me to set up a screen session where I do searches in mu
directory A in some screen panes, and searches in directory B in
others.

I initially called this MU_MUHOME but then I noticed that the perl
plugin has MUP_MU_HOME for analogous functionality, so I'm just
following its example.

The code I'm adding in mu-util.c is just a copy/paste & adjustment of
the same sort of already tested functionality in
mu_util_guess_maildir() just a few lines earlier.
2017-02-17 11:28:45 +01:00
cdc2fa1bd8 Respect format=flowed and delsp=yes for viewing plain-text messages 2017-01-31 11:28:55 +00:00
786e7c3d1f mu: add 'tickle' command, for renaming messages
The new command 'tickle' renames message files in place, which can be
useful for 3rd-party tools.
2017-01-14 13:09:17 +02:00
688507f193 lib: fix a few compiler warnings
WARN_C(XX)FLAGS is really strict.
2017-01-03 00:37:19 +02:00
72a1da9da8 mu: fix some compiler warnings 2016-12-28 16:32:39 +02:00
887e75c4ee Child processes should be session leaders.
If not, when the session of mu is killed, these child processes are also
killed. This scenario shows up when using mu4e: a PDF attachment, for
example, is opened by Evince, but as soon as Emacs exits, Evince is also
killed.
2016-12-28 13:51:20 +02:00
30dab7c312 cfind: uniquify nicks
Ensure uniqueness of nicks by adding a numerical suffix when the root
nicks are not unique (up to 1000).

Fixes issue #987.
2016-12-27 16:21:10 +02:00
78275278cf mu: fix some compiler warnings 2016-12-11 18:33:31 +02:00
e9c6568a57 mu: swap begin and end if begin is _numerically_ bigger than end
The old behaviour would compare the strings, so would swap the start and end
ranges if start was 3K and end was 2M.

Fixes: 964
2016-12-03 23:19:27 +00:00
902d081c88 mu: mark some more inline parts as attachments
Recognize some more inline parts as attachments.
2016-11-24 22:51:23 +02:00
1494923472 mu: fix broken clear_links
clear_links as used for the --clear-links option had some broken
filename generation, causing garbage data at the end.

Clean up this old code, and fix this problem as a side-effect.

Fixes issue #951.
2016-11-19 16:30:09 +02:00
98505aa23b mu: fix mu_util_fputs_encode for non-utf8
mu_util_fputs_encode was aborting on behalf of the stack-guard on
OpenBSD (seemingly only when compile with optimization). It appears as
if the root cause of this was a differences in sizes of the parameters
to g_locale_from_utf8. Fix this.
2016-11-16 20:23:03 +02:00
d30e0ab2ba mu: fix contacts callback return value
The callbacks for the contacts functions should return TRUE (or be
terminated early), but were void. Seems on Linux this usually still
worked, not so on OpenBSD at least (unit test broke). So, fix this.
2016-11-16 20:20:15 +02:00
01a47effb0 mu: include text-part attachments in body
Include text-like attachments parts in the message-body, too
2016-11-15 23:51:38 +02:00
10b3352565 mu: include patch/diff files in plain-text body
Some text/... parts can be show inline as part of the body text; for
instance patches. So, treat those specially.
2016-11-12 13:50:32 +02:00
7526f118ba mu: some cosmetics / minor cleanup 2016-10-26 22:36:40 +03:00
c9f8ac5beb crypto: prefer gpg2
Can't say I fully understand what's going on, but it seems gpg-before-2
has some trouble with its agent, at least when using
gnome-session (which stopped using gnome-keyring as a gpg-agent since
Fedora 23 at least).

Sanity seems to be restored when preferring gpg2 instead. "gpg" is used
when gpg2 isn't there; and there's the MU_GPG_PATH env variable to
override all of that.
2016-07-24 16:00:04 +03:00
9477071e63 mu: add '--lazy-check' option for indexing
Add an option --lazy-check to ignore any directories that don't have
their ctime changed since the last indexing operation.

There are a few corner-cases (such as editing a message outside mu's
control) where this might miss a change, but apart from that, makes
indexing in for a maildir (and its sub-maildirs) almost a no-op if there
were no changes.
2016-07-23 21:33:10 +03:00
2a83b02ce2 mu: cosmetic 2016-07-23 19:14:13 +03:00
3e6267fd05 mu-maildir: ignore backup/temporary files
Ignore backup/temporary files, i.e., files ending in ~ or #.

Fixes #855.
2016-06-05 19:29:53 +03:00