Wild-card for deep-path tab-completion when using "c" to change folders?

2022-07-14 Thread Tim Chase
My Maildir is structured with folders like

  INBOX/
  INBOX/Folder/
  INBOX/Folder/Subfolder/

rather than flat-with-delimiter

  INBOX/
  INBOX.Folder/
  INBOX.Folder.Subfolder/

When I press "c" to change the current folder (or any other context
where a folder-path is expected like "s"ave), is there a way to
specify the deep part and have tab-completion find it? E.g. typing
"Sub" and having  complete to "INBOX/Folder/Subfolder"?

In some utilities (vim, zsh, etc), using "**" would be the typical
way of specifying this:

  **/Sub*

but that doesn't seem to do anything special (doesn't expand, and
complains there's no folder named "**/Sub*").

Is there some way to get tab-expansion to drill into subdirectories
for completion?

Thanks!

-tkc






Re: Color messages in the index view dynamically

2022-07-14 Thread dm1...@gmail.com
Thanks Ed.
In case someone else is interested in setting this up too, here is
where I am so far.

Having the messages in the maildir format on my side, I regularly
(upon new message arrival using Mutt's $new_mail_command, and also
once a day) scan the To-do folder with a script (here is a simplified
version; uses procmail and mblaze packages):

#!/bin/zsh
while IFS=$'\n' read -r mailfile; do
  _due=$(formail -c -f -z -x 'Subject' < "${mailfile}" \
   | grep --only-matching --max-count=1 --perl-regexp
--regexp="[0-9]{4}-[0-9]{2}-[0-9]{2}" \
   | tr --delete - \
)
  if [[ -n $_due ]]; then
due=$(date -d "$_due" +%s)
now=$(date -d $(date +%Y-%m-%d) +%s)
if [[ $now -ge $due ]]; then
  echo "$(formail -f -I 'X-TODO: OVERDUE' < ${mailfile} | cat )" >
"${mailfile}"
  mflag -F "${mailfile}" > /dev/null 2>&1
fi
  fi
done < <(find ~/Mail/To-do -type f -print)

It adds a custom header X-TODO, based on which I mark respective
messages with color:

color index white red "~h '^X-TODO: OVERDUE$'"

To propagate changes to the far side, along with adding the header,
which is never syncing, I also add a flag, which does sync. Anyway,
Gmail’s web interface does not support sorting by subject, so at least
I can spot the starred messages of interest there.

Best,

--
Dmitry


On Thu, Jul 7, 2022 at 4:40 PM dm1...@gmail.com  wrote:
>
> Hi all,
>
> I have some messages with a subject line containing the "due:[here
> goes some date]" text. I want mutt to color these messages differently
> and dynamically (at every opening or refreshing the mailbox) according
> to whether the date in the subject is in the past or the future
> compared with the current date.
> Is it possible to accomplish?
>
> It would be nice to enchance the "todo.txt" approach with the "to-do
> mailbox" advantages :-)
>
> Best,
>
> --
> Dmitry