From Koni Marti to ~rjarry/aerc-devel
On Wed Oct 4, 2023 at 12:51 AM CEST, Robin Jarry wrote: > Use the argument parsing framework introduced earlier to unify the > parsing of (almost) all command options. Remove custom parsing code and > to avoid extraneous types, add fields with `opt` tags on command structs > that have options and arguments. Commands that take no argument do not > need anything. > > Since the command objects now carry data, create a new temporary > instance of them before passing them to opt.ArgsToStruct when executing > a command. > > A few of the commands use specific semantics for parsing (:choose), or > are delegating argument parsing to another function (:sort, :search, > :filter). For these commands, simply add a dummy "..." optional argument
From Koni Marti to ~rjarry/aerc-devel
On Wed Oct 4, 2023 at 12:51 AM CEST, Robin Jarry wrote: > I may have gone too far here :) > > I am not 100% sure about the opt package functions and types naming > ("cmd" vs "arg" vs "cmdline"). If you have better suggestions, send them > in. Also, I tried to split the commits in the smallest chunks possible > to make this series somewhat bearable. Courage les gars. > > Thanks. Thanks, Robin. I like it a lot. I gave it a quick spin and so far, it works great.
From Koni Marti to ~rjarry/aerc-discuss
> > Filtering by arbitrary date ranges should be easy enough to implement, > but isn't as far as I can see. Yes, it is. See 'man aerc-search': -d <start[..end]>: Search for messages within a particular date range defined as [start, end) where the dates are in the YYYY-MM-DD format. So, :filter -d 2019-01-01..2020-01-01 should give you the messages from the year 2019.
From Koni Marti to ~rjarry/aerc-devel
On Tue Oct 3, 2023 at 3:46 PM CEST, Vitaly Ovchinnikov wrote: > > When you break the for-loop aren't you making an implicit assumption > > about the order of the bindings slice? Is this assumption always > > justified? > > The context bindings override the base ones. The function itself adds > the bindings in the order they come, so if we want the context bindings > to work, they have to come first, before the base ones. > > There are two places the `MergeBindings()` function is called and in both > places the context bindings go first and the base ones go second. > > So yes, the code assumes that the bindings are passed in a specific > order as otherwise the context bindings will not be able to override the
From Koni Marti to ~rjarry/aerc-devel
On Sun Sep 24, 2023 at 11:56 AM CEST, Vitaly Ovchinnikov wrote: > Fix bindings for groups like [compose::review:account=acc1], adds a > proper handling of $noinherit=true for contextual bindings. > > Without the patch contexts like [compose::review:account=acc1] are > matching the [view] context which produces errors. Replacing `Contains` > with `HasPrefix` seems to be the right thing there. > > Another change lets you really drop all the previous bindings if the > contextual binding has $noinherit=true. Without that the parent bindings > are still there regardless of $noinherit flag. > > Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> > ---
From Koni Marti to ~rjarry/aerc-devel
On Fri Sep 22, 2023 at 10:59 PM CEST, Vitaly Ovchinnikov wrote: > Add new `flagged` criteria to `:sort` command (and apparently to the > `sort` config option). Good for moving important stuff up. > > Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> > --- > > Tested with maildir backend. Not sure about the other ones: they might > be handled by the common code or might need some attention, as I don't > see the full coverage of all the options there. Doesn't look a big > thing, as we already have the same for "read" flag. > There's a minor merge conflict with the changelog on master but other
From Koni Marti to ~rjarry/aerc-devel
Add scrollbar to part switcher. Add config value "max-mime-height" to the [Viewer] section to set the maximum height before a scrollbar is drawn. The part switcher height is restricted to half of the context height. Update docs. Fixes: https://todo.sr.ht/~rjarry/aerc/194 Signed-off-by: Koni Marti <koni.marti@gmail.com> --- config/aerc.conf | 8 ++ config/viewer.go | 1 + doc/aerc-config.5.scd | 8 ++ widgets/msgviewer.go | 3 +- widgets/partswitcher.go | 171 +++++++++++++++++++++++----------------- 5 files changed, 118 insertions(+), 73 deletions(-) [message trimmed]
From Koni Marti to ~rjarry/aerc-devel
Separate part switcher from message viewer. The part switcher implementation was woven into the message viewer code. Decouple them to make the code more readable. Signed-off-by: Koni Marti <koni.marti@gmail.com> --- widgets/msgviewer.go | 170 ++------------------------------------ widgets/partswitcher.go | 178 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 186 insertions(+), 162 deletions(-) create mode 100644 widgets/partswitcher.go diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 90f41167..326afa0c 100644 --- a/widgets/msgviewer.go [message trimmed]
From Koni Marti to ~rjarry/aerc-devel
Implement the :project switch command. Switch between different projects. Signed-off-by: Koni Marti <koni.marti@gmail.com> --- commands/patch/switch.go | 55 ++++++++++++++++++++++++++++++++++++++++ lib/pama/switch.go | 29 +++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 commands/patch/switch.go create mode 100644 lib/pama/switch.go diff --git a/commands/patch/switch.go b/commands/patch/switch.go new file mode 100644 index 00000000..d5b2fc6f [message trimmed]
From Koni Marti to ~rjarry/aerc-devel
Implement the :patch delete command. Remove the project data from the permanent store. Signed-off-by: Koni Marti <koni.marti@gmail.com> --- commands/patch/delete.go | 52 ++++++++++++++++++++++++++++++++++++++++ lib/pama/delete.go | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 commands/patch/delete.go create mode 100644 lib/pama/delete.go diff --git a/commands/patch/delete.go b/commands/patch/delete.go new file mode 100644 index 00000000..f896b2f8 [message trimmed]