aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* commands: fix abbreviations regressionVitaly Ovchinnikov2023-12-311-7/+7
| | | | | | | | | | Make commands abbreviations work again by fixing the mistake introduced in one of the recent commits. Fixes: 07c1cefcf62d ("patch: create sub-command structure") Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru> Reviewed-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* msglist: refactor tree buildingMoritz Poldrack2023-12-301-35/+26
| | | | | | | | | | | | Our way of building trees seems absurd: generate a list of prefixes, reverse it, and trim the first element. Change it so the string is built back to front and define the arrows beforehand so they are easier to configure. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
* imap: show parseable messages on errorMoritz Poldrack2023-12-301-12/+13
| | | | | | | | | | | | | Currently if there are mails aerc can not properly handle, listing the mailbox is aborted. This is especially bothersome if the message one is looking for would be parseable without issue. Show an error if parsing of a message fails, but handle all other messages as normal. This leads to those messages showing up as still loading. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* rfc822: improve dates parsingVitaly Ovchinnikov2023-12-302-10/+91
| | | | | | | | Provide better parsing of email dates with timezone names, but without numeric offsets. Add unit tests to check the new behaviour. Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru> Acked-by: Robin Jarry <robin@jarry.cc>
* commands/msg: adapt quote-reply to honor viewer::alternativesSebastien Binet2023-12-301-1/+8
| | | | | | | | modify quote-reply to quote the message part corresponding to the first MIME type matching the list in viewer::alternatives. Signed-off-by: Sebastien Binet <s@sbinet.org> Acked-by: Robin Jarry <robin@jarry.cc>
* lib: introduce FindMIMEPart, adapt Find{Plain,Calendar}textSebastien Binet2023-12-301-15/+10
| | | | | | | | | | introduce a general FindMIMEPart function to find a message part with the given MIME type. reimplement FindPlaintext and FindCalendartext in terms of this new FindMIMEPart function. Signed-off-by: Sebastien Binet <s@sbinet.org> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/find: add find sub-cmdKoni Marti2023-12-303-0/+161
| | | | | | | | Implement the :patch find command. Search and filter for a given commit by subject line in the current accout and current folder. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch: implement worktree supportKoni Marti2023-12-3010-31/+234
| | | | | | | | | | | | | | | | | | | | | | Implement worktree support for the patch management. Use ":patch apply -w <commit-ish> <tag>" to create a new worktree and apply the selected messages to it. The worktree is linked to repo in the current project. Internally, the worktree is stored as a new project. When this project is deleted with ":patch delete", the underlying linked worktree is removed as well. ":patch list" shows when a project is a worktree and to what project it is linked to. Worktrees enable the users to create a new copy of the repo at a given commit and apply patches without interrupting the current work in the base repo. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/switch: add switch sub-cmdKoni Marti2023-12-302-0/+83
| | | | | | | | Implement the :project switch command. Switch between different projects. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/delete: add delete sub-cmdKoni Marti2023-12-302-0/+99
| | | | | | | | | Implement the :patch delete command. Remove the project data from the permanent store. If no argument is provided, the current project will be deleted. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/term: add term sub-cmdKoni Marti2023-12-302-5/+50
| | | | | | | | | Implement the :patch term command. This will open a shell in the project's root directory that was defined during the :project init setup. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/rebase: add rebase sub-cmdKoni Marti2023-12-303-0/+444
| | | | | | | | | | | | | | | | | Implement the :patch rebase command. Rebase the internal patch data in case the repository was rebased too. The :patch rebase command accepts a optional argument which is used as the reference commit from which the rebasing will occur. Open an editor with the commits that are found on top of the rebase reference. Any untracked commit will have the tag 'untracked'. If a line is removed or the 'untracked' tag remains, it will be dropped from the internal data. To group commits into a patch set, assign the same tag names. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/cd: add cd sub-cmdKoni Marti2023-12-301-0/+42
| | | | | | | | Implement the :patch cd command. Change the directory to the project's root directory that was determined during the :patch init setup process. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/remove: add remove sub-cmdKoni Marti2023-12-304-0/+388
| | | | | | | | | | | Implement the :patch remove command. Remove a patch set from the respository and from the internal storage. Note that in git, this will change all commit hashes that appear after the removed one since the commit hash depends on its parents. Adjust the code to handle such cases and add tests for this. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/list: add list sub-cmdKoni Marti2023-12-306-17/+202
| | | | | | | | | Implement the :patch list command. List the the current project and add a flag to list all saved projects. Use the pager to display the data and extract the pager commands and move them into the config package. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/apply: add apply sub-cmdKoni Marti2023-12-305-3/+464
| | | | | | | | | | Add the :patch apply command to apply a patch set and create a corresponding tag. The tag command argument can be completed based on the subject lines of the selected messages. Add a test for the completion proposal. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch/init: add init sub-cmdKoni Marti2023-12-303-0/+121
| | | | | | | Implement the :patch init command to initialize a new project. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* patch: create sub-command structureKoni Marti2023-12-303-2/+86
| | | | | | | | Create the sub-command structure for the :patch command. Make the :patch command accessible from any context. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pama: implement the persistent store for projectsKoni Marti2023-12-301-0/+244
| | | | | | | Implement the persistent store for models.Project structs. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pama: implement the revision control logicKoni Marti2023-12-302-0/+160
| | | | | | | | | Implement the RevisionController interface to interact with a respository control system. Add the implementation for git. Other revision systems such as mercurial, pijul or fossil can be extended. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* pama: define the entity modelsKoni Marti2023-12-303-0/+260
| | | | | | | | Define the entity models for the patch management. Add a Project and Commit struct and implement the Stringer interface for both. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* contrib: fix check-docs for subcommandsKoni Marti2023-12-303-7/+7
| | | | | | | | Fix check-docs linter for subcommands, i.e. where spaces are between the root command and the subcommands such as in ":patch init". Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* doc: add aerc-patchKoni Marti2023-12-304-0/+173
| | | | | | | | | Document the local patch management. Adjust the help command. Add default key binds. Changelog-added: Patch management with `:patch`. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: remove dynamic foldersKoni Marti2023-12-301-1/+7
| | | | | | | | | | | Remove dynamic folders in the notmuch backends with the :rmdir command. Dynamic folders can be created by the :cf command but they cannot be removed again unless you restart aerc or use it in combination with a maildir-store. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* ci: fix build and test on macosRobin Jarry2023-12-151-4/+4
| | | | | | | Even if macos has GNU make, the gmake command is not available. Fixes: 73bf7241e611 ("lint,validate: fix for openbsd") Signed-off-by: Robin Jarry <robin@jarry.cc>
* lint,validate: fix for openbsdRobin Jarry2023-12-1414-63/+74
| | | | | | | | | | | | | | - Remove GNU specific stuff (ln -v, mktemp --tempdir, grep --color) - Remove GCC specific flags in sendemail-validate (-Warith-conversion) - Add -std=c99 and -Wpedantic and fix the reported warnings. - Explicitly call gmake everywhere. - Run our custom analyzer standalone. Golangci lint plugins are not supported on OpenBSD. Indirect dependency to golang.org/x/mod is required somehow... Reported-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
* cf: allow changing folder of another accountRobin Jarry2023-12-053-25/+80
| | | | | | | | | | | | | | Add a new -a flag to :cf. When specified, an account name is required before the folder name and the focus will be changed to the corresponding account tab before changing folders. If the target folder does not exist, an explicit error will be reported. Changelog-added: Change to a folder of another account with `:cf -a <account> <folder>`. Signed-off-by: Robin Jarry <robin@jarry.cc> Co-authored-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
* colorize: only colorize real usenet signaturesRobin Jarry2023-12-041-3/+2
| | | | | | | | Only consider the start of a signature if a line is exactly "-- " with a trailing space character. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
* colorize: better detect diffsRobin Jarry2023-12-045-18/+217
| | | | | | | | | | | | Be more tolerant with diffs that were produced by other version control systems than git. OpenBSD for instance, uses CVS. Add more test cases from the OpenBSD mailing lists. Link: https://marc.info/?l=openbsd-ports&m=169989204001628&w=2 Link: https://marc.info/?l=openbsd-ports&m=169987607521242&w=2 Reported-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
* doc: fix description of lf-editorRobin Jarry2023-12-041-3/+3
| | | | | | | | | \n needs to be escaped in .scd files. Reword the description to make it clear that CRLF is the standard. Fixes: ad159d5e9bd4 ("compose: add option for LF-only editors") Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* eml: expand tilde to home dirRobin Jarry2023-12-041-1/+2
| | | | | | | Allow running :eml ~/foo/baz.eml. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* dirtree: prevent folder selection when archivingKoni Marti2023-12-011-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent an unwanted folder selection in the directory tree when archiving. A previous fix (commit 0be135a3) introduced a regression which caused the directory tree to select the folder for which a CreateDirectory message returned successfully. Since the :archive command will issue a CreateDirectory message in every operation, the directory tree will thus erroneously select the target archive directory. However, the functionality to select a newly created folder by the :mkdir command is actually correct and should be kept since this corresponds to the regular directory list behavior. Another quirk that is addressed is caused by the rebuilding of the directory tree when the underyling directories change. In that case, the ui.DirListCollapse setting would overwrite the user changes. Therefore, only apply the ui.DirListCollapse setting at the first time of building the directory tree. Fixes: 0be135a38186 ("dirtree: fix jumping folders") Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* dirtree: fix jumping foldersKoni Marti2023-11-241-3/+5
| | | | | | | | | | | Fix jumping folders in the directory structure. Fixes: a35d9bab ("rmdir: ensure proper sequence of operations") Reported-by: inwit <inwit@sindominio.net> Reported-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* flag,unflag: fix -a option for the answered flagKoni Marti2023-11-241-0/+4
| | | | | | | | Fix the -a option to correctly set or unset the answered flag. Fixes: https://todo.sr.ht/~rjarry/aerc/199 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: display "(no subject)" when subject is emptyBence Ferdinandy2023-11-244-0/+13
| | | | | | | | | | | | | An empty subject, especially in a thread makes it for a slightly jarring layout. Add a new option empty-subject option to UI with "(no subject") as the default value. If the subject is empty and the current message is not the same subject as it's parent in a thread make {{.Subject}} evaluate to this option's value. Changelog-added: The `{{.Subject}}` template is evaluated to the new option `[ui].empty-subject` if the subject is empty. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* term: ensure cursor is hidden before closingRobin Jarry2023-11-241-0/+3
| | | | | | | | | | | When running a terminal in a dialog that is closed before the terminal has had a chance of being redrawn, the cursor may be left visible. Make sure to hide the cursor in the close routine. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Jason Cox <me@jasoncarloscox.com>
* ui: make viewer tab title configurable via templatesBence Ferdinandy2023-11-233-1/+23
| | | | | | | | | | | | | We had account and composer tab title configuration fields already, but not for viewer. Add tab-title-viewer configuration, which defaults to Subject if it is not empty and to "(no subject)" when it is empty. Changelog-added: New `[ui].tab-title-viewer` setting to configure the message viewer tab title. Changelog-changed: Message viewer tab titles will now show `(no subject)` if there is no subject in the viewed email. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* rmdir: back to current folder upon errorKoni Marti2023-11-231-1/+5
| | | | | | | | | | | | | Jump back to the current folder consistently when encountering an error. This has only been partly implemented. For example, when you try to remove a notmuch folder, the remove operation will fail because it is unsupported. However, you would end up in a different directory because a directoy change is done before trying to remove the current folder. If this happens make sure you end up in the current directory again. Fixes: a35d9bab4664 ("rmdir: ensure proper sequence of operations") Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* dirtree: add custom virtual directory roleKoni Marti2023-11-234-2/+43
| | | | | | | | | Add a new directory role to indicate virtual nodes in the directory tree. This allows to style the virtual nodes differently and apply different behaviors in some commands (i.e. rmdir). Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* dirlist/dirtree: context handlingKoni Marti2023-11-232-11/+16
| | | | | | | | | | | Add a NewContext() function that extracts and handles the canceling and re-creation of a new context for the directory list. This enables a better control of the context cancellation especially for a directory tree when a virtual node is selected. Before, the previous folder would have been opened if a virtual node was selected. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* compose: copy to composing account's sent folderJason Cox2023-11-231-3/+4
| | | | | | | | | | | | The composing account may be different than the currently selected account if the user has moved between different tabs since beginning the message. Fixes: faa879f9a84d ("hooks: add mail-added hook") Reported-by: Vitaly Ovchinnikov <v@ovch.ru> Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Vitaly Ovchinnikov <v@ovch.ru>
* reply: allow replying with another accountBence Ferdinandy2023-11-232-4/+22
| | | | | | | | | | | | | When using edit-headers=true using :switch-account alone is not enough to properly switch account since you have to change the From header manually. Add the -A [account] option to reply in order to switch the account before opening the composer, to remove this friction when we already know we want to reply with a different account. Changelog-added: Reply with a different account than the current one with `:reply -A <account>`. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* fold: remove aliases from structinwit2023-11-231-1/+1
| | | | | | | | There's no need to specify aliases if an option applies to all the aliases of a command. Remove aliases for :fold's toggle option. Signed-Off-By: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* fold: add an option to fold/unfold all threadsinwit2023-11-232-5/+28
| | | | | | | | | Commands :fold/:unfold act upon a single thread. Add an option to both commands allowing the user to fold/unfold all displayed threads. Signed-Off-By: inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* compose: define useful vars in the editor's envJason Cox2023-11-232-0/+13
| | | | | | | | | | | | Add AERC_ACCOUNT and AERC_ADDRESS_BOOK_CMD to the editor's environment when composing a message. These variables allow for per-account configuration of the editor and facilitate address completion when edit-headers = true. Changelog-added: `AERC_ACCOUNT` and `AERC_ADDRESS_BOOK_CMD` are now defined in the editor's environment when composing a message. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* chore: upgrade to latest tcell-termJason Cox2023-11-232-3/+3
| | | | | | | | | Pull in changes allowing us to specify the environment of the start command for a term. This will allow defining environment variables for the editor in the next commit. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* maintainers: add inwit and ferdinandybRobin Jarry2023-11-221-1/+10
| | | | | | | | | | | | These folks have been active for quite a while with bug triaging and code review. I have given them moderator access on the mailing lists and on the bug tracker. Thanks guys! Cc: Bence Ferdinandy <bence@ferdinandy.com> Cc: Inwit <inwit@sindominio.net> Signed-off-by: Robin Jarry <robin@jarry.cc>
* mod: update to go-opt@v1.3.0Robin Jarry2023-11-222-3/+3
| | | | | | | | | | | Remove systematic sorting of all completion choices. The choices ordering as reported by callbacks are now preserved. The flags themselves are always at the end in the order in which they are declared in the option struct. Reported-by: Skejg <grolleman@zoho.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
* complete: only display popover for more than one choiceRobin Jarry2023-11-221-64/+74
| | | | | | | | | | When there is only one completion choice available, accept the completion immediately upon a <Tab> key press. This is consistent with how most completion engines work (bash, vim, etc.). Reported-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
* stylesets/nord: make unread selected mails readableMax Schillinger2023-11-121-1/+0
| | | | | | | | Remove the dedicated background color for unread selected e-mails because it's too close to the foreground color. Signed-off-by: Max Schillinger <max@mxsr.de> Acked-by: Robin Jarry <robin@jarry.cc>