Re: Index screen - could it feature time segments?

2020-08-03 Thread Leho Kraav
On Mon, Aug 03, 2020 at 09:45:38PM +, Job Snijders wrote:
> On Sun, Aug 02, 2020 at 03:40:36PM +0300, Leho Kraav wrote:
> > On Sun, Aug 02, 2020 at 02:28:10PM +0200, Matthias Apitz wrote:
> > > 
> > > Ah, now I understand your intention better. I though you want to draw a
> > > horizontal line between the times of Today, Yesterday, Last Week, 2
> > > weeks ago etc. like M$ OutLook it does. What you want to have, is an
> > > additional column with some time indicator. Correct? 
> > 
> > Horizontal display-only lines are the goal.
> > 
> > See right edge of this screenshot:
> > https://lh3.googleusercontent.com/proxy/cVzlSH2JCHNJAM32g8NmKOISjkIPBCne27JLtzJd_fvRdV6dPu9S6IpPSiGFdoBgomT2HlybTi7RbxipyI3-jGn58jsvUDvcyA6xiWy-zUt3KglrjijxPsPUjqRIJw
> 
> the URL seems to give an error 'forbidden'
> 
> I'd be curious to see a mock-up of what you meant!

Oops!

See 
https://www.ghacks.net/2008/02/15/group-mails-in-thunderbird-chronologically/

"Chronological grouping" is the term I was looking for.

-- 
Leho Kraav, senior technology & digital marketing architect


Re: Index screen - could it feature time segments?

2020-08-03 Thread Will Yardley
On Tue, Aug 04, 2020 at 12:26:01AM +0300, Leho Kraav wrote:
> On Mon, Aug 03, 2020 at 05:08:25PM -0400, Josef 'Jeff' Sipek wrote:

> > Alternatively, if you are accessing the mailboxes via IMAP, the server
> > software may have a fancier mechanism.  For example, Dovecot has virtual
> > folders.
> 
> I'm on Dovecot, and am already taking full advantage of virtual folders.
> 
> My virtual inbox is actually a "last 2 days" view, but I would *still*
> like to have a segmentation "Today", "Yesterday", etc within this mail index 
> screen.

Mutt also has the limit feature.

I know you're not interested in more comments from people saying that
this is not a feature they want to see in Mutt, but I think that what
you're asking for really isn't something that makes a lot of sense for
Mutt or how most Mutt users work.

w



Toggling multiple index_format or limits

2020-08-03 Thread Kevin J. McCarthy
[I'm moving this into a separate thread, because it doesn't directly 
help Leho.]


Here's a little bit of new functionality I've added to master for the 
next release.  I just wanted to give a peek.  (Both require enabling 
$muttlisp_inline_eval).


Three-way $index_format toggle.  (The index-format-hook is extraneous 
but I'm copying from my muttrc here:)


set my_idx1 = "%Z %-20.20F %s %*  (%c) %@reldate@"
set my_idx2 = "%Z %-20.20F %s %*  %@reldate@"
set my_idx3 = "%4C %[!%a %x %X]  %-15.15F %Z (%4c) %s"
set index_format = $my_idx1

index-format-hook  reldate  "%d<24H"  "%[!%X]"
index-format-hook  reldate  "~A" "%[!%x]"

macro index i 'set index_format =  \
  (or \
(if (equal $index_format $my_idx1) $my_idx2)  \
(if (equal $index_format $my_idx2) $my_idx3)  \
$my_idx1) \
'


Here's a possible 6-way toggle of date-limiting, along with an echo 
afterwards.


set my_limall = "~A"
set my_lim1 = "~d >2w"  # older than two weeks
set my_lim2 = "~d <2w ~d >1w"   # two weeks ago
set my_lim3 = "~d <1w"  # last week
set my_lim4 = "~d <2d ~d >1d"   # yesterday
set my_lim5 = "~d <1d"  # today
folder-hook . "set my_curlim = $my_limall"

macro index ,t 'set my_curlim =  \
  (or   \
(if (equal $my_curlim $my_limall) $my_lim1) \
(if (equal $my_curlim $my_lim1)   $my_lim2) \
(if (equal $my_curlim $my_lim2)   $my_lim3) \
(if (equal $my_curlim $my_lim3)   $my_lim4) \
(if (equal $my_curlim $my_lim4)   $my_lim5) \
$my_limall) \
\
push (concat "<" "limit" ">" $my_curlim "<" "enter" ">")\
echo (concat "limit set to: " $my_curlim)'

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-03 Thread Kevin J. McCarthy

On Tue, Aug 04, 2020 at 12:26:01AM +0300, Leho Kraav wrote:
My virtual inbox is actually a "last 2 days" view, but I would *still* 
like to have a segmentation "Today", "Yesterday", etc within this mail 
index screen.


I also have a "last 30 days" folder, where segmentation would be even 
more useful.


Other folks in the thread have had good suggestions, but I'll also throw 
out index-format-hook to add labels to the message based on age.  That 
at least might make it more obvious where the age-range groups span.


You could also use macros to switch to different limits, or (with more 
work) rotate among a few date-range limit-views.


--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA


signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-03 Thread Felix Finch

On 20200803, Remco Rijnders wrote:

Note that I am not passing judgement on your need for this
functionality, but if it is an absolute requirement/deal breaker for
you, then mutt might not be the tool to use here.


I haven't been following this very deeply, but have two ideas.

One: My $date_format is "%Y%m%d" and I put that in the $index_format as "%d".  
It's easy enough to see where the date changes.

Two: Fake it with a cron job which throws in dummy messages for the dates 
desired, with fake headers to show dashes:

 From: 
 Subject: -

The cron job would fire off at midnight and either delete the old dummies and 
create new ones, or adjust the existing dummies in place.

Both of these assume the sort order is by date.

--
   ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & wood chipper / fe...@crowfix.com
 GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


Re: Index screen - could it feature time segments?

2020-08-03 Thread Remco Rijnders
On Tue, Aug 04, 2020 at 12:26:01AM +0300, Leho wrote in 
<20200803212601.GB6143@papaya>:

Alternatively, if you are accessing the mailboxes via IMAP, the server
software may have a fancier mechanism.  For example, Dovecot has virtual
folders.


I'm on Dovecot, and am already taking full advantage of virtual folders.

My virtual inbox is actually a "last 2 days" view, but I would *still*
like to have a segmentation "Today", "Yesterday", etc within this mail index 
screen.

I also have a "last 30 days" folder, where segmentation would be even more 
useful.

One of the replies mentioned something about "tasteful" or similar. For
me, mail is not a fashion statement, it needs to get work done, so not
giving that taste argument much weight.

Thus far, it seems like it's simply a technically difficult goal.

Other than that, haven't seen a any legit alternatives or arguments to
convert this want into "OK I really don't need it after all".


I think the dovecot alternative you use now, and/or using a tool like
mairix (which I never used, but it seems you can use it to create time
based virtual mailboxes) is as good as you are going to get it with
mutt. Mutt displays messages per mailbox, filtered if you want, and
sorted as you want, but always one message per line. As far as I know
there is no way to get any sort of grouping based on message age that
you want in a single view, let alone provide a way to collapse/expand
such groupings.

Note that I am not passing judgement on your need for this
functionality, but if it is an absolute requirement/deal breaker for
you, then mutt might not be the tool to use here.

I hope that with the suggestions you've been given you can find
something that will "kind of" work for you, as I'm out of ideas
otherwise.

Kind regards,

Remco


signature.asc
Description: PGP signature


Re: Index screen - could it feature time segments?

2020-08-03 Thread Leho Kraav
On Mon, Aug 03, 2020 at 05:08:25PM -0400, Josef 'Jeff' Sipek wrote:
> On Mon, Aug 03, 2020 at 16:23:03 -0400, Logan Rathbone wrote:
> ...
> > Another way of potentially achieving this may be to think outside the 
> > box -- or outside the index, in this case.
> > 
> > Why not set up the MTA to deliver mail into a mailbox called "Today" and 
> > set up a daily cronjob to do further sorting of the mail into different 
> > mailboxes by date?  This won't allow for separators in the index view, 
> > but will allow OP to view these groups of dates in the mailbox view.
> 
> Alternatively, if you are accessing the mailboxes via IMAP, the server
> software may have a fancier mechanism.  For example, Dovecot has virtual
> folders.

I'm on Dovecot, and am already taking full advantage of virtual folders.

My virtual inbox is actually a "last 2 days" view, but I would *still*
like to have a segmentation "Today", "Yesterday", etc within this mail index 
screen.

I also have a "last 30 days" folder, where segmentation would be even more 
useful.

One of the replies mentioned something about "tasteful" or similar. For
me, mail is not a fashion statement, it needs to get work done, so not
giving that taste argument much weight.

Thus far, it seems like it's simply a technically difficult goal.

Other than that, haven't seen a any legit alternatives or arguments to
convert this want into "OK I really don't need it after all".


Re: Index screen - could it feature time segments?

2020-08-03 Thread Josef 'Jeff' Sipek
On Mon, Aug 03, 2020 at 16:23:03 -0400, Logan Rathbone wrote:
...
> Another way of potentially achieving this may be to think outside the 
> box -- or outside the index, in this case.
> 
> Why not set up the MTA to deliver mail into a mailbox called "Today" and 
> set up a daily cronjob to do further sorting of the mail into different 
> mailboxes by date?  This won't allow for separators in the index view, 
> but will allow OP to view these groups of dates in the mailbox view.

Alternatively, if you are accessing the mailboxes via IMAP, the server
software may have a fancier mechanism.  For example, Dovecot has virtual
folders.

Jeff.

-- 
Evolution, n.:
  A hypothetical process whereby infinitely improbable events occur with
  alarming frequency, order arises from chaos, and no one is given credit.


Re: Index screen - could it feature time segments?

2020-08-03 Thread Logan Rathbone

On Sun, Aug 02, 2020 at 06:24:24AM -0400, Remco Rijnders wrote:
On Sun, Aug 02, 2020 at 12:24:35PM +0300, Leho wrote in 
<173ae7cb050.2742.b94389c50b70d4ef8bda8663b7428...@kraav.com>:
Hi. I'm looking for a way to get mutt index to segment list display 
with Today, Yesterday, Last Week, 2 weeks ago etc separators.


Feels like it should be technically possible, but I haven't been 
able to find a configuration or a patch for this.


I don't think this is possible "out of the box", as you are limited by
what options $index_format [1] offers, which in turn uses $date_format
[2], which in turn uses the functionality offered by the systems
strftime(3) function. That said, you could use a script as a filter
which provide such functionality [3] by passing it the timestamp of
the message and returning the desired string to display.

I do not know of a script that will do exactly what you want, though
they may exist. If not, you can roll your own, perhaps using some
scripting around the datediff command from the dateutils package [4]?

[snip]

1: http://www.mutt.org/doc/manual/#index-format
2: http://www.mutt.org/doc/manual/#date-format
3: http://www.mutt.org/doc/manual/#formatstrings-filters
4: https://www.fresse.org/dateutils/#datediff


I think this is a great response.  Too complicated for me to delve into, 
and I don't even want or need this functionality -- for me, I'll add it 
to the pile with "creative" features like "unified inbox" that 
contemporary mail clients are utilizing that I also have no interest in 
-- but it looks like it might be at least possible to put 
Yesterday/Today/etc. type nomenclature in the $index_format variable.


But I don't think Mutt has any concept of the type of separators in the 
index view that OP is trying to achieve and populate with these type of 
strings.


Another way of potentially achieving this may be to think outside the 
box -- or outside the index, in this case.


Why not set up the MTA to deliver mail into a mailbox called "Today" and 
set up a daily cronjob to do further sorting of the mail into different 
mailboxes by date?  This won't allow for separators in the index view, 
but will allow OP to view these groups of dates in the mailbox view.


Re: Index screen - could it feature time segments?

2020-08-03 Thread Derek Martin
On Sun, Aug 02, 2020 at 12:24:35PM +0300, Leho Kraav wrote:
> Hi. I'm looking for a way to get mutt index to segment list display with
> Today, Yesterday, Last Week, 2 weeks ago etc separators.
> 
> Feels like it should be technically possible, but I haven't been able to
> find a configuration or a patch for this.
> 
> Your thoughts?

My thoughts are:

 - Blech.  This is not Outlook. I always thought it was a distasteful
   waste of space in Outlook, and it would be even more so in Mutt.
   Obviously, it's a matter of taste, which is highly individual.

 - There's no way to do this currently in Mutt.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



signature.asc
Description: PGP signature