| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add `desc:""` struct field tags in all command arguments where it makes
sense.
The description values will be returned along with completion choices.
Implements: https://todo.sr.ht/~rjarry/aerc/271
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bojan Gabric <bojan@bojangabric.com>
Tested-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the Command interface to include a Description() method.
Implement the method for all commands using short descriptions inspired
from the aerc(1) man page.
Return the description values along with command names so that they can
be displayed in completion choices.
Implements: https://todo.sr.ht/~rjarry/aerc/271
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bojan Gabric <bojan@bojangabric.com>
Tested-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an error occurs during the opening of a message because its
contents cannot be parsed, the PartSwitcher object is left to nil and
the err field is set to the reported error.
This defers the error reporting after the viewer tab is displayed but it
is not handled in all sub functions which assume that switcher cannot be
nil.
Error: runtime error: invalid memory address or nil pointer dereference
git.sr.ht/~rjarry/aerc/app.(*PartSwitcher).Show(...)
/build/aerc/src/aerc/app/partswitcher.go:77
git.sr.ht/~rjarry/aerc/app.(*MessageViewer).Show(...)
/build/aerc/src/aerc/app/msgviewer.go:409
git.sr.ht/~rjarry/aerc/lib/ui.(*Tabs).selectPriv(...)
/build/aerc/src/aerc/lib/ui/tab.go:181
git.sr.ht/~rjarry/aerc/lib/ui.(*Tabs).Add(...)
/build/aerc/src/aerc/lib/ui/tab.go:75
git.sr.ht/~rjarry/aerc/app.(*Aerc).NewTab(...)
/build/aerc/src/aerc/app/aerc.go:511
git.sr.ht/~rjarry/aerc/app.NewTab(...)
/build/aerc/src/aerc/app/app.go:61
git.sr.ht/~rjarry/aerc/commands/account.ViewMessage.Execute.func1(...)
/build/aerc/src/aerc/commands/account/view.go:71
git.sr.ht/~rjarry/aerc/lib.NewMessageStoreView.func1(...)
/build/aerc/src/aerc/lib/messageview.go:80
git.sr.ht/~rjarry/aerc/lib.NewMessageStoreView(...)
/build/aerc/src/aerc/lib/messageview.go:124
git.sr.ht/~rjarry/aerc/commands/account.ViewMessage.Execute(...)
/build/aerc/src/aerc/commands/account/view.go:52
git.sr.ht/~rjarry/aerc/commands.ExecuteCommand(...)
/build/aerc/src/aerc/commands/commands.go:205
main.execCommand(...)
Remove that private err field and return an explicit error when the
message cannot be opened to enforce handling of the error by the caller.
When the msg argument is nil (only used in split viewer), return an
empty message viewer object and ensure that all code paths that read the
switcher or msg fields perform a nil check before accessing it.
Link: https://lists.sr.ht/~rjarry/aerc-devel/%3C12c465e4-b733-4b15-b4b0-62f87429fdf7@gmail.com%3E
Link: https://lists.sr.ht/~rjarry/aerc-devel/%3C2C55CF50-A636-46E5-9BA8-FE60A2303ECA@proton.me%3E
Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CD51PEB6OMNDT.1KVSX0UCNL2MB@posteo.de%3E
Reported-by: Benjamin Braun <ben.braun@posteo.de>
Reported-by: Filip <filip.sh@proton.me>
Reported-by: Sarthak Bhan <sbstratos79@gmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Register all commands with the same function and store them in the same
map.
Use bit flags to determine in which contexts each command should be
available.
Remove duplicate commands now that the same command can be exposed in
multiple contexts.
Refactor API to allow executing commands from other commands without
import cycles.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Folders that contain spaces are surrounded by quotes. They can never end
with '/'. Hence they are never returned in the completion results.
Update CompletePath with an additional onlyDirs argument to take care of
this before quotes are inserted.
Fixes: abe228b14d97 ("commands: use completion from go-opt")
Fixes: https://todo.sr.ht/~rjarry/aerc/204
Reported-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
|
|
|
|
|
|
|
| |
Allow running :eml ~/foo/baz.eml.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
|
|
|
|
|
|
|
|
|
|
|
| |
Implement command completion with complete struct field tags from the
get-opt library introduced earlier.
Changelog-changed: Improved command completion.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 "-" passthrough
argument. Since all commands still have the argument list (after split)
nothing needs to be changed in this area.
There should be no functional change besides the Usage strings and
reported errors which are now generated automatically.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Moritz Poldrack <moritz@poldrack.dev>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The single Aerc object is passed around in almost all command functions.
This hinders readability.
Store the single Aerc instance as a global variable. Export public
functions from the app package to access methods of that object. Remove
all explicit references to *app.Aerc and replace them with calls to
these functions. For references to private/unexported fields and
functions from within the app package, directly access the global aerc
object.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
|
|
|
|
|
|
|
|
|
| |
This is the central point of all aerc. Having it named widgets is
confusing. Rename it to app. It will make a cleaner transition when
making the app.Aerc object available globally in the next commit.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is only one instance of AercConfig which is associated to the Aerc
widget. Everywhere we need to access configuration options, we need
somehow to get a reference either to the Aerc widget or to a pointer to
the AercConfig instance. This makes the code cluttered.
Remove the AercConfig structure and every place where it is referenced.
Instead, declare global variables for every configuration section and
access them directly from the `config` module.
Since bindings and ui sections can be "contextual" (i.e. per account,
per folder or per subject), leave most local references intact.
Replacing them with config.{Ui,Binds}.For{Account,Folder,Subject} would
make this patch even more unreadable. This is something that may be
addressed in the future.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
| |
Add message preview to the composer. Add preview option to the review
window. Open the message in a message viewer before sending to check the
headers and attachments.
Implements: https://todo.sr.ht/~rjarry/aerc/86
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
Open message/rfc822 attachments from the message viewer when no filter
is defined for this mimetype. When the rfc822 part is selected, call the
eml command to open the attachment in a new message viewer.
Suggested-by: Jens Grassel <jens@wegtam.com>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
Open and view eml data from a file. Call the eml command and use the
completion feature to select an eml file from disk. The eml data will be
opened in the message viewer.
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|