Commit Graph

539 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 3e5cec0d05 tests: update for new query parser / ngrams 2023-09-09 17:57:42 +03:00
Dirk-Jan C. Binnema 264bb092f0 support xapian ngrams
Xapian supports an "ngrams" option to help with languages/scripts
without explicit wordbreaks, such as Chinese / Japanese / Korean.

Add some plumbing for supporting this in mu as well. Experimental for
now.
2023-09-09 17:26:20 +03:00
Dirk-Jan C. Binnema f6122ecc9e mu-find: add --analyze option
For analyzing queries with the new query-parser.
2023-09-09 11:59:59 +03:00
Dirk-Jan C. Binnema d7f8a64b20 mu: modernize command-line unit tests 2023-08-27 11:07:55 +03:00
Dirk-Jan C. Binnema 15f08488d3 remove Mu::format, use mu_format
Use the new fmt-based formatting.
2023-08-19 20:04:50 +03:00
Dirk-Jan C. Binnema 4945e699c8 lib/mu: use fmt-based time/date formatting
For a small speedup
2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema aea95b5be0 mu-server: use strings, not sexps object (optimization)
When passing messages to mu, often we got a (parsed from string)
message-sexp from the message document; then appended some more
properties ("build_message_sexp").

Instead, we can do it in terms of the strings; this is _a little_
inelegant, but also much faster; compare:

(base)
[mu4e] Found 500 matching messages; 0 hidden; search: 1298.0 ms (2.60 ms/msg); render: 642.1 ms (1.28 ms/msg)

(with temp-file optimization (earlier commit)
[mu4e] Found 500 matching messages; 0 hidden; search: 1152.7 ms (2.31 ms/msg); render: 270.1 ms (0.54 ms/msg)

(with temp file optimize _and_ the string opt (this commit)
[mu4e] Found 500 matching messages; 0 hidden; search: 266.0 ms (0.53 ms/msg); render: 199.7 ms (0.40 ms/msg)
2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema 924bb2145e mu-server: implement temp-file optimization
It can be faster to feed big mu -> mu4e data, such as contacts are
message headers through a temp-file instead directly though stdout;
implement this, and add the server parameter --allow-temp-file.

Implement this the "contacts" and "find" commands.
2023-08-04 00:09:02 +03:00
Dirk-Jan C. Binnema a71b4f5e8d options: expand option file paths
Fixes #2528
2023-08-03 22:47:27 +03:00
Dirk-Jan C. Binnema ade62fc67c options: implement ExpandPath transformer
For expanding shell options (with expand_path / wordexp)

Note that e.g. in zsh: --maildir=~/Maildir is handled (program receives
--maildir=/home/user/Maildir) but e.g. bash does not do that, and the
program receives the literal '~/Maildir'

We expanded this in mu earlier, so let's do that again.
2023-08-03 22:47:27 +03:00
Dirk-Jan C. Binnema 5409c2cd87 mu-view: attempt to avoid locale diffs in test
A bit ugly attempt make tests work in CI
2023-07-30 00:51:12 +03:00
Dirk-Jan C. Binnema 3a38d6366a mu-view: test locale to C for tests 2023-07-29 17:25:07 +03:00
Dirk-Jan C. Binnema 3ada6af63a mu-view: check for timezone availability in tests 2023-07-29 16:39:44 +03:00
Dirk-Jan C. Binnema 1f0342a91f mu-view: add unit-test 2023-07-28 19:43:46 +03:00
Dirk-Jan C. Binnema 455119f695 Merge branch 'wip/djcb/html-to-text' 2023-07-26 19:11:41 +03:00
Dirk-Jan C. Binnema 30b0209f8d mu-info: add 'topic mu' information; improve manpage
Show some more runtime information in the 'mu' topic, and make that the
default. Update manpage.
2023-07-26 19:09:18 +03:00
Dirk-Jan C. Binnema b795242d5a message: use html-to-text scraper for html parts
We were dumping the HTML-parts as-is in the Xapian indexer; however,
it's better to remove the html decoration first, and just pass the text.

We use the new built-in html->text scraper for that.
2023-07-25 21:26:36 +03:00
Dirk-Jan C. Binnema 23ba61a650 mu-find: internal cleanups / modernization
use fmt and Result-based APIs.
2023-07-25 21:26:01 +03:00
Dirk-Jan C. Binnema dcf2298680 mu: use fmt-based apis in mu index/server and options
iostream is so 1998.
2023-07-25 21:11:56 +03:00
Dirk-Jan C. Binnema 85a2490300 mu-init: improve user output 2023-07-25 11:11:53 +03:00
Dirk-Jan C. Binnema 3337c9babb mu-view: add --format=html
Support showing the HTML body (if any) instead of the default plain-text
body.

Update manpage.
2023-07-23 21:04:26 +03:00
Dirk-Jan C. Binnema 7b38f094c4 migrate some more code to mu_format / join_paths
Let's modernize a bit.
2023-07-20 23:14:29 +03:00
Dirk-Jan C. Binnema ecb3c9139f mu-mkdir: add unit tests 2023-07-19 08:48:44 +03:00
Dirk-Jan C. Binnema 0cb78fe4d1 mu-remove: add unit test 2023-07-18 21:33:59 +03:00
Dirk-Jan C. Binnema 8b66491a72 mu-add: update unit test 2023-07-18 21:33:33 +03:00
Dirk-Jan C. Binnema 3c9d1f1ab1 mu: cmd-init: fix batch-size typo
Copy-pasta
2023-07-16 13:19:35 +03:00
Dirk-Jan C. Binnema a32b924692 mu: add "unit" tests for 'mu add' 2023-07-10 23:15:40 +03:00
Dirk-Jan C. Binnema 31f0c40893 migrate to fmt-based logging in some more places
and improve logging.
2023-07-08 10:30:36 +03:00
Dirk-Jan C. Binnema 82235b9d49 fmt: more update to use new fmt-based APIs 2023-07-06 21:49:50 +03:00
Dirk-Jan C. Binnema d96e9cc4ba mu-info: improve docs; better colors 2023-07-06 19:13:14 +03:00
Dirk-Jan C. Binnema 4920b56671 update to use fmt-based apis
Not complete, but a first big stab converting users of Mu::Error and
various g_warning & friends, format to the new libfmt-based APIs.
2023-07-05 23:10:13 +03:00
Dirk-Jan C. Binnema 742ca33740 utils: rework Mu::Error and g_ logging macros with fmt
A bit more C++ template magic to remove a lot of code.
2023-07-05 23:07:11 +03:00
Dirk-Jan C. Binnema 9004363aa5 cli: merge 'fields' with 'info' command
Update the 'info' command to handle 'fields' as well; remove
fields.
2023-07-05 20:39:47 +03:00
Dirk-Jan C. Binnema d6416fca5e cli: add mu-cmd-{add,mkdir-remove}.cc
Missing from previous.
2023-07-02 10:04:01 +03:00
Dirk-Jan C. Binnema c4b5795328 cli: support --ignored-address for init command
Allow for skipping unwanted addresses (such as 'noreply') from the
contacts cache.
2023-07-02 10:00:40 +03:00
Dirk-Jan C. Binnema 960a436e77 cli: split off commands into their own .cc files
Smaller files are easier to manage
2023-07-02 00:06:56 +03:00
Dirk-Jan C. Binnema c6fff6a281 all: update for API changes (config etc.)
Use the new & improved APIs.
2023-07-02 00:06:56 +03:00
Dirk-Jan C. Binnema ecf87c5d82 gmime-test: fix leak 2023-06-11 12:23:23 +03:00
Dirk-Jan C. Binnema 9544473e35 mu extract/view/verify: allow reading message from stdin
Fixes #1463.
2023-04-30 10:35:28 +03:00
Dirk-Jan C. Binnema 8762ac27dc mu: improve error numbers
Ensure they match what mu expects.
2023-04-11 20:47:48 +03:00
Dirk-Jan C. Binnema ec942a988d tests: always log to file during tests
And set the cachedir (for logging and other things) to a random tmpdir.
2023-04-09 14:43:36 +03:00
Dirk-Jan C. Binnema d90692e27b tests: turn off dead test test_mu_extract_01 2023-04-09 11:17:02 +03:00
Dirk-Jan C. Binnema 0e44764702 tests: fix links tests 2023-04-09 11:03:42 +03:00
Dirk-Jan C. Binnema e43452fa18 test: don't "uniqify" link names during test 2023-04-09 11:02:58 +03:00
Dirk-Jan C. Binnema 0ab2371c5c mu-cfind: re-enable --after option
It was still there, but disabled.

Fixes #2470.
2023-04-08 20:48:46 +03:00
Dirk-Jan C. Binnema cd23e6015d mu: allow relative message paths in mu commands 2023-04-06 07:19:26 +03:00
Dirk-Jan C. Binnema ff1e06c7c8 mu-find: restore JSON output
Fixes #2453
2023-03-30 18:12:33 +03:00
Babak Farrokhi 99487c0155
Merge branch 'djcb:master' into master 2023-03-30 15:50:51 +02:00
Dirk-Jan C. Binnema 39101cf583 mu-find: brush off --format=links unit test
Enable it by default, and modernize it a little bit
2023-03-28 22:26:56 +03:00
Dirk-Jan C. Binnema 81ee182f05 mu: mu-view: don't insist on absolute path
Make it absolute so make_from_path can deal with it.
2023-03-28 20:58:11 +03:00