From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/69513 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] Use replace-match in posting-style. Date: Sun, 11 Apr 2010 15:13:53 +0200 Message-ID: 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1270991758 3691 80.91.229.12 (11 Apr 2010 13:15:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Apr 2010 13:15:58 +0000 (UTC) Cc: ding@gnus.org To: Daniel Dehennin Original-X-From: ding-owner+M17908@lists.math.uh.edu Sun Apr 11 15:15:57 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 1O0x0z-0002Zm-S7 for ding-account@gmane.org; Sun, 11 Apr 2010 15:15:54 +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 1O0wzf-00008A-VI; Sun, 11 Apr 2010 08:14:32 -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 1O0wzc-00007u-Qh for ding@lists.math.uh.edu; Sun, 11 Apr 2010 08:14:28 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1O0wza-0007Jx-Kc for ding@lists.math.uh.edu; Sun, 11 Apr 2010 08:14:28 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.9]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1O0wzZ-00053A-00 for ; Sun, 11 Apr 2010 15:14:25 +0200 Original-Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 41C681C1541D; Sun, 11 Apr 2010 15:13:55 +0200 (CEST) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 2C1A4902C8; Sun, 11 Apr 2010 15:13:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan1.mnet-online.de [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id ofqkNmlUpMNl; Sun, 11 Apr 2010 15:13:54 +0200 (CEST) Original-Received: from igel.home (ppp-88-217-112-45.dynamic.mnet-online.de [88.217.112.45]) by mail.mnet-online.de (Postfix) with ESMTP; Sun, 11 Apr 2010 15:13:54 +0200 (CEST) Original-Received: by igel.home (Postfix, from userid 501) id BABC7CA297; Sun, 11 Apr 2010 15:13:53 +0200 (CEST) X-Yow: I request a weekend in Havana with Phil Silvers! In-Reply-To: <87633y7v02.fsf@hati.baby-gnu.org> (Daniel Dehennin's message of "Sun, 11 Apr 2010 01:22:53 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.95 (gnu/linux) X-Spam-Score: -3.3 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:69513 Archived-At: Daniel Dehennin writes: > We need to be sure that the value contains a positional parameter: > > (let ((group "mydomain.foo.com") > (match "mydomain\\.\\(foo\\|bar\\)") > (values '((name "Daniel Dehennin") > (address "test@mydomain"))) > value element) > (and (string-match match group) > (mapcar (lambda (x) > (setq element (car x) > value (cadr x)) > (cons element > > (cond ((stringp value) > (if (and (stringp match) > ;; The FIX > (string-match-p "\\\\[&[:digit:]]" value) > (match-beginning 1)) > (replace-match value nil nil group) > value))))) > values))) > > => ((name . "Daniel Dehennin") (address . "foo@mydomain.com")) I find this pretty confusing. I would have expected "foo@mydomain" as the address value (assuming it was "\\1@mydomain" originally). Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."