aboutsummaryrefslogtreecommitdiffstats
path: root/.gitignore
Commit message (Collapse)AuthorAgeFilesLines
* filters: rewrite colorize in cRobin Jarry2023-01-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since its introduction, we had multiple issues with the colorize awk script with regard to non-GNU awk compatibility. Also, this script is standalone and the color theme must be hard coded into it. Reading from an external configuration file (aerc's styleset) from a non-GNU awk is close to impossible (and even far from trivial with GNU awk). Rewrite the builtin colorize filter in C to allow getting the color theme from aerc's active styleset. The theme is configured using the existing styleset syntax and attributes under a separate [viewer] section (see examples and man page). Export the active styleset file path to AERC_STYLESET env var when invoking the filter command so that colorize can access it and use it. I have tested compilation (with clang-analyzer and gcc -fanalyzer) and basic operation on FreeBSD, Fedora (glibc) and Alpine (muslibc). More tests would probably be required on MacOSX and older Linux distros. I also added test vectors to give some confidence that this works as expected. The execution with these vectors passed valgrind --leak-check=full without errors. NB: the default theme has changed to be more minimal. Sample stylesets have more colorful examples. The awk -v theme=xxx option is no longer supported. usage: colorize [-h] [-s FILE] [-f FILE] options: -h show this help message -s FILE use styleset file (default $AERC_STYLESET) -f FILE read from filename (default stdin) Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* contrib: add linter to check for panic handler in goroutinesRobin Jarry2023-01-061-0/+1
| | | | | | | | | | | | | | | | | If log.PanicHandler() is not installed in a goroutine and a panic occurs, the terminal state is not restored. This causes the panic trace to be unreadable since the terminal is broken. Add a custom analyzer that parses our code and ensures that: defer log.PanicHandler() is the first statement of all functions that are executed in goroutines. Include that linter in golangci config. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* filters: add wrap utility written in goRobin Jarry2022-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I had started writing this as an awk script but quickly got stuck with obscure code which did not even work properly. I jumped the gun and re did it in go. Bonus, we will not have MacOS's 1987 BSD awk issues. On the other hand, instead of a 20.0K awk script, we now have a 2.2M static go binary. If this makes people scream, I challenge them to do that with BSD awk :) Basically, this takes text from stdin or from a file and wraps long lines on word boundaries. It takes care of not breaking up email quotes nor list items (numbered as well). Also, it is conservative by default and only wraps long lines and lines that end with a space (indicating a format=flowed message). If the AERC_SUBJECT environment variable is defined and contains the word PATCH, the text is not modified at all (i.e. wrap behaves as cat(1)). There are a few command line options to control behavior: Usage of ./wrap: -f string read from file instead of stdin -l int minimum percentage of letters in a line to be considered a paragaph (default 50) -r reflow all paragraphs even if no trailing space -w int preferred wrap margin (default 80) Update docs, makefile and default config file with examples. Add a torture test to ensure it works as expected. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* logging: rename package to logRobin Jarry2022-12-021-1/+0
| | | | | | | | | | Use the same name than the builtin "log" package. That way, we do not risk logging in the wrong place. Suggested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* gitignore: ignore race.log.*Tim Culverhouse2022-09-261-0/+1
| | | | | | | Running `make dev` creates race.log.* files. Ignore these by default. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mk: rebuild if goflags or ldflags have changedRobin Jarry2022-02-271-0/+1
| | | | | | | | | | | | | | | Running make with different values for GOFLAGS or VERSION does not cause aerc to be rebuilt whereas it should. Write the go build command line into a file and force aerc to be rebuilt if the command line has changed. Use the BSD make compatible != operator to run the command. This operator is also available in GNU make since version 4.0. Link: https://git.savannah.gnu.org/cgit/make.git/commit/?id=b34438bee83ee Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* config: do not hardcode sharedirRobin Jarry2022-02-191-1/+0
| | | | | | | | | | | | Instead of using a static SHAREDIR at compile time, use a list of standard paths to use at runtime for templates, config files and stylesets. This implies removing all default filters in the default configuration. Replace them with basic commands. New users can configure the filters as they wish. Signed-off-by: Robin Jarry <robin@jarry.cc>
* mk: use debug to generate a non-optimized binaryRobin Jarry2022-02-021-0/+1
| | | | | | | | Do not use this to run the debugger. Instead, build a non-optimized binary and display what command should be executed to attach to a running program. Signed-off-by: Robin Jarry <robin@jarry.cc>
* Subsitute prefix in aerc.conf for installDrew DeVault2019-05-261-0/+1
|
* Implement opening tutorial after account wizardDrew DeVault2019-05-221-0/+1
|
* Add man pagesDrew DeVault2019-05-171-0/+3
|
* Initialize worker in account widgetDrew DeVault2019-01-131-0/+1
|
* Switch to vgoDrew DeVault2018-03-021-1/+1
|
* Improve loggingDrew DeVault2018-01-311-0/+1
|
* Initial commitDrew DeVault2018-01-091-0/+2