[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Use replace-match in posting-style.
From: |
Daniel Dehennin |
Subject: |
Re: [PATCH] Use replace-match in posting-style. |
Date: |
Mon, 12 Jul 2010 21:43:45 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) |
Ted Zlatanov <address@hidden> writes:
> It worries me that we're inventing (yes, including the
> nnmail-split-fancy usage) something that looks like but isn't at all a
> real regex positional replacement. Can we find out from emacs-devel if
> this can be done better through ELisp or even C and then apply the fix
> both to your code and to nnmail-split-fancy? We'll also need to find
> out if XEmacs can do something similar, since Gnus supports it as well.
>
> I think the description you gave is probably not specific enough to give
> us the best answers; can you write a more formal definition of how
> my-expand should behave?
Ok, I'll try:
The idea is to use the match-data informations to expand positional
parameters in any string, where replace-match only works on the one the
match occurs.
1. my-expand take a string as argument,
2. if there is no captured match then return the argument,
3. if the string does not contains positional parameters then return the
argument,
4. build a new sting from the argument by replacing all the positional
parameters by their captured value,
5. return the new string.
Is this what you asked ?
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpeH8riyUZgX.pgp
Description: PGP signature