Add Templates with Parsing

+ Changes NewComposer to return error.
+ Add lib to handle templates using "text/template".
+ Add -T option to following commands
    - compose.
    - reply
    - forward
+ Quoted replies using templates.
+ Forwards as body using templates
+ Default templates are installed similar to filters.
+ Templates Config in aerc.conf.
    - Required templates are parsed while loading config.
+ Add aerc-templates.7 manual for using template data.
This commit is contained in:
Srivathsan Murali 2019-11-03 13:51:14 +01:00 committed by Drew DeVault
parent ad68a9e4e4
commit 3ba69edab5
14 changed files with 510 additions and 143 deletions
widgets

View file

@ -431,8 +431,11 @@ func (aerc *Aerc) Mailto(addr *url.URL) error {
defaults[header] = strings.Join(vals, ",")
}
}
composer := NewComposer(aerc, aerc.Config(),
acct.AccountConfig(), acct.Worker(), defaults)
composer, err := NewComposer(aerc, aerc.Config(),
acct.AccountConfig(), acct.Worker(), "", defaults)
if err != nil {
return nil
}
composer.FocusSubject()
title := "New email"
if subj, ok := defaults["Subject"]; ok {