[MlMt] Counter format syntax

Benny Kjær Nielsen mailinglist at freron.com
Sat Jul 16 09:26:58 EDT 2022

On 16 Jul 2022, at 14:44, David Wainberg wrote:

> One thing I want to fix is the format of the information behind a 
> counter dropdown. The documentation of the format syntax is pretty 
> sparse - https://manual.mailmate-app.com/format_string_syntax.html - 
> and I'm having trouble figuring it out.

Very understandable.

> Specifically, what I want to do at the moment is to shorten and fix 
> the length of the subject display, since by default it is variable, 
> and some email subjects are quite long. The size and positioning of 
> the dropdown adjusts accordingly, which I find undesirable.

That could be something like this (using regular expressions):


That looks pretty menacing, but it's the same syntax as provided by some 
text editors when doing search/replace. The MailMate syntax is identical 
to the one used by TextMate. That means the documentation found 
is also useful for MailMate (and the example is more advanced than the 
one provided here).

To elaborate, this is the format string variant used above:


The `var` is `subject`, but this could be any email header (or a subpart 
of a header).

The `regexp` is:


It matches 10 characters and then the rest in 2 different capture 

The `format` used is then:


Which simply uses the (up to) 10 characters in the first capture and 
then adds the ellipsis if and only if the second capture contains 

> Even if that's not doable, I'd like to play with the format.
> I've searched the list and haven't found anything. Can anyone point me 
> to more docs or examples I can crib from?

The above isn't much, but maybe it'll help a bit.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20220716/4c3dffb2/attachment.htm>

More information about the mailmate mailing list