On Sun, Jun 28, 2020 at 08:37:23AM +1000, Cameron Simpson wrote:
On 26Jun2020 09:17, Kevin J. McCarthy <ke...@8t8.us> wrote:One thing I can do is keep the escaping *only* for the cases it might be needed, such as hook command extraction.I am for removing _all_ the escaping. Anything that mangles the values in variables should be removed - it only makes for unreliable behaviour.
Hi Cameron, Thanks for your reply and comments.I agree that automatic escaping isn't a good idea, but I'm cautious of the need to balance clean behavior against potentially breaking existing configurations.
The "escaping" is that newlines, carriage returns, and tabs are converted to the actual string "\n", "\r", and "\t". Backslash and double quotes are backslash escaped.
It's used for "set ?var" output, and for Mutt variable expansion (in double quoted or unquoted content).The only place I could see that would run through the "muttrc parsing" code twice are the "command" arguments of hooks. Those are parsed when the hook is read in; and again when the hook fires and the "command" argument is executed. If the variable was in a double quoted or unquoted command it is evaluated in the first pass and those characters might cause problems the the command was actually run.
Well, that's my theory anyway. Perhaps the escaping was a mistake, only intended to be done with "set ?var" output. I'm not sure how much the behavior is relied on (or even how helpful the escaping is...), but again I'm afraid of breaking configs after 20 years of established behavior.
The only reason I'm daring to change assignment like set my_foo = $editor is because escaping there is just plain wrong.
I there's a _real_ use for escaping (hmm, what _kind_ of escaping? shell compatible quoting?), I'd rather provide a mechanism for doing that than have subtle/obscure special cases.
At this point, I'm not sure what other kinds of uses there would be in Mutt. If you (or anyone else) can point to a real example where it would be useful in Mutt, that would be helpful.
-- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature