Commit Graph

563 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema f813498f4d mu: add --reindex option for mu index
I.e. without having to reinit explicitly.
2024-04-05 19:03:42 +03:00
Dirk-Jan C. Binnema d13feb2d99 mu-contact: move email validation to contacts cache
So we can be sure the regexp is initialized. This _may_ help for
 https://bugzilla.opensuse.org/show_bug.cgi?id=1221861
though it is very hard to tell!
2024-04-02 07:40:20 +03:00
Dirk-Jan C. Binnema bb5c36c658 tests: add some very basic CLD2_TEST
just to check if it works at all; no need to check cld2 at all.
2024-03-01 23:05:33 +02:00
Dirk-Jan C. Binnema dcbcd697f4 mu-init: insist that --maildir is absolute 2024-02-26 01:08:44 +02:00
Dirk-Jan C. Binnema 30b8238522 tests: move to tests/, make optional
While not recommended, sometimes it can be useful to disable building
the unit tests. This can be done now with
    meson -Dtests=disabled build
2024-01-06 18:35:22 +02:00
Dirk-Jan C. Binnema b4c768e6d0 mu-init: guess maildir when --maildir is missing
Re-instate the guessing that's in the manpage. Add unit tests.
Update documentation.

Fixes #2616.
2024-01-01 10:33:03 +02:00
Dirk-Jan C. Binnema 0a5845fe8b mu-index: add unit tests 2023-12-29 22:28:10 +02:00
Dirk-Jan C. Binnema ae4f49cfc0 init: interpret batch-size 0 as 'default'
This makes writing tests easier.
2023-12-29 22:28:10 +02:00
Dirk-Jan C. Binnema 4b199e8bed mu-server: modernize sig handling
Update some old code.
2023-12-22 21:24:41 +02:00
Dirk-Jan C. Binnema 14c2b373eb mu-move: fix compiler warning 2023-11-03 21:17:43 +02:00
Dirk-Jan C. Binnema 6e45609866 mu: catch logic error
Print something useful.
2023-10-09 23:50:08 +03:00
Dirk-Jan C. Binnema 4a0eba8ddf improve unit tests 2023-09-24 20:21:57 +03:00
Dirk-Jan C. Binnema abb0fb4fd5 utils/add: improve unit test coverage 2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema 2d20074b99 mu-move: add new move sub command
Add sub-command to move messages; add tests and docs.

Fixes #157
2023-09-24 17:29:08 +03:00
Dirk-Jan C. Binnema 11003000e8 mu: log warning when exiting with error 2023-09-23 09:26:37 +03:00
Dirk-Jan C. Binnema 94c90bd0c5 fields: 'phrasable' instead of 'indexable'
'Phrasable' is probably a bit clearer description.
2023-09-17 18:11:10 +03:00
Dirk-Jan C. Binnema da49e77449 mu-info: add 'maildirs' topic
For showing all maildirs under the root.
2023-09-16 11:12:16 +03:00
Dirk-Jan C. Binnema c78dafd723 provide end-user hints and show them
Only a few for now.
2023-09-16 11:12:16 +03:00
Dirk-Jan C. Binnema 3ee2ce9647 mu/mu: tweak logging / exception handling 2023-09-13 23:04:44 +03:00
Dirk-Jan C. Binnema 2f5602b938 unit tests: improve
and add a new one for the indexer
2023-09-12 21:38:57 +03:00
Dirk-Jan C. Binnema 65460c25b6 mu-info: add some more version info
glib & gmime
2023-09-12 21:35:47 +03:00
Dirk-Jan C. Binnema 8287b9802e lib: replace mu-bookmarks with mu-query-macros
And add some unit tests.
2023-09-11 23:54:56 +03:00
Dirk-Jan C. Binnema af9eb36ca0 unit-tests: modernize
Use TempDir, join_paths etc.
2023-09-11 23:51:37 +03:00
Dirk-Jan C. Binnema 53c7381929 lib: move index/ into main lib/
simplify things a bit
2023-09-10 08:55:25 +03:00
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