~srivathsan

Recent activity

[PATCH WIP] Add Templates with Parsing 2 days ago

From Srivathsan Murali to ~sircmpwn/aerc

This adds a template parsing with "text/template".
Templates can be either parsed from files or strings.

Replaces, quoted reply and adds compose with -T option.
Add account config option for template folder.
---
Hi guys,
I have redone the implementation somewhat using the "text/templates" library
and adding it as a part of the composer.
I am still calling the AddTemplate function from compose and reply.

This is still at a WIP stage. Wanted to get some feedback about the
implementation and also some questions I have.
[message trimmed]

Re: [PATCH v2] Config option to set index format for sent folder 4 days ago

From Srivathsan Murali to ~sircmpwn/aerc

On Wed Oct 9, 2019 at 7:49 PM Drew DeVault wrote:
> I would prefer to build out something more general for this, like config
> options which take effect in a certain folder.
> 
> [ui]
> index-format=...
> 
> [ui:folder=Sent]
> index-format=...
> 
> [ui:folder~Archive/\d+/.*]
> index-format=...
> 
> Thoughts?

Re: [PATCH] Add Templates 4 days ago

From Srivathsan Murali to ~sircmpwn/aerc

On Wed Oct 9, 2019 at 7:55 PM Drew DeVault wrote:
> Okay, so you mentioned this in the ticket and went with the easier
> approach - but hear me out. If we put this into the composor and make it
> work for replies, we can generalize this nicely by using golang text
> templates. Then, the default reply template becomes something like this:
> 
> On {{.Date}}, {{.From.Name}} wrote:
> {{quote(.Original)}}
> 
> {{cursor()}}
> 
> I don't recall exactly how text templates work, but something like this.
> The quote function would quote and wrap the original email at 72
> columns, and the cursor() function would emit an empty string but would

[PATCH v2] Add Templates 5 days ago

From Srivathsan Murali to ~sircmpwn/aerc

This adds the ability to load templates into the body of the
email. When compose is called with '-T' flag, the default template
or the template with the name passed as value is used to populate
the body of the email.

There are two new configs options for accounts.conf: TemplateDir
and DefaultTemplate. Template Dir specifies the directory containing
the templates.DefaultTemplate specifies the template that is loaded
if no template name is provided.
---
Fixes the formatting issues pointed out by Jeffas in the first patch.
Also moved the logic to a lib file. This would help in the future
if we would like to implement template for the reply and forward
commands.
[message trimmed]

Re: [PATCH] Add Templates 5 days ago

From Srivathsan Murali to ~sircmpwn/aerc

On Tue Oct 8, 2019 at 11:41 AM Jeffas wrote:
> Should other commands e.g. reply or forward have a template
> available as well? If so, then it could be a good idea to put some of
> this logic in a lib file.
I was wondering about this. But I was unsure about how to handle for 
some options for reply and forward.
For example, should templates be available for quoted replies and
or for when messages are forwarded as body.

If you have any input on how to handle this, I could build templating 
into reply and forward too.

> Also, could you add docs for the command in doc/aerc.1.scd?
> Could you rearrange this to have the github dependency above the aerc

[PATCH] Add Templates 6 days ago

From Srivathsan Murali to ~sircmpwn/aerc

This adds the ability to load templates into the body of the
email. When compose is called with '-T' flag, the default template
or the template with the name passed as value is used to populate
the body of the email.

There are two new configs options for accounts.conf: TemplateDir
and DefaultTemplate. Template Dir specifies the directory containing
the templates.DefaultTemplate specifies the template that is loaded
if no template name is provided.
---
Implementation for #60: Email Templates
 commands/account/compose.go | 43 ++++++++++++++++++++++++++++++++-----
 config/config.go            |  2 ++
 doc/aerc-config.5.scd       |  7 ++++++
[message trimmed]

[PATCH v2] Config option to set index format for sent folder 11 days ago

From Srivathsan Murali to ~sircmpwn/aerc

Adds a config option "sent-index-format" that sets the
index format for messages in the sent directory.
The default value is set to show the address of the
first recepient instead of the sender.

This could be possible implementation for #292.
---
Fixes the formatting issue in v1

 config/aerc.conf.in   | 7 +++++++
 config/config.go      | 2 ++
 doc/aerc-config.5.scd | 6 ++++++
 widgets/msglist.go    | 7 ++++++-
 4 files changed, 21 insertions(+), 1 deletion(-)
[message trimmed]

Re: [PATCH] Config option to set index format for sent folder 11 days ago

From Srivathsan Murali to ~sircmpwn/aerc

On Wed Oct 2, 2019 at 4:23 PM Jeffas wrote:
> Not sure what went on with the formatting here but this is going to bug
> me. `ini`'s should be the same indentation as the rest.
So this is becuase I tabbed instead of using spaces. Will send a v2 of the
patch that fixes that.

> Annoyingly here the 't' isn't the same as the 'n'. The former will not
> use the actual name, though not sure what we'd want to do here as I
> can't see an option that is equivalent yet.

Yeah this bugged me too. Went for this safer option.
--
Cheers,
Srivathsan Murali (sri)

[PATCH] Config option to set index format for sent folder 11 days ago

From Srivathsan Murali to ~sircmpwn/aerc

Adds a config option "sent-index-format" that sets the
index format for messages in the sent directory.
The default value is set to show the address of the
first recepient instead of the sender.

---
This could be possible implementation for #292.

 config/aerc.conf.in   | 7 +++++++
 config/config.go      | 2 ++
 doc/aerc-config.5.scd | 6 ++++++
 widgets/msglist.go    | 7 ++++++-
 4 files changed, 21 insertions(+), 1 deletion(-)
[message trimmed]

[PATCH v3] Config for deleting message from message viewer 23 days ago

From Srivathsan Murali to ~sircmpwn/aerc

As suggested in #268, this adds a behaviour setting for
deleting message from message viewer.
---
Rebased to master

 commands/msg/delete.go |  2 +-
 config/aerc.conf.in    |  5 +++++
 config/config.go       | 50 ++++++++++++++++++++++--------------------
 doc/aerc-config.5.scd  |  5 +++++
 4 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/commands/msg/delete.go b/commands/msg/delete.go
index 677ea63c4b94..8fefbd5fcc5d 100644
--- a/commands/msg/delete.go
[message trimmed]