[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-users
Subject:    Re: Problems with hooks, 'set' and quoting/escaping values
From:       David Woodfall <dave () dawoodfall ! net>
Date:       2018-05-18 17:32:52
Message-ID: 20180518173252.GA3122 () blackswan
[Download RAW message or body]

On Friday 18 May 2018 18:22,
Dave Woodfall <dave@dawoodfall.net> put forth the proposition:
>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?

Answering my own question. This works:

reply-hook .* "set editor='vim +\":call ListMailer()\" %s'"

I reversed the single and double quotes.

-Dave

--

Please don't reply directly to me or CC me.

The linuX Files -- The Source is Out There.
  -- Sent in by Craig S. Bell, goat@aracnet.com

  .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.     .-.
.'   `._.'   `._.'   `._.'   `._.'   `._.'   `._.'   `._.'   `._.'   `.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic