aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* sort: new `flagged` sorting criteriaVitaly Ovchinnikov2023-10-136-0/+12
| | | | | | | | | 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> Reviewed-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* carddav-query: interpret percent escapes in source urlRobin Jarry2023-10-131-4/+4
| | | | | | | | | | | | | | | | The username and password must be percent encoded if they are set in carddav-source. Python's parser does not automatically unquote the different URL elements. Some carddav servers do not care about this but some do and report authentication failures when the username is percent encoded. Make sure to unquote the username and password after reading them from carddav-source. Reported-by: Callum Andrew <contact@candrew.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Callum Andrew <contact@candrew.net>
* release.sh: fix email encodingRobin Jarry2023-10-131-0/+4
| | | | | | | | | | | | | | | | | | The release emails are sent without any Content-Transfer-Encoding nor Content-Type headers. This causes non-ASCII characters to be rendered as garbage by email clients. Here are two examples from the latest release: Mat��j Cepl Nojus Gudinavi��ius Everything is UTF-8 locally, state it explicitly in the email. Use 8bit as transfer encoding since we are not quoting anything. Add a From: header since some sendmail implementations do not add a default value when it is missing. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* send: add option to overwrite copy-to folderKoni Marti2023-10-132-16/+37
| | | | | | | | | | | | | | | | Add -t option to specify a folder that will overwrite the default Copy-To folder from accounts.conf. This allows you to keep the sent messages in the desired folder. Use templates to create a keybind and always keep the sent messages in the currently selected folder: :send -t {{.Folder}} Fixes: https://todo.sr.ht/~rjarry/aerc/187 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Maarten van Gompel <proycon@anaproy.nl>
* colorize: accept wildcards in stylesJason Cox2023-10-133-36/+40
| | | | | | | | | Allow using * and ? to match multiple style objects for colorize, as stated in the man page and consistent with aerc's main styles. Fixes: a5c4f5d (colorize: handle spaces in styleset) Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* split: add an alias for horizontal splitinwit2023-10-133-10/+11
| | | | | | | | | | To date, there are two orthogonal commands named :vsplit and :split, which create a vertical and a horizontal split, respectively. Add a :hsplit alias for the latter. Signed-Off-By: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
* switcher: add scrollbarKoni Marti2023-10-135-73/+118
| | | | | | | | | | | | 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> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* msgviewer: separate part switcher from viewerKoni Marti2023-10-132-162/+186
| | | | | | | | | | 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> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: better processing of contextual bindsVitaly Ovchinnikov2023-10-131-2/+5
| | | | | | | | | | | | | | | | | 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> Reviewed-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* doc: document -p option for move/copyKoni Marti2023-10-131-6/+10
| | | | | | | | | | Document the -p option for the :move and :copy commands. The -p flag will create the target folder before moving or copying the selected message(s). Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* chore: ignore all log filesMoritz Poldrack2023-10-131-2/+1
| | | | | Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* release.sh: update version in GNUMakefileRobin Jarry2023-10-113-4/+4
| | | | | | | | | | | | The version is no longer present in Makefile which has been preserved for explicit error reporting with non-GNU make versions. Update the version in GNUMakefile instead. Fixes: d725defa07b5 ("mk: deprecate BSD make in favor of GNU make") Reported-by: Anton Mosich <anton@mosich.at> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* mk: remove trimpath flag from debug buildMoritz Poldrack2023-10-111-1/+1
| | | | | | | | | | When inspecting core dumps, it is usually advantageous to get the context of the code. If -trimpath is passed, delve can not find the file associated with a certain PC, and only prints: Command failed: open git.sr.ht/~rjarry/aerc/app/aerc.go: no such file or directory Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: export global functionsRobin Jarry2023-10-114-66/+35
| | | | | | | | | | | | | There is no need for an UI object. The Aerc.ui field is unused. And there is a single instance of it anyway. Move the object's public fields as global variables and change methods to public functions. This makes the code cleaner and removes boilerplate. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* app: fix nil pointer dereference on startupRobin Jarry2023-10-116-42/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following crash on startup: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x9e2314] goroutine 1 [running]: git.sr.ht/~rjarry/aerc/log.PanicHandler() git.sr.ht/~rjarry/aerc/log/panic-logger.go:51 +0x70f panic({0xae95a0, 0x119f9b0}) runtime/panic.go:890 +0x263 git.sr.ht/~rjarry/aerc/app.(*Aerc).SelectedAccount(0x8503cdd28?) git.sr.ht/~rjarry/aerc/app/aerc.go:384 +0x14 git.sr.ht/~rjarry/aerc/app.SelectedAccount(...) git.sr.ht/~rjarry/aerc/app/app.go:44 git.sr.ht/~rjarry/aerc/app.(*AccountView).isSelected(...) git.sr.ht/~rjarry/aerc/app/account.go:225 git.sr.ht/~rjarry/aerc/app.(*AccountView).UpdateStatus(0x850364380) git.sr.ht/~rjarry/aerc/app/account.go:127 +0x28 git.sr.ht/~rjarry/aerc/app.(*AccountView).SetStatus(0x850364380, {0x850243a50, 0x1, 0x0?}) git.sr.ht/~rjarry/aerc/app/account.go:123 +0x94 git.sr.ht/~rjarry/aerc/app.NewAccountView(0x8503d38c0, 0x85041bf80) git.sr.ht/~rjarry/aerc/app/account.go:111 +0x573 git.sr.ht/~rjarry/aerc/app.NewAerc({0xcab0c0?, 0x11fa3c8}, 0x850433860, 0xbf3040, {0xca75e8?, 0x11ca800}, 0x0?) git.sr.ht/~rjarry/aerc/app/aerc.go:91 +0x6ce git.sr.ht/~rjarry/aerc/app.Init(...) git.sr.ht/~rjarry/aerc/app/app.go:24 main.main() git.sr.ht/~rjarry/aerc/main.go:242 +0x52e There was two things very wrong: - Access of the global aerc pointer before it was initialized. - The host field of AccountView was left there and still accessed but never initialized. Replace the global aerc pointer with a real struct value. Update code accordingly. Remove the AccountView.host field which is now useless. Reported-by: Jens Grassel <jens@wegtam.com> Reported-by: Matěj Cepl <mcepl@cepl.eu> Fixes: bc176bd61ba7 ("app: export global functions") Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* app: export global functionsRobin Jarry2023-10-1087-600/+645
| | | | | | | | | | | | | | | 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>
* widgets: rename package to appRobin Jarry2023-10-10102-372/+372
| | | | | | | | | 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>
* Release version 0.16.00.16.0Robin Jarry2023-09-271-0/+2
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* viewer: use correct contextual config for no-filter messageRobin Jarry2023-09-271-1/+1
| | | | | | | | 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>
* commands: add :toggle-thread-context commandTim Culverhouse2023-09-274-0/+49
| | | | | | | | | 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>
* ui: enable showing of thread-contextTim Culverhouse2023-09-2715-15/+64
| | | | | | | | | | | | | | | 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>
* check-patches: complain if title is longer than 72 charactersBence Ferdinandy2023-09-271-0/+5
| | | | | | | | | | | | 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>
* terminal: draw even if underlying command has diedRobin Jarry2023-09-271-24/+11
| | | | | | | | | | | | | | | | | 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>
* xdg: fix unit tests on macosRobin Jarry2023-09-191-0/+4
| | | | | | | | | | | | | | | | | 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>
* changelog: reword before releaseRobin Jarry2023-09-191-14/+12
| | | | | | | Use similar writing mood than other versions. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* docs: add missing newline between :attach variantsRobin Jarry2023-09-191-1/+1
| | | | | | | | 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>
* docs: fix typo in stylesets regexp exampleRobin Jarry2023-09-191-2/+2
| | | | | | | | | | 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>
* docs: add msglist_thread_folded style objectRobin Jarry2023-09-191-0/+3
| | | | | | | | 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>
* docs: add :fold and :unfold commandsRobin Jarry2023-09-191-0/+7
| | | | | | | | 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>
* docs: add :connect and :disconnect commandsRobin Jarry2023-09-191-0/+5
| | | | | | | | 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>
* docs: add :help and :new-account commandsRobin Jarry2023-09-191-0/+11
| | | | | | | These commands were not documented. Make them so. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* docs: add :toggle-key-passthrough commandRobin Jarry2023-09-191-0/+4
| | | | | | | | 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>
* docs: add :recover commandRobin Jarry2023-09-191-0/+11
| | | | | | | | 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>
* docs: add [ui].client-threads-delay settingRobin Jarry2023-09-191-0/+7
| | | | | | | | 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>
* contrib: add script to check man pages consistencyRobin Jarry2023-09-192-0/+60
| | | | | | | | | | | | | | | 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>
* msgviewer: add styles for part selectorRobin Jarry2023-09-1910-101/+75
| | | | | | | | | 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>
* colorize: support trailing comments after valuesRobin Jarry2023-09-194-16/+16
| | | | | | | | 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>
* config: add default values for empty stylesetsRobin Jarry2023-09-199-41/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* binds: improve display of key sequencesRobin Jarry2023-09-192-5/+20
| | | | | | | | | | 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>
* compose: respect header ordering from text editorRobin Jarry2023-09-191-4/+3
| | | | | | | | 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>
* compose: avoid panic when deleting the last headerRobin Jarry2023-09-191-24/+49
| | | | | | | | 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>
* config: make all message list symbols/icons configurableowl2023-09-193-7/+47
| | | | | | | | | | 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>
* commands: strip leading colons from commandsBence Ferdinandy2023-09-191-1/+1
| | | | | | | | | | | 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>
* commands: run a command by its first lettersVitaly Ovchinnikov2023-09-191-0/+42
| | | | | | | | | | | 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>
* hyperlinks: better parsing of emails without mailto prefixesVitaly Ovchinnikov2023-09-192-1/+36
| | | | | | | | | | | 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>
* lib: return a new Header from LimitHeadersTim Culverhouse2023-09-194-18/+16
| | | | | | | | | | | | | | | 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>
* binds: control and alt modifiers for deleteVitaly Ovchinnikov2023-09-192-0/+6
| | | | | | | | 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>
* split: remove previous split from gridTim Culverhouse2023-09-181-0/+1
| | | | | | | | | | | | 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>
* doc: mention correct function in the example for compactDirKirill Miazine2023-09-181-1/+1
| | | | | Signed-off-by: Kirill Miazine <km@krot.org> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* doc: MIME type consistency spellingKirill Miazine2023-09-181-1/+1
| | | | | | | | 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>