You are not logged in.

#1 2013-01-18 19:09:21

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

mutt-kz + conditional dates, etc.

For those interested: I've uploaded a mutt-kz (experimental mutt fork with native notmuch indexing/virtual-folder support) package to the AUR that is includes patches for neat stuff like conditional dates and nested if statements.

I use this, for example, to format my dates as "Today" and "Yesterday" or "May 12" depending on age. See https://picasaweb.google.com/1124618405 … 5128224130 for an example.

The muttrc (work in progress) I'm using for mutt-kz-dgc-git use is here: https://github.com/altercation/es-etc/b … trc_kz_dgc

The AUR page is: https://aur.archlinux.org/packages/mutt-kz-dgc-git/

EDIT: added embedded example screenshot

2013-01-18-102859-tau-es.jpg

Last edited by altercation (2013-01-20 14:53:47)


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#2 2013-01-19 18:16:05

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: mutt-kz + conditional dates, etc.

Thanks, I've been a mutt user for many years now. The upstream package is good enough for me, but still, this package is worth taking a look at.

Offline

#3 2013-01-19 21:10:38

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

Re: mutt-kz + conditional dates, etc.

Yeah, I'm still experimenting with it too. I also have a "pure" mutt+dgc patches for just the conditional date support (no forked mutt+notmuch) which I'd be happy to post to AUR if there is interest in that in lieu of this version.


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#4 2013-01-20 09:53:52

skinnyvoice
Member
From: London, UK
Registered: 2011-07-04
Posts: 18

Re: mutt-kz + conditional dates, etc.

altercation wrote:

For those interested: I've uploaded a mutt-kz (experimental mutt fork with native notmuch indexing/virtual-folder support) package to the AUR that is includes patches for neat stuff like conditional dates and nested if statements.

I use this, for example, to format my dates as "Today" and "Yesterday" or "May 12" depending on age. See https://picasaweb.google.com/1124618405 … 5128224130 for an example.

The muttrc (work in progress) I'm using for mutt-kz-dgc-git use is here: https://github.com/altercation/es-etc/b … trc_kz_dgc

The AUR page is: https://aur.archlinux.org/packages/mutt-kz-dgc-git/

I'm liking this very much. Been using mutt-kz for a while. The date formatting helps usability in the browser. Thanks

Offline

#5 2013-01-20 14:01:10

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

Re: mutt-kz + conditional dates, etc.

skinnyvoice wrote:
altercation wrote:

For those interested: I've uploaded a mutt-kz (experimental mutt fork with native notmuch indexing/virtual-folder support) package to the AUR that is includes patches for neat stuff like conditional dates and nested if statements.

I use this, for example, to format my dates as "Today" and "Yesterday" or "May 12" depending on age. See https://picasaweb.google.com/1124618405 … 5128224130 for an example.

The muttrc (work in progress) I'm using for mutt-kz-dgc-git use is here: https://github.com/altercation/es-etc/b … trc_kz_dgc

The AUR page is: https://aur.archlinux.org/packages/mutt-kz-dgc-git/

I'm liking this very much. Been using mutt-kz for a while. The date formatting helps usability in the browser. Thanks

Glad to hear it. The only drawback for me right now is that the relative dates are calculated when mutt launches, so if I leave it open for > 24 hours it's inaccurate. E.g. on launch if figures out the time offset for what messages will be marked as Yesterday/Today. I'd love to figure out a way to trigger an occasional refresh of that without restarting mutt. There is probably a way to do that, I just haven't checked yet (I just trigger a quick once a day restart of mutt in XMonad right now).


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#6 2013-01-21 10:27:53

skinnyvoice
Member
From: London, UK
Registered: 2011-07-04
Posts: 18

Re: mutt-kz + conditional dates, etc.

altercation wrote:

Glad to hear it. The only drawback for me right now is that the relative dates are calculated when mutt launches, so if I leave it open for > 24 hours it's inaccurate. E.g. on launch if figures out the time offset for what messages will be marked as Yesterday/Today. I'd love to figure out a way to trigger an occasional refresh of that without restarting mutt. There is probably a way to do that, I just haven't checked yet (I just trigger a quick once a day restart of mutt in XMonad right now).

Ah, just spotted that! I tend to leave mutt open too. I'll have to do the same with dwm. Let me know if you figure out a way of refreshing mutt

Offline

#7 2013-01-21 18:56:10

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

Re: mutt-kz + conditional dates, etc.

One way to do it, not perfect but what I was playing with just now, is to break out the index formats from muttrc into a separate file, source that file into muttrc on load, and then set a folder-hook to trigger on all folders to resource the formats file. It's fast in my tests but of course in this example only triggers on entering a folder. It would be possible to add it as a message hook as well and the formats would be pretty much constantly updated to the correct time offset.

Again, there may be other solutions, but this is a workable, only SORT of kludgy solution for now. smile


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#8 2013-01-21 21:50:20

skinnyvoice
Member
From: London, UK
Registered: 2011-07-04
Posts: 18

Re: mutt-kz + conditional dates, etc.

altercation wrote:

One way to do it, not perfect but what I was playing with just now, is to break out the index formats from muttrc into a separate file, source that file into muttrc on load, and then set a folder-hook to trigger on all folders to resource the formats file. It's fast in my tests but of course in this example only triggers on entering a folder. It would be possible to add it as a message hook as well and the formats would be pretty much constantly updated to the correct time offset.

Again, there may be other solutions, but this is a workable, only SORT of kludgy solution for now. smile

Nice one, I haven't had time to play so I've done just what you've suggested. Doesn't seem to be having an impact on load times (I've got 5 imap accounts being pulled in with offlineimap). I'll just wait until midnight to see if it works! (Only a couple of hours away here in the UK). Must be better than a killall mutt in the crontab at 5am wink

Offline

#9 2013-01-21 21:55:27

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

Re: mutt-kz + conditional dates, etc.

skinnyvoice wrote:
altercation wrote:

One way to do it, not perfect but what I was playing with just now, is to break out the index formats from muttrc into a separate file, source that file into muttrc on load, and then set a folder-hook to trigger on all folders to resource the formats file. It's fast in my tests but of course in this example only triggers on entering a folder. It would be possible to add it as a message hook as well and the formats would be pretty much constantly updated to the correct time offset.

Again, there may be other solutions, but this is a workable, only SORT of kludgy solution for now. smile

Nice one, I haven't had time to play so I've done just what you've suggested. Doesn't seem to be having an impact on load times (I've got 5 imap accounts being pulled in with offlineimap). I'll just wait until midnight to see if it works! (Only a couple of hours away here in the UK). Must be better than a killall mutt in the crontab at 5am wink

I've been using since I posted and haven't noticed any speed impact either, so far.

Here's another recommendation that I just posted to the mutt-kz list:

I've added two virtual date-range folders as a test. They work great and I thought others might find them useful (I'm excluding my spam folder here, but others might want to use tags/other)

(in virtual-mailboxes definition)

"Last 24 hours" "notmuch://?query=`date +%s --date='yesterday'`.. and NOT folder:spam"
"Last 7 days" "notmuch://?query=`date +%s --date='last week'`.. and NOT folder:spam"

Note that the second element of the date range (after the ..) is not included as it is only read at mutt startup and thus no new mail would ever show up in these folders.

This leads to a question: since the date timestamp is only calculated when the muttrc is read in, these two folders will *expand* in date range over time (the start timestamp is static, actual space-time isn't), can anyone come up with a way to refresh this query syntax occasionally?

I thought about breaking out my virtual folder definitions into a separate muttrc file and sourcing it via a folder-hook (so every time I change folders, all queries would be udpated) but this merely adds an entirely new set of identically named virtual folders to the sidebar. (mutt-kz seems to "collapse" identical query folders to just the last defined folder, but in this case the timestamps make each sourcing of the folder a unique query).

Last edited by altercation (2013-01-21 22:23:14)


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

#10 2013-04-12 08:31:51

theseus
Member
Registered: 2011-07-20
Posts: 19

Re: mutt-kz + conditional dates, etc.

Hello,


Sorry to re-open an old post but I'd like to give this a try.
I downloaded the AUR but the build is broken.
On top of that, your github link is no longer available.

Could you please give an update on this?

Thanks!

Offline

#11 2013-04-13 17:07:41

altercation
Member
From: Seattle
Registered: 2011-05-15
Posts: 136
Website

Re: mutt-kz + conditional dates, etc.

theseus wrote:

Hello,


Sorry to re-open an old post but I'd like to give this a try.
I downloaded the AUR but the build is broken.
On top of that, your github link is no longer available.

Could you please give an update on this?

Thanks!

The main git repo is linked to from the PKGBUILD: https://aur.archlinux.org/packages/mutt-kz-dgc-git/ and should still be working fine. I'd recommend reverting to a different mutt-kz package in the AUR if this one is broken. mutt-kz is a moving target right now and while it's probably trivial to update this package to work again, it was more of an experiment on my part.

I know that some of the patches I included in the PKGBUILD were included in later mutt-kz builds or forks. There might be information on the mutt-kz mailing list.

If you want to give it a go, I'd orphan the package and you are welcome to pick it up for maintenance. I'm afraid I just don't have time for it right now. Sorry about that but do let me know if you'd like to take it over.


Ethan Schoonover
Precision Colors - http://ethanschoonover.com/solarized

Offline

Board footer

Powered by FluxBB