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

Re: Replying to a specific message



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday, August 27 at 06:10 PM, quoth Shreevatsa R:
> The only "parsing" that the pattern parser needs to do is break up 
> the user-input string into "logical parts" of the form (~i EXPR), 
> (~s EXPR), etc., and then each corresponding part can do its job 
> with the actual string that was input. (The parser might also have 
> to do some logical AND/OR/NOT operations, but that's later.) It has 
> no reason to poke at the actual EXPR strings and mess with them. The 
> parser already has a () logical grouping operator; I maintain that 
> this is all it needs. By simply refusing to interpret
> ~i foo\ and\ bar
> as one argument to ~i and instead requiring either ~i "foo and bar" or 
> ~i (foo and bar), it can completely do away with the extra dequoting 
> step and pass to the regex engine the same strings it gets, intact. It 
> spends an extra step parsing the string and dequoting all characters, 
> when all it needs to do is something much simpler.

So under your system, if I say:

     ~i "foo and bar"

Should the regex engine see:

     foo and bar

...or should the regex engine see:

     "foo and bar"

In other words, should the quotes (or parentheses) be stripped out?

If not, how can I match something that doesn't have quotes in it (such 
as the Message-ID)?

If they should, how can I match something that DOES have quotes in it?

> Anyway, nevermind this rant; back to the original question: Given 
> that mutt has no syntax for specifying that a string must be 
> interpreted literally (an annoying omission), "escaping" is 
> necessary. Simply replacing each $ with \\$ (or with [$]) works for 
> everything I have encountered, so the question is entirely 
> hypothetical: what more might I have to worry about, and has anyone 
> thought about the problem of escaping a string for mutt and solved 
> it? There is no consistency to speak of among regular expression 
> implementations; each has its own quirks; and simply using another 
> language's "escape" function might not work with mutt.

THAT is a far more useful question... I don't have a good generic 
answer for you, though.

~Kyle
- -- 
Reliability means never having to say you're sorry.
                                             -- Dr. Daniel J. Bernstein
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAki13E8ACgkQBkIOoMqOI177EACg8O3rVOSgXkPWByqUt6bzVyV4
lswAoK3unaGCUv5FwfHYoEbsY2l60j0w
=mN0M
-----END PGP SIGNATURE-----