Discussion:
limit in folder hook?
Alexander Dahl
2018-08-22 13:36:54 UTC
Permalink
Hei hei,

I have a limit pattern which works interactively, but which I can not
get to work as a folder hook. This is what I use when hitting the l
key in the index, and which works fine:

!=s "git commit"

If I want to set that as a folder hook, from the manual I understood,
that I must use push and <limit>, but I don't get the escaping right.
mutt always says:

<limit>: 'unknown command'

So I guess I'm doing the quoting wrong. This is what I have in my
~/.mutt/muttrc and in the separate folder-hooks file:

source ~/.mutt/folder-hooks


folder-hook . push "<limit>.<enter>"
folder-hook =Lists/buildroot 'push "<limit>!=s \"git commit\"<enter>"'

The first hook is to reset the limit on all folders, the second to set
the limit pattern on the folder for the buildroot mailing list.

Could someone please enlighten me?

Greets
Alex
--
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN | speech censured, the first thought forbidden, the
X AGAINST | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie)
Francesco Ariis
2018-08-22 13:40:15 UTC
Permalink
Hello Alexander,
Post by Alexander Dahl
folder-hook . push "<limit>.<enter>"
folder-hook =Lists/buildroot 'push "<limit>!=s \"git commit\"<enter>"'
Can't test now, but first one looks not correct, it should be

folder-hook . 'push <limit>.<enter>'
# quoting is before `push`

Does this work?
Alexander Dahl
2018-08-22 14:20:12 UTC
Permalink
Hei hei,
Post by Francesco Ariis
Post by Alexander Dahl
folder-hook . push "<limit>.<enter>"
folder-hook =Lists/buildroot 'push "<limit>!=s \"git commit\"<enter>"'
Can't test now, but first one looks not correct, it should be
folder-hook . 'push <limit>.<enter>'
# quoting is before `push`
Does this work?
I think so, at least it brought me on the right track. What I got now
is this line only (with my own mailserver of course):

folder-hook imaps://***@mail.example.com/Lists/buildroot 'push "<limit>!=s \"git commit\"<enter>"'

First thing I got wrong was the regex for the folder, apparently I
need something like the above. Second thing was the quoting. The above
seems to work like I want it to. Third thing: no "reset" is necessary,
when changing folders/mailboxes with the key c the limit is reset by
mutt anyway.

Thanks and Greets
Alex
--
/"\ ASCII RIBBON | »With the first link, the chain is forged. The first
\ / CAMPAIGN | speech censured, the first thought forbidden, the
X AGAINST | first freedom denied, chains us all irrevocably.«
/ \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie)
Continue reading on narkive:
Loading...