Macro variable with current folder name?
Dennis Preiser
dp-mutt at d--p.de
Sat Mar 11 18:30:13 UTC 2023
On Sat, Mar 11, 2023 at 01:05:13PM -0500, José María Mateos wrote:
> On Sat, Mar 11, 2023 at 06:15:14PM +0100, Dennis Preiser wrote:
>>
>> folder-hook . 'set my_record=$record; \
>> set record=^; \
>> macro index,pager G "<enter-command>echo $record<enter>"; \
>> set record=$my_record'
>
> Thanks for your suggestion. I tried this:
>
> folder-hook . 'set my_record=$record; \
> set record=^; \
> macro index,pager G "!offlineimap -o -l /tmp/offlineimap.log -f $record\n" \
> "Retrieve new IMAP messages for current folder"; \
> set record=$my_record'
>
> However, I got an error that leads me to think that the parameter $record is
> not being received on the other side. Perhaps I should surround the variable
> name with something so that the shell recognizes it?
When I use the following macro inside the folder-hook (I don't have
offlineimap)
macro index,pager G "!/bin/echo $record\n"; \
and then press G in my inbox I got
| =INBOX.INBOX
| Press any key to continue...
Just to be sure: You don't have another macro "macro index,pager G ..."
behind the folder-hook?
Dennis
More information about the Mutt-users
mailing list