Re: hook \\.
- To: mutt-users@xxxxxxxx
- Subject: Re: hook \\.
- From: Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx>
- Date: Fri, 12 Oct 2007 19:45:52 -0500
- Comment: DomainKeys? See http://domainkeys.sourceforge.net/
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=memoryhole.net; h=date:from:to:subject:message-id:references:mime-version:content-type:in-reply-to; q=dns/txt; s=default; bh=BQhh7PWtgC8RjEP/9f8FZdnhjyc=; b=d7zj+uftvoabiRNT0Vve6XoH2esaRXsPrws69/I8unRG+XfPDUQVdp7FBNugoZAGV1WtlQbWPFs7e7d7D6jH13G+HZw0uAHuDfEBiOz5ICB+vBcD1CCGQ0ANhjjoK2YDtbLH7rx1u/5py9UhRPgCc4vLgO3hrekeQXrUqOf38ls=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=memoryhole.net; b=ghwQ0l9Wwtbl9pzmhnpAl2LrP/mGTDnxjl1++hEZA9elaDNVivGiTGEjJ4ng8xmNdwtuXt8GtB1BgDqjvtEt3lS9wpTmhV9ctviNwmzVDFwoC5L4TXTIwCMe1DR4Xo35wxoaGBx7C4T63sdDrZJrile18X54mv6xKZ2LgturCq4=; h=Received:Received:Date:From:To:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent;
- In-reply-to: <20071012235355.GB6556@xxxxxxxxxxxx>
- List-post: <mailto:mutt-users@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-users"
- Mail-followup-to: mutt-users@xxxxxxxx
- References: <20071012235355.GB6556@xxxxxxxxxxxx>
- Sender: owner-mutt-users@xxxxxxxx
- User-agent: Mutt/1.5.16 (2007-09-19)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday, October 12 at 05:53 PM, quoth Joseph:
>I'm reading mutt manual and it has an example:
>
>save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
>save-hook aol\\.com$ +spam
>
>Why there is a "\\."?
>I know singe backslash "\" turn off special meaning for "."
>double backslash would indicate that it is a "\" character.
It's because of mutt's sometimes inscrutable escaping rules. When mutt
is reading something that isn't quoted, it strips off a level of
escapes. So the following two lines are equivalent:
save-hook me@turing\\.cs\\.hmc\\.edu +elkins
save-hook 'me@turing\.cs\.hmc\.edu' +elkins
The following two lines are ALSO equivalent:
save-hook . foo
save-hook \. foo
The way mutt's parser works, first it extracts strings to match the
pattern:
save-hook string1 string2
Then, string1 is saved as the regular expression that triggers the
hook, and string2 is saved as the command to run. Mutt un-escapes
things when interpreting the rc file to extract string1, but the
backslash has to survive and be present in the regular expression.
Thus, unless you quote it, you have to use two backslashes.
Consider that you can also use octal escapes:
save-hook me@\146 +elkins
When mutt interprets that, it will store string1 as "me@f". That way
you can encode unusual characters into the muttrc (such as your $from
or $realname) even if your muttrc can only be in us-ascii (for
whatever reason).
~Kyle
- --
I think we ought always to entertain our opinions with some measure of
doubt. I shouldn't wish people dogmatically to believe any philosophy,
not even mine.
-- Bertrand Russell
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFHEBVABkIOoMqOI14RAqBHAKDTEF8bmiUD4QF/fn6964BmsDT9kwCgnf5y
CGsGDAnpFlAGZyz8hPTxLro=
=VQok
-----END PGP SIGNATURE-----