From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Dehennin Newsgroups: gmane.emacs.gnus.general,gmane.emacs.devel Subject: Re: [PATCH] Use replace-match in posting-style. Date: Mon, 12 Jul 2010 21:43:45 +0200 Message-ID: <87y6dg5vv2.fsf@hati.baby-gnu.org> References: <87ab3gfb41.fsf@hati.baby-gnu.org> <87r5wrgg8w.fsf@lifelogs.com> <87y6gvwryp.fsf@hati.baby-gnu.org> <87d3y7p1ie.fsf@gnu.org> <87633y7v02.fsf@hati.baby-gnu.org> <87vdbyccgg.fsf@hati.baby-gnu.org> <87eiikdfub.fsf@hati.baby-gnu.org> <87ocf18ntz.fsf@hati.baby-gnu.org> <87aaq2uldu.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1278963918 22212 80.91.229.12 (12 Jul 2010 19:45:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Jul 2010 19:45:18 +0000 (UTC) Cc: , Emacs Development To: Ted Zlatanov Original-X-From: ding-owner+M18197@lists.math.uh.edu Mon Jul 12 21:45:16 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OYOw9-0005Ud-Eq for ding-account@gmane.org; Mon, 12 Jul 2010 21:45:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1OYOvA-0001Xn-1d; Mon, 12 Jul 2010 14:44:08 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1OYOv8-0001XU-EJ for ding@lists.math.uh.edu; Mon, 12 Jul 2010 14:44:06 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1OYOv7-0000Gh-2f for ding@lists.math.uh.edu; Mon, 12 Jul 2010 14:44:06 -0500 Original-Received: from zion.baby-gnu.org ([82.233.222.74]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1OYOv6-0004vd-00 for ; Mon, 12 Jul 2010 21:44:04 +0200 Original-Received: from hati.asgardr.info ([192.168.1.2] helo=hati.baby-gnu.org) by zion.baby-gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1OYOuu-000145-R1; Mon, 12 Jul 2010 21:43:52 +0200 In-Reply-To: <87aaq2uldu.fsf@lifelogs.com> (Ted Zlatanov's message of "Thu, 8 Jul 2010 08:57:17 -0500") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Organisation: Dark Church of Emacs X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:69807 gmane.emacs.devel:127119 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ted Zlatanov 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=C2=A0? Regards. =2D-=20 Daniel Dehennin R=C3=A9cup=C3=A9rer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEAREKAAYFAkw7cHgACgkQb97L6l6P4FslWQCeL0KapPwK4O1ZNEtnWjjArk4N +2EAn0zpOR8C1robBwsB1je26Qf5Vke1 =uBJd -----END PGP SIGNATURE----- --=-=-=--