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

Re: mutt/2140: message-hook and patterns, [: invalid command



* On Thu, Nov 16, 2006 Ben Love (blove@xxxxxxxxxxx) muttered:
> When trying to set something like this:
> 
> folder-hook . set index_format="%F %C"
> 
> on startup I get this error:
> 
> %C: unknown variable
> 
> The problem appears to be the space
> 
> folder-hook . 'set index_format="%F %c"'
> 
> If this is correct behaviour (which it seems like it is), then it should
> probably be noted in the man page and/or manual that an extra pass of
> translation is performed with <command> on hook directives (and maybe
> other places?).

http://www.mutt.org/doc/devel/manual.html#muttrc-syntax

"Single quotes (') and double quotes (") can be used to quote strings
which contain spaces or other special characters."

Spaces always need quoting. folder-hook has two arguments regexp and
command. Both need quoting if they contain spaces.
Usage: folder-hook [!]regexp command
             /----------        |
            / |-----------------------|
folder-hook . set index_format="%F %C" 
so
folder-hook . "set index_format=[value]"

And since you need quotes for the value of
index_format (it contains spaces again) too, you need two levels of
quoting. This is not at all surprising, is it?

folder-hook . 'set index_format="%F %c"' 

Also see: http://wiki.mutt.org/?PatternQuoting

If you feel, the manual needs improvement, send a patch to mutt-dev. Any
help with improving docs is appreciated. Note: If possible please
directly patch manual.xml.head which is in doc-book format.

HTH,

Michael
-- 
BOFH excuse #55:

Plumber mistook routing panel for decorative wall fixture

PGP-Key-ID: 0xDC1A44DD
Jabber:     init[0]@amessage.de