aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-10-03pipe: run commands with sh -ccmdlineRobin Jarry
Now that all commands get the full command line as specified by the user, it is possible to pass it down verbatim to sh -c. Requested-by: Vitaly Ovchinnikov <v@postbox.nz> Signed-off-by: Robin Jarry <robin@jarry.cc>
2023-10-03open: run commands with sh -cRobin Jarry
Allow running shell commands in openers. Requested-by: Vitaly Ovchinnikov <v@postbox.nz> Signed-off-by: Robin Jarry <robin@jarry.cc>
2023-10-03commands: parse arguments with opt.ArgsToStructRobin Jarry
Signed-off-by: Robin Jarry <robin@jarry.cc>
2023-10-03commands: pass raw command line down to template evaluationRobin Jarry
Some commands need to invoke others and/or run shell commands. For this, we need the raw command line as entered by the user. Pass it down the call chain just before it is split to invoke the command Execute method. Remove unit tests for the template expand() test which does have any added value now that it is performed on a single string without any quote juggling. Update all code to handle a single string instead of a list of arguments. This is in preparation for using opt.ArgsToStruct to parse arguments for all aerc commands. There should be no functional change after this patch. Signed-off-by: Robin Jarry <robin@jarry.cc>
2023-10-03lib: add opt parser based on struct tagsRobin Jarry
Signed-off-by: Robin Jarry <robin@jarry.cc>
2023-10-03lib: add shell command lexerRobin Jarry
Signed-off-by: Robin Jarry <robin@jarry.cc>
2023-10-03lib: remove unused ShellQuote functionRobin Jarry
Signed-off-by: Robin Jarry <robin@jarry.cc>
2023-09-27Release version 0.16.00.16.0Robin Jarry
Signed-off-by: Robin Jarry <robin@jarry.cc>
2023-09-27viewer: use correct contextual config for no-filter messageRobin Jarry
When no filter is configured for a part, use the correct account contextual ui config. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2023-09-27commands: add :toggle-thread-context commandTim Culverhouse
Add a command to toggle the display of an thread-context. Update CHANGELOG. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-27ui: enable showing of thread-contextTim Culverhouse
Add a UI config value to enable showing of "thread-context", similar to `notmuch show --entire-thread=true`. Add an associated style called "msglist_thread_context" which can be used to style such messages. Currently this feature is only supported by notmuch. It would be possible for maildir to implement as well, IMAP with gmail custom extensions, and JMAP. This patch merely implements the notmuch version and puts the groundwork in for handling these sorts of displays. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-27check-patches: complain if title is longer than 72 charactersBence Ferdinandy
Although git commit titles can be a lot longer that 72 characters it is sensible to limit it somewhere. Many people recommend a maximum of 50 characters, other places allow for slightly longer, github for examples truncates titles at 72, our benevolent maintainer tries to aim for 60. Considering the above 72 seems like a comfortable hard limit. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-27terminal: draw even if underlying command has diedRobin Jarry
After the command running in the terminal has exited, the tcell-term buffer still contains the last status of its virtual tty. If a virtual terminal is visible, draw it even after its command has exited. Calling tcellterm.VT.Draw() does not interact with the underlying process at all, it only accesses the screen buffer. This should fix incomplete drawing of message parts when using a pager that exits after printing contents (e.g. `less -F`). Also, it should fix redrawing of such message part contents after switching tabs back and forth. Reported-by: Julio B <julio.bacel@gmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Julio B <julio.bacel@gmail.com>
2023-09-19xdg: fix unit tests on macosRobin Jarry
When any XDG_*_HOME or XDG_RUNTIME_DIR variables are set, this causes test failures. FAIL: TestConfigPath//home/user/Library/Preferences/aerc/accounts.conf (0.00s) xdg_test.go:86: got "/Users/vitaly/.config/aerc/accounts.conf" expected "/home/user/Library/Preferences/aerc/accounts.conf" Avoid leaking the local user's environment in the unit tests. Always override the XDG_* variables. Fixes: fff16640ad7c ("xdg: add functions to deal with user home paths") Reported-by: Vitaly Ovchinnikov <v@postbox.nz> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Vitaly Ovchinnikov <v@postbox.nz>
2023-09-19changelog: reword before releaseRobin Jarry
Use similar writing mood than other versions. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2023-09-19docs: add missing newline between :attach variantsRobin Jarry
Avoid multiple variants of :attach to be rendered on the same line. Fixes: af63bd0188d1 ("doc: homogenize scdoc markup") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2023-09-19docs: fix typo in stylesets regexp exampleRobin Jarry
The backslashes must be escaped, otherwise they are not rendered by scdoc. Fixes: 2f46f64b0b0b ("styleset: allow dynamic msglist styling") Reported-by: Vitaly Ovchinnikov <v@postbox.nz> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2023-09-19docs: add msglist_thread_folded style objectRobin Jarry
This style object was not documented. Make it so. Fixes: 995dfc15a806 ("styles: add style for folded threads") Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19docs: add :fold and :unfold commandsRobin Jarry
These commands were not documented. Make them so. Fixes: 94b1c778dbe6 ("commands: add :fold and :unfold for thread folding") Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19docs: add :connect and :disconnect commandsRobin Jarry
These commands were not documented. Make them so. Fixes: e41ed82cf3db ("imap: add manual {dis,}connect support") Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19docs: add :help and :new-account commandsRobin Jarry
These commands were not documented. Make them so. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19docs: add :toggle-key-passthrough commandRobin Jarry
This command was not documented. Make it so. Fixes: 74366d895d5c ("viewer: add key passthrough mode") Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19docs: add :recover commandRobin Jarry
This command was not documented. Make it so. Fixes: cdec23323c64 ("recover: recover emails from tempdir after a crash") Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19docs: add [ui].client-threads-delay settingRobin Jarry
This setting was not documented. Make it so. Fixes: 54a0a377e030 ("threads: debounce client-side thread building") Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19contrib: add script to check man pages consistencyRobin Jarry
Add a new shell script to check that all commands are documented in man pages and that the man pages do not contain non-existent commands. Also check that all explicitly parsed options with ini reflection are documented as well. It is not possible to check if the man pages do reference non-existent options since some of the options are parsed lazily in workers and some of them are also declared with placeholders (e.g. *column-<name>*). Run the script in the lint target. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19msgviewer: add styles for part selectorRobin Jarry
Allow styling the part selector mime type and (if any) attachment filename. Remove custom alignment code since now both can be differentiated easily with colors and/or attributes. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
2023-09-19colorize: support trailing comments after valuesRobin Jarry
Strip trailing comments after attribute values in stylesets. Update the test styleset to check it works. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
2023-09-19config: add default values for empty stylesetsRobin Jarry
When adding new style objects it is impossible to give them a default color nor attributes without modifying each existing user styleset. Also, if the user has an incomplete styleset, some parts of aerc will have no style at all. These quirks are not nice from a user experience point of view. Before parsing the user styleset, initialize aerc style with basic defaults. Reuse the exact same content than the actual "default" styleset provided in /usr/share/aerc/stylesets. Comment all of the default styleset to make it obvious that these are default values. This has some implications: * To reset these defaults, the user styleset must now start with these two lines: *.default = true *.normal = true If these two lines are not present, the default style will be kept and only changed if the user styleset explicitly sets them. * Empty stylesets no longer produce weird results. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
2023-09-19binds: improve display of key sequencesRobin Jarry
Do not replace all spaces by <space>, it makes the bindings completely unreadable. Only replace trailing and leading spaces with <space> since these are the only one that actually matter. The others are implicit and it improves the readability level by over 9000. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
2023-09-19compose: respect header ordering from text editorRobin Jarry
When [compose].edit-headers=true, make sure to respect the order of headers as set in the text editor. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
2023-09-19compose: avoid panic when deleting the last headerRobin Jarry
When removing the last header, the focusable list may be empty, and the focused index becomes invalid. Avoid out of bounds access. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
2023-09-19config: make all message list symbols/icons configurableowl
This patch removes the hard coded letters (which don't make sense in all languages), and replaces them with configurable icons, like the existing `icon-attachment` and other icons. Signed-off-by: owl <owl@u8.is> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19commands: strip leading colons from commandsBence Ferdinandy
When giving advice on commands to run the colon is often included to signify that the snippet is needs to be run as an aerc command. Unfortunately, copying this into the command prompt of aerc leads to an error. Copy the behaviour of vim and strip any number of leading colons from command names. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-19commands: run a command by its first lettersVitaly Ovchinnikov
Check if the command entered after : is the abbreviation of an existing command and run that instead. This is only done if there is no complete name matching first-hand and if the abbreviation matches just one command. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
2023-09-19hyperlinks: better parsing of emails without mailto prefixesVitaly Ovchinnikov
Add some new tests from the emails I have and make them work by adjusting the code that looks for hyperlinks. The idea is to treat "inline" emails (those without mailto:) a little bit different and stop a little earlier while looking for their ends. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-19lib: return a new Header from LimitHeadersTim Culverhouse
The LimitHeaders function is used to optionally reduce memory usage of aerc by only keeping certain headers in memory for the message list. The function properly deletes header keys and values from the underlying object, however the underlying data structure has a map and a slice - which do not get resized after deletion: resulting in no actual memory savings. Create a new header and add only the headers we want to it. Return this value and use in the MessageInfo struct. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-19binds: control and alt modifiers for deleteVitaly Ovchinnikov
Add Control and Alt modifiers to Delete key, so C-Delete and A-Delete kebyoard shortcuts could be bound. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-18split: remove previous split from gridTim Culverhouse
Remove the previous split from the account grid view. When adding a new child at an existing location, the content is appended to a slice instead of replacing any old values. The old content must be explicitly removed. Reported-by: inwit <inwit@sindominio.net> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
2023-09-18doc: mention correct function in the example for compactDirKirill Miazine
Signed-off-by: Kirill Miazine <km@krot.org> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2023-09-18doc: MIME type consistency spellingKirill Miazine
Refer to MIME type as "MIME type", as that's how it's being called elsewhere. Signed-off-by: Kirill Miazine <km@krot.org> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2023-09-18maildir: log mail checking errors, if anyVitaly Ovchinnikov
Add the logging of stdout/stderr of mail checking process in maildir worker if it returns an error. The user still sees just the exit status, but log gets a more detailed information for further analysis. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
2023-09-18compose: add option for LF-only editorsMoritz Poldrack
Some editors only support LF line endings. For these, standard compliant eml files are not an option. Add an option compose.lf-editor to translate the eml file to lf lineendings. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Matěj Cepl <mcepl@cepl.eu>
2023-09-05msgviewer: show attachment file names first if possibleVitaly Ovchinnikov
Change the parts switcher so it displays the file names first (if any) and then the mime types. The mime types are aligned to the right to help the file names to be more visible. If there is no file name - the mime type is displayed on the left, as usual. The idea is that the file name (if present) is more important than the mime type. Especially when both file names and mime types are long - this quickly becomes a mess. If there is no space for both file name and mime, the mime type is truncated with ellipsis. If there is no space for mime at all - it is dropped completely. If then there is no space for the file name, it is also truncated with ellipsis. Signed-off-by: Vitaly Ovchinnikov <v@postbox.nz> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
2023-09-05compose: delete empty headersRobin Jarry
When [compose].edit-headers=true and emptying a header in the text editor (not deleting it, only deleting its contents), the operation is ignored and the header is preserved as-is. Delete the header after exiting the text editor if the header is empty or not present. Make sure not to add empty headers. Fixes: 11e5390fa0ac ("compose: implement embedded headers in editor") Reported-by: Inwit <inwit@sindominio.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
2023-09-04doc: clarify notmuch+maildir behavior with respect to filesinwit
While notmuch mainly deals with messages and queries, adding either of *maildir-store* or *maidlir-account-path* will give the impression that aerc actually deals with files and folders under the notmuch interface. Clarify this point to avoid confusions. Signed-Off-By: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
2023-09-04colorize: handle spaces in stylesetRobin Jarry
Avoid failure when the styleset [viewer] section contains spaces: ~$ cat foo [viewer] url.fg = #ffffaf url.underline = true header.fg = #af87ff signature.fg = #af87ff diff_meta.fg = #ffffff diff_meta.bold = true diff_chunk.fg = #00cdcd diff_add.fg = #00cd00 diff_del.fg = #cd0000 quote_1.fg = #5fafff quote_2.fg = #ff8700 quote_3.fg = #af87ff quote_4.fg = #ff5fd7 quote_x.fg = #808080 ~$ ./colorize -s foo < bar.eml error: invalid style attribute 'fg ' Be more restrictive with what characters are part of a style attribute. Add test styleset with as much weirdness as possible. Update vectors accordingly. Update sendemail-validate hook to export pedantic CFLAGS. Reported-by: Tristan Partin <tristan@partin.io> Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tristan Partin <tristan@partin.io> Tested-by: Tristan Partin <tristan@partin.io>
2023-08-31msgstore: ensure selection when calling sortTim Culverhouse
When using notmuch and changing labels, there is no reselection logic as there is when using a :mv command for other backends. This results in any label change that removes the message from the current query in having no selection. Add some simple reselection logic in the Sort callback so any call to Sort (which will refresh the message list) ensures the previously selected message is still selected, and if it isn't in the store anymore we select the same index of message as was previously selected. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
2023-08-31notmuch: internally sort threads newest firstTim Culverhouse
For proper thread ordering, notmuch needs to use a SORT_NEWEST_FIRST sort order in it's query, and then we reverse the thread order. Also give a maximum guess for size of slice we'll be returning. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2023-08-31notmuch: refactor SetFlagTim Culverhouse
Refactor SetFlag to be more readable by handling the special case of SeenFlag in a cleaner way. If we invert the operation ('enable') instead of invert the oldState, we can use the same logic for any tag. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2023-08-31notmuch: track database stateTim Culverhouse
Track the notmuch database state. When a state change is detected, query if any changes affect the current query then send updates accordingly. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>