David Woodfall
2018-05-18 17:22:27 UTC
When using hooks I find that I sometimes have problems with using
'set' and some variables that need quoting or escaping.
eg: the following work:
folder-hook =Sent 'set index_format="%3C %[!%d/%m/%y] %-15.15F %s"'
folder-hook =Folk 'set editor="vim +\':call Mailer()\' %s"'
However I'm having problems with this line:
reply-hook .* 'set editor="vim +\':call Mailer()\' %s"'
No matter how I quote/escape it I always get an error. Either
something in the lines of '+:call: unknown variable' or 'sh -c
unexpected '('' I don't know why this works with folder-hook but not
with reply-hook.
My usual way out of these situations is to put such commands in a
file and have a hook source it, but to make a file for just one
command just seems wrong.
Any ideas?
How do you guys cope with situations like this?
-Dave
--
Please don't reply directly to me or CC me.
All language designers are arrogant. Goes with the territory...
-- Larry Wall
.-. .-. .-. .-. .-. .-. .-. .-. .-.
.' `._.' `._.' `._.' `._.' `._.' `._.' `._.' `._.' `.
'set' and some variables that need quoting or escaping.
eg: the following work:
folder-hook =Sent 'set index_format="%3C %[!%d/%m/%y] %-15.15F %s"'
folder-hook =Folk 'set editor="vim +\':call Mailer()\' %s"'
However I'm having problems with this line:
reply-hook .* 'set editor="vim +\':call Mailer()\' %s"'
No matter how I quote/escape it I always get an error. Either
something in the lines of '+:call: unknown variable' or 'sh -c
unexpected '('' I don't know why this works with folder-hook but not
with reply-hook.
My usual way out of these situations is to put such commands in a
file and have a hook source it, but to make a file for just one
command just seems wrong.
Any ideas?
How do you guys cope with situations like this?
-Dave
--
Please don't reply directly to me or CC me.
All language designers are arrogant. Goes with the territory...
-- Larry Wall
.-. .-. .-. .-. .-. .-. .-. .-. .-.
.' `._.' `._.' `._.' `._.' `._.' `._.' `._.' `._.' `.