Commit Graph

621 Commits

Author SHA1 Message Date
ac52584562 build: modernize meson usage
Since we require meson 1.3(.2), we can modernize the usage a bit,
as well as improve some logic

- use / instead of join_paths
- use option.allowed() instead of !option.disable()
- use cxx.get_supported_arguments
- use fs.copyfile instead of configure_file
- show a summary at the end of the configuration
2026-08-20 15:05:32 -07:00
04079aee7c mu-option: add missing doc to help-all 2026-08-20 15:05:31 -07:00
0bea84adce message: add utc-offset field
Add a new db field for storing UTC-offset for the Date: field.
2026-08-20 15:05:31 -07:00
501d27ad89 mu-server: tweak server
Try to set a larger pipe size (on Linux); and only show the mu-prompt
when talking to a tty.
2026-08-20 15:05:31 -07:00
6b1358ea48 mu: tidy up commands
Fix some typos, small errors, debug leftovers. Removed unused
mu-cmd-count.cc. Improve test-coverage. Fix manpage.

Make the errors for unknown commands a little friendlier.
2026-08-20 15:05:31 -07:00
9cf9531acc mu: improve command-line handling
- Remove some dead code
- Make error messages a bit more user-friendly.
- Small cleanups
- Add unit tests and actually run them
2026-08-20 15:05:31 -07:00
497b3db074 docs: fix some typos
Signed-off-by: John E <jeis4wpi@outlook.com>
2026-08-20 15:05:31 -07:00
4489d513be migrate to std::ranges
Move the various seq_ functions, as well as std::(stable_)sort,
std::accumulate, std::transform, std::find, std::find_if to their C++20
std::ranges counterparts.
2026-08-20 15:05:31 -07:00
40ee042b6d scm: fix build-scm check 2026-08-20 15:05:31 -07:00
91ad1c4478 cld2: fix HAVE_CLD2 test
It _is_ defined (as 0) when there is no CLD2.
2026-08-20 15:05:30 -07:00
a347d3ada0 properties: support system-properties
Support "system" properties, i.e., library versions, whether
language-detection, scm is supported.

Make these more generic (with display strings), so we can handle them
more automatic int mu-cmd-info.
2026-08-20 15:05:30 -07:00
f3361b9cee server: small tweaks
Handle a few small issues / typos, make the code a little clearer and
add some comments. Remove some dead code.
2026-08-20 15:05:30 -07:00
86464cd083 modernization: tweaks for c++20
Update various places for what we can do with C++20:

- ends_with / starts_with
- std::to_array
- using instead of typedef
- designated initializers
- "[[maybe_unused]]" instead of G_GNUC_UNUSED

Also remove some unnecessary 'static'
2026-08-20 15:05:30 -07:00
502c9cd67b lib: use ascii ctype utils
Use the new ascii ctype utils.
2026-08-20 15:05:30 -07:00
4594bb7952 mu-move: default to using old flags
And update tests as well.
2026-08-20 15:05:29 -07:00
45b9722040 mu/lib: fix some possible quoting issues 2026-08-20 15:05:28 -07:00
6dca68b989 scm: support --eval
With the ~--eval~ option you can evaluate an expression in mu/scm
environment. For example:

$ mu scm --eval \
  '(format #t "found ~d match(es)\n" (length (mfind "hello")))'
found 7173 match(es)

Add command-line parameter and implement.
2026-08-20 15:05:28 -07:00
2b6d709158 mu-labels: improve command-line handling
Esp., better handle the 'no subcommand' case: give the user some more useful
help.
2026-08-20 15:04:27 -07:00
410ff46881 improve invoking external commands
- don't make assumptions on where programs live (i.e., /bin/sh, /bin/rm,
/bin/mv) are not universal
- dont invoke shell when unnecessary
- improve error-handling
2026-08-20 15:04:27 -07:00
4acf708eb9 logging: don't g_message with --quiet
When `--quiet` is passed (and not --debug), do not log with g_message at
startup.
2026-08-20 15:04:27 -07:00
656aa41ada rename 'mu label' -> 'mu labels'
Update names, docs etc.
2026-08-20 15:04:26 -07:00
3a12c69b10 mu: refactor labels code
Split labels-cache and store-labels.
2026-08-20 15:04:26 -07:00
124b371850 labels: allow restoring cache-map
E.g. with unexpected termination for mu it is possible that the
labels-cache (i.e., the one that is used for auto-completion) gets disconnected
from reality.

Add a --restore option to `mu label list` to restore the actual labels from the
labels seen in the store.
2026-08-20 15:04:26 -07:00
5ba4791add mu-label: no counts in list unless verbose 2026-08-20 15:04:26 -07:00
daaf3d6e75 mu: cmd-label: cosmetics 2026-08-20 15:04:26 -07:00
3e5ef67650 mu: improve command help 2026-08-20 15:04:25 -07:00
013233c041 scm: clean up scm running
Split run_script / run_repl more clearly; update callers.
2026-08-20 15:04:25 -07:00
9a2d481fc3 mu: add --listen option for server
Add a --listen option for the server

Rework the option code to share the --listen / socket-path code between scm and
server subcommands.

Move option off the stack in mu.cc, seems it's too big, at least when using gdb.
2025-08-24 11:54:08 +03:00
d5a0fce4cf scm: implement blocking / non-blocking modes
Implement running the REPL on background thread. That way, we can _share_ the
store&.
2025-08-24 11:54:08 +03:00
e56c848952 scm: support --listen flag for uds
Support the --listen flag to mu scm, to start listening on a Unix domain socket.
2025-08-17 12:02:29 +03:00
a6b1f47a30 labels: refactor import/export to mu-store-labels
Move the import/export code to 'lib'.
2025-08-16 12:18:21 +03:00
f504289a02 labels: ensure c++17 compatibility
This broke the build earlier.
2025-08-16 08:43:41 +03:00
46fa4f2aa2 mu: add 'label' command + manpage + tests
Add a label command and document it.
2025-08-15 21:03:19 +03:00
34d3bf2e28 tests: only build when needed
Build the tests lazily, i.e., not before `meson test`. This helps with
build-times.
2025-08-15 21:01:05 +03:00
8d3b65c5d8 utils: refactor count_nl from mu-cmd-find
And update users.
Please enter the commit message for your changes. Lines starting
2025-07-27 19:39:23 +03:00
4c2ce92a15 cli11: prefer system package if found
mu embeds a "vendored" version of libcl11 under thirdparty/; but it's
better to use the system-package if the user has one.

So, use the system package if found or user -Duse-embedded-cli11=true is
specified.
2025-07-24 19:55:27 +03:00
f90839b48b mu-cmd: load mu-scm.hh only with BUILD_SCM
We don't want/need it otherwise, and in fact it triggers build failures when
guile (but not scm) is enabled.

Fixes #2861.
2025-07-24 19:55:27 +03:00
812d78be49 mu-scm: add options, some tweaks
Add the (options) procedure + docs.

Some internal tweaks / clean-ups.
2025-06-30 21:57:29 +03:00
417c070e27 build: better handle non-guile build 2025-06-24 18:15:03 +03:00
527d9322e9 scm: new guile/scheme bindings
This implements the new scm/guile bindings for mu, to replace the deprecated
guile/ (at some point in the future).

For now, we allow for creating a guile shell with mu support.
2025-06-19 14:55:33 +03:00
f9c24c7166 mu: add 'scm' command
Add the "scm" command, the way to get a Guile/Scheme shell.

This is experimental but will replace the current guile support in guile/ at
some point.
2025-06-16 10:57:36 +03:00
1527976729 mu-cfind/contacts-cache: refactor matching in for_each
Move some of the code in from the command-line tool to contacts-cache, for
possible re-use. Clean up a bit while doing so.
2025-06-10 10:04:53 +03:00
c9b5755d68 mu-cmd: update docstrings 2025-05-31 08:42:51 +03:00
ec3b55f2ab message: retain non-file flags when moving
The content-flags won't change, and the unread-flag can be re-calculated.

Add a unit test, and some small doc improvements.

Fixes #2831.
2025-05-24 17:17:00 +03:00
f75e1203d4 mu: rename --my-address into --personal-address
This makes things a bit more uniform with all the places where we use
"personal".

--my-address remains as an alias for the command-line option.

Add unit test.

Resolves #2806.
2025-05-24 17:17:00 +03:00
44ba631a34 mu-find: implement format=json2
Implement a new experimental json2 format for mu-find, which gets rid of
the ":" prefixes for fields, i.e., "subject" instead of ":subject".
Document it as well.
2025-03-23 19:47:09 +02:00
5ab6d6c6c3 mu-find: use correct summary-len 2025-01-20 20:40:21 +02:00
d8d5e4cca5 options: do not canonicalize maildir-path
This doesn't play well with shells that don't expand options (such as
bash) in combination with "ExpandPath".

Fixes #2793.
2024-12-09 18:27:15 +02:00
1b2d9d3847 mu-find: insist on --linksdir for links
Fixes #2790.
2024-12-04 23:18:15 +02:00
8c7db59972 fields: make combi-fields introspectable
And add the display of combination-fields to 'mu info fields'.
2024-11-30 22:58:15 +02:00