<<< Date Index >>>     <<< Thread Index >>>

Re: folder-hook does not work like expected



On 2005-03-04, Michelle Konzack <linux4michelle@xxxxxxxxxx> wrote:
> Hello,
> 
> I an trying to load different configurations of my BnuPG setup.
> If I call ":source ~/.mutt/security.pgp.debian" it works very well.
> 
> Now I have created some folder hooks:
> 
>   __( '/home/michelle.konzack/.mutt/hook-folder' )______________________
>  /
> | ######################################################################
> | # 
> | # folder-hook [!]<pattern> <command>
> | 
> | folder-hook     BTS_debian      source ~/.mutt/security.pgp.debian
> | folder-hook     ML_arabeyes     source ~/.mutt/security.pgp.arabeyes
> | folder-hook     ML_debian       source ~/.mutt/security.pgp.debian
> | folder-hook     ML_dos          source ~/.mutt/security.pgp.dos
> | folder-hook     ML_linux        source ~/.mutt/security.pgp.linux
> | folder-hook     ML_misc         source ~/.mutt/security.pgp.misc
> | folder-hook     ML_php          source ~/.mutt/security.pgp.php
> | folder-hook     ML_postgresql   source ~/.mutt/security.pgp.postgresql
> | folder-hook     ML_programming  source ~/.mutt/security.pgp.programming
>  \______________________________________________________________________
> 
> I have already checked whether it calls the right folder-hook or not,
> but whenever I change the folder, mutt tells me "Unknown command".
> 
> I have already tried:
> 
> folder-hook ML_debian :source ~/.mutt/security.pgp.debian
> folder-hook ML_debian <shell-escape>source ~/.mutt/security.pgp.debian
> folder-hook ML_debian ':source ~/.mutt/security.pgp.debian'
> folder-hook ML_debian '<shell-escape>source ~/.mutt/security.pgp.debian'
> folder-hook ML_debian ":source ~/.mutt/security.pgp.debian"
> folder-hook ML_debian "<shell-escape>source ~/.mutt/security.pgp.debian"
> 
> and otherstuff...
> 
> In the section 3.5 of the manual it is written:
> 
>     folder-hook mutt set sort=threads
> 
> so I was asuming, that my version from sourcing a config works simmilar.
> 
>     folder-hook debian source <file>
> 
> Can anyone help me ?

Quote the command and don't start the command with ':' or 
'<shell-escape>':

    folder-hook     BTS_debian      'source ~/.mutt/security.pgp.debian'
    folder-hook     ML_arabeyes     'source ~/.mutt/security.pgp.arabeyes'
    folder-hook     ML_debian       'source ~/.mutt/security.pgp.debian'
    folder-hook     ML_dos          'source ~/.mutt/security.pgp.dos'
    folder-hook     ML_linux        'source ~/.mutt/security.pgp.linux'
    folder-hook     ML_misc         'source ~/.mutt/security.pgp.misc'
    folder-hook     ML_php          'source ~/.mutt/security.pgp.php'
    folder-hook     ML_postgresql   'source ~/.mutt/security.pgp.postgresql'
    folder-hook     ML_programming  'source ~/.mutt/security.pgp.programming'

I don't know why the quoting appears necessary.  I have some 
examples of folder-hooks in my muttrc have the command quoted and 
some that don't.  The one folder-hook I have that executes a source 
command has the command quoted and it works.

Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA