Re: Offlineimap only for current folder

2022-07-28 Thread José María Mateos

On Thu, Jul 28, 2022 at 04:44:07PM +0300, Oleg A. Mamontov wrote:

I use the following approach for the same problem but with mbsync:
---
folder-hook . "source ~/.mutt/on-folder-change"
---

where ~/.mutt/on-folder-change has the below content:
---
set record = ^
set my_folder = `echo $record | sed 's|.*/||' | sed 's|\\.|/|g'`
macro index,pager o ":unset wait_keyclear; printf '# syncing =$my_folder\\n\\n'; 
mbsync full:$my_folder:set wait_key" "sync current folder"
---

I know, it looks a bit creepy but works pretty well :)


At least I understand what you're doing, more or less :-) Thanks for 
your solution. I'll stand by in case someone posts something a bit more 
straightforward (which I think might not exist.)


--
José María (Chema) Mateos || https://rinzewind.org


Re: Offlineimap only for current folder

2022-07-28 Thread Oleg A. Mamontov

Hi,

On Thu, Jul 28, 2022 at 09:29:34AM -0400, José María Mateos wrote:

Hi all,

I have offlineimap running on a cron job every 5 minutes, but from 
time to time (for example, I've received a login code) I want to 
refresh the current folder faster. For that, I have this macro:


macro index,pager G "!offlineimap\n" "Retrieve new IMAP messages"

It works well, but this refreshes all folders; I'd be great if it 
worked only for the folder I'm currently in. Is there any "environment 
variable" for the macro that I can use in this case?


I use the following approach for the same problem but with mbsync:
---
folder-hook . "source ~/.mutt/on-folder-change"
---

where ~/.mutt/on-folder-change has the below content:
---
set record = ^
set my_folder = `echo $record | sed 's|.*/||' | sed 's|\\.|/|g'`
macro index,pager o ":unset wait_keyclear; printf '# syncing =$my_folder\\n\\n'; 
mbsync full:$my_folder:set wait_key" "sync current folder"
---

I know, it looks a bit creepy but works pretty well :)


Thanks!

--
José María (Chema) Mateos || https://rinzewind.org


--
Cheers,
Oleg A. Mamontov

email: o...@mamontov.net
phone: +7 (903) 798-1352


Offlineimap only for current folder

2022-07-28 Thread José María Mateos

Hi all,

I have offlineimap running on a cron job every 5 minutes, but from time 
to time (for example, I've received a login code) I want to refresh the 
current folder faster. For that, I have this macro:


macro index,pager G "!offlineimap\n" "Retrieve new IMAP messages"

It works well, but this refreshes all folders; I'd be great if it worked 
only for the folder I'm currently in. Is there any "environment 
variable" for the macro that I can use in this case?


Thanks!

--
José María (Chema) Mateos || https://rinzewind.org