Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] Use replace-match in posting-style.
@ 2009-07-07 21:15 Daniel Dehennin
  2009-07-08 18:51 ` Ted Zlatanov
  0 siblings, 1 reply; 42+ messages in thread
From: Daniel Dehennin @ 2009-07-07 21:15 UTC (permalink / raw)
  To: ding


[-- Attachment #1.1: Type: text/plain, Size: 966 bytes --]

With this patch we can use \N in attributes of posting-style, this is
usefull when using several email on a domain, like:

--8<---------------cut here---------------start------------->8---
(setq gnus-posting-styles
      '(("mydomain.\\(.*\\)"
         (name "Daniel Dehennin")
         (address "\\1@mydomain")
         (signature-file "~/.signature.mydomain.\\1"))))
--8<---------------cut here---------------end--------------->8---

This only works for string match on group name.

------------------------------------------------------------
revno: 142
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: posting-style
timestamp: Tue 2009-07-07 23:02:32 +0200
message:
  Use replace-match in posting-style.
  
  * lisp/gnus-msg.el (gnus-configure-posting-styles): If the value is a
    string and if the match is a group name (string)
  
  * texi/gnus.texi (Posting Styles): Add documentation on replace-match call.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: posting-style-142.patch --]
[-- Type: text/x-patch, Size: 2554 bytes --]

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090707210232-\
#   uenjtpeindzsq9bb
# target_branch: ../../gnus.head
# testament_sha1: d8581219cb5d8a4ad733edd26cec02ee4306555e
# timestamp: 2009-07-07 23:04:52 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090623223900-\
#   ydqdsazun1mg75c6
# 
# Begin patch
=== modified file 'lisp/gnus-msg.el'
--- lisp/gnus-msg.el	2009-01-22 07:02:15 +0000
+++ lisp/gnus-msg.el	2009-07-07 21:02:32 +0000
@@ -1890,7 +1890,10 @@
 	    (setq v
 		  (cond
 		   ((stringp value)
-		    value)
+		    (if (and (stringp match)
+			     (match-beginning 1))
+			(replace-match value nil nil group)
+		      value))
 		   ((or (symbolp value)
 			(functionp value))
 		    (cond ((functionp value)

=== modified file 'texi/gnus.texi'
--- texi/gnus.texi	2009-06-08 22:47:52 +0000
+++ texi/gnus.texi	2009-07-07 21:02:32 +0000
@@ -13393,14 +13393,20 @@
 name will be removed.  If the attribute name is @code{eval}, the form
 is evaluated, and the result is thrown away.
 
-The attribute value can be a string (used verbatim), a function with
-zero arguments (the return value will be used), a variable (its value
-will be used) or a list (it will be @code{eval}ed and the return value
-will be used).  The functions and sexps are called/@code{eval}ed in the
-message buffer that is being set up.  The headers of the current article
-are available through the @code{message-reply-headers} variable, which
-is a vector of the following headers: number subject from date id
-references chars lines xref extra.
+The attribute value can be a string, a function with zero arguments
+(the return value will be used), a variable (its value will be used)
+or a list (it will be @code{eval}ed and the return value will be
+used).  The functions and sexps are called/@code{eval}ed in the
+message buffer that is being set up.  The headers of the current
+article are available through the @code{message-reply-headers}
+variable, which is a vector of the following headers: number subject
+from date id references chars lines xref extra.
+
+In the case of a string value, if the @code{match} is a regular
+expression, a @samp{replace-match} is proceed on the value to replace
+the positional parameters @samp{\@var{n}} by the corresponding
+parenthetical matches (see @xref{Replacing the Text that Matched, ,
+Text Replacement, elisp, The Emacs Lisp Reference Manual}.)
 
 @vindex message-reply-headers
 


[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2009-07-07 21:15 [PATCH] Use replace-match in posting-style Daniel Dehennin
@ 2009-07-08 18:51 ` Ted Zlatanov
  2010-04-10  9:57   ` Daniel Dehennin
  0 siblings, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2009-07-08 18:51 UTC (permalink / raw)
  To: ding

On Tue, 07 Jul 2009 23:15:42 +0200 Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote: 

DD> With this patch we can use \N in attributes of posting-style, this is
DD> usefull when using several email on a domain, like:
DD> (setq gnus-posting-styles
DD>       '(("mydomain.\\(.*\\)"
DD>          (name "Daniel Dehennin")
DD>          (address "\\1@mydomain")
DD>          (signature-file "~/.signature.mydomain.\\1"))))

DD> This only works for string match on group name.

DD> ------------------------------------------------------------
DD> revno: 142
DD> committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
DD> branch nick: posting-style
DD> timestamp: Tue 2009-07-07 23:02:32 +0200
DD> message:
DD>   Use replace-match in posting-style.
  
DD>   * lisp/gnus-msg.el (gnus-configure-posting-styles): If the value is a
DD>     string and if the match is a group name (string)
  
DD>   * texi/gnus.texi (Posting Styles): Add documentation on replace-match call.

I like this a lot.  Do you have papers on file?  Any objections?

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2009-07-08 18:51 ` Ted Zlatanov
@ 2010-04-10  9:57   ` Daniel Dehennin
  2010-04-10 19:10     ` Johan Bockgård
  0 siblings, 1 reply; 42+ messages in thread
From: Daniel Dehennin @ 2010-04-10  9:57 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

Le 5789 Septembre 1993, Ted Zlatanov a envoyé:
> I like this a lot.  Do you have papers on file?  Any objections?

I had confirmation about assignment on Gnus on january 30'th 2009, so
it's ok ;-)
-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-04-10  9:57   ` Daniel Dehennin
@ 2010-04-10 19:10     ` Johan Bockgård
  2010-04-10 23:22       ` Daniel Dehennin
  0 siblings, 1 reply; 42+ messages in thread
From: Johan Bockgård @ 2010-04-10 19:10 UTC (permalink / raw)
  To: ding

Daniel Dehennin <daniel.dehennin@baby-gnu.org> writes:

> Le 5789 Septembre 1993, Ted Zlatanov a envoyé:
>> I like this a lot.  Do you have papers on file?  Any objections?
>
> I had confirmation about assignment on Gnus on january 30'th 2009, so
> it's ok ;-)

I think the replacement needs to be more careful.

  (let ((group "mydomain.foo.com")
        (match "mydomain\\.\\(foo\\|bar\\)")
        (values '((name "Daniel Dehennin")
                  (address "\\1@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)
                                         (match-beginning 1))
                                    (replace-match value nil nil group)
                                  value)))))
                 values)))
  =>
    ((name . "Daniel Dehennin.com") (address . "foo@mydomain.com"))



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-04-10 19:10     ` Johan Bockgård
@ 2010-04-10 23:22       ` Daniel Dehennin
  2010-04-11 13:13         ` Andreas Schwab
  0 siblings, 1 reply; 42+ messages in thread
From: Daniel Dehennin @ 2010-04-10 23:22 UTC (permalink / raw)
  To: ding


[-- Attachment #1.1: Type: text/plain, Size: 1178 bytes --]

Le 6065 Septembre 1993, Johan Bockgård a envoyé:
[...]
> I think the replacement needs to be more careful

Hello,

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"))

Regards.

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Use replace-match in posting-style --]
[-- Type: text/x-diff, Size: 469 bytes --]

=== modified file 'lisp/gnus-msg.el'
--- lisp/gnus-msg.el	2009-01-22 07:02:15 +0000
+++ lisp/gnus-msg.el	2010-04-10 23:18:55 +0000
@@ -1890,7 +1890,11 @@
 	    (setq v
 		  (cond
 		   ((stringp value)
-		    value)
+		    (if (and (stringp match)
+			     (string-match-p "\\\\[&[:digit:]]" value)
+			     (match-beginning 1))
+			(replace-match value nil nil group)
+		      value))
 		   ((or (symbolp value)
 			(functionp value))
 		    (cond ((functionp value)


[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-04-10 23:22       ` Daniel Dehennin
@ 2010-04-11 13:13         ` Andreas Schwab
  2010-04-11 14:04           ` Daniel Dehennin
  0 siblings, 1 reply; 42+ messages in thread
From: Andreas Schwab @ 2010-04-11 13:13 UTC (permalink / raw)
  To: Daniel Dehennin; +Cc: ding

Daniel Dehennin <daniel.dehennin@baby-gnu.org> 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."



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-04-11 13:13         ` Andreas Schwab
@ 2010-04-11 14:04           ` Daniel Dehennin
  2010-04-11 15:06             ` Andreas Schwab
  0 siblings, 1 reply; 42+ messages in thread
From: Daniel Dehennin @ 2010-04-11 14:04 UTC (permalink / raw)
  To: ding


[-- Attachment #1.1: Type: text/plain, Size: 1827 bytes --]

Andreas Schwab <schwab@linux-m68k.org> writes:

>> => ((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).

Erf, I notices the replacement in the name but not the trailing ".com"
in the address.

The problem comes from the match, it should match the entire group like
this:

    (match "mydomain\\.\\(foo\\|bar\\).*")

I don't know if it's possible to replace the positionnal parameter
directly in the value, i.e. expanding the positional parameter in value
and not using it as a replacement against group.

For now we can limit the replacement to the matching part of the group:

  (let ((group "mydomain.foo.com")
        (match "mydomain\\.\\(foo\\|bar\\)")
        (values '((name "Daniel Dehennin")
                  (address "\\1@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 
                                                   (substring group (match-beginning 0) (match-end 0)))
                                  value)))))
                 values)))

 => ((name . "Daniel Dehennin") (address . "foo@mydomain"))

Regards.
-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Use replacement in posting-style --]
[-- Type: text/x-diff, Size: 546 bytes --]

=== modified file 'lisp/gnus-msg.el'
--- lisp/gnus-msg.el	2009-01-22 07:02:15 +0000
+++ lisp/gnus-msg.el	2010-04-11 14:02:03 +0000
@@ -1890,7 +1890,12 @@
 	    (setq v
 		  (cond
 		   ((stringp value)
-		    value)
+		    (if (and (stringp match)
+			     (string-match-p "\\\\[&[:digit:]]" value)
+			     (match-beginning 1))
+			(replace-match value nil nil 
+				       (substring group (match-beginning 0) (match-end 0)))
+		      value))
 		   ((or (symbolp value)
 			(functionp value))
 		    (cond ((functionp value)


[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-04-11 14:04           ` Daniel Dehennin
@ 2010-04-11 15:06             ` Andreas Schwab
  2010-04-12 12:18               ` Daniel Dehennin
  0 siblings, 1 reply; 42+ messages in thread
From: Andreas Schwab @ 2010-04-11 15:06 UTC (permalink / raw)
  To: Daniel Dehennin; +Cc: ding

Daniel Dehennin <daniel.dehennin@baby-gnu.org> writes:

>                                     (replace-match value nil nil 
>                                                    (substring group (match-beginning 0) (match-end 0)))

This won't work if the match does not start at the beginning of the
string, ie. (match-beginning 0) is greater than zero.  You'll have to
first do a new string-match on the substring.

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."



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-04-11 15:06             ` Andreas Schwab
@ 2010-04-12 12:18               ` Daniel Dehennin
  2010-06-23 21:02                 ` Daniel Dehennin
  2010-09-02 17:59                 ` Ted Zlatanov
  0 siblings, 2 replies; 42+ messages in thread
From: Daniel Dehennin @ 2010-04-12 12:18 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 3046 bytes --]

Andreas Schwab <schwab@linux-m68k.org> writes:

> Daniel Dehennin <daniel.dehennin@baby-gnu.org> writes:
>
>>                                     (replace-match value nil nil 
>>                                                    (substring group (match-beginning 0) (match-end 0)))
>
> This won't work if the match does not start at the beginning of the
> string, ie. (match-beginning 0) is greater than zero.  You'll have to
> first do a new string-match on the substring.

Ok, looking in elisp manual, I saw nothing to expand positional
parameters in a string.

I first saw this functionality in nnmail-split-fancy, so I look in the
code a find the nnmail-expand-newtext in nnmail.el.

I adapt it to my needs, I think such function should be "mainstream".

What do you thing about this:

;; I need the matched string because I found no way to get it from
;; (match-data)
(defun my-expand (string matched &optional lowercase)
  "Replace positional parameters with the text matched by groups in the
<matched> string.
If the optional lowercase parameter is set, the matched text by groups
is forced to lowercase."
  (let ((len (length string))
	(pos 0)
	c expanded beg N did-expand)
    (while (< pos len)
      (setq beg pos)
      (while (and (< pos len)
		  (not (= (aref string pos) ?\\)))
	(setq pos (1+ pos)))
      (unless (= beg pos)
	(push (substring string beg pos) expanded))
      (when (< pos len)
	;; We hit a \; expand it.
	(setq did-expand t
	      pos (1+ pos)
	      c (aref string pos))
	(if (not (or (= c ?\&)
		     (and (>= c ?1)
			  (<= c ?9))))
	    ;; \ followed by some character we don't expand.
	    (push (char-to-string c) expanded)
	  ;; \& or \N
	  (if (= c ?\&)
	      (setq N 0)
	    (setq N (- c ?0)))
	  (when (match-beginning N)
	    (push (if lowercase
		      (downcase (substring matched (match-beginning N)
					    (match-end N)))
		    (substring matched (match-beginning N) (match-end N)))
		  expanded))))
      (setq pos (1+ pos)))
    (if did-expand
	(apply 'concat (nreverse expanded))
      string)))

  

  (let ((group "test-mydomain.foo.com")
        (match "mydomain\\.\\(foo\\|bar\\)")
        (values '((name "Daniel Dehennin")
                  (address "whatever.\\1@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)
					 (string-match-p "\\\\[&[:digit:]]" value)
                                         (match-beginning 1))
                                    (my-expand value group)
                                  value)))))
                 values)))

 => ((name . "Daniel Dehennin") (address . "whatever.foo@mydomain"))

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-04-12 12:18               ` Daniel Dehennin
@ 2010-06-23 21:02                 ` Daniel Dehennin
  2010-07-08 13:57                   ` Ted Zlatanov
  2010-08-29 20:07                   ` [PATCH] Use replace-match in posting-style Lars Magne Ingebrigtsen
  2010-09-02 17:59                 ` Ted Zlatanov
  1 sibling, 2 replies; 42+ messages in thread
From: Daniel Dehennin @ 2010-06-23 21:02 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

Daniel Dehennin <daniel.dehennin@baby-gnu.org> writes:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Daniel Dehennin <daniel.dehennin@baby-gnu.org> writes:
>>
>>>                                     (replace-match value nil nil 
>>>                                                    (substring group (match-beginning 0) (match-end 0)))
>>
>> This won't work if the match does not start at the beginning of the
>> string, ie. (match-beginning 0) is greater than zero.  You'll have to
>> first do a new string-match on the substring.
>
> Ok, looking in elisp manual, I saw nothing to expand positional
> parameters in a string.
>
> I first saw this functionality in nnmail-split-fancy, so I look in the
> code a find the nnmail-expand-newtext in nnmail.el.
>
> I adapt it to my needs, I think such function should be "mainstream".
>
> What do you thing about this:
>
> ;; I need the matched string because I found no way to get it from
> ;; (match-data)
> (defun my-expand (string matched &optional lowercase)
>   "Replace positional parameters with the text matched by groups in the
> <matched> string.
> If the optional lowercase parameter is set, the matched text by groups
> is forced to lowercase."

[...]

No feedback about this features?

Regards.
-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-06-23 21:02                 ` Daniel Dehennin
@ 2010-07-08 13:57                   ` Ted Zlatanov
  2010-07-12 19:43                     ` Daniel Dehennin
  2010-08-29 20:07                   ` [PATCH] Use replace-match in posting-style Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-07-08 13:57 UTC (permalink / raw)
  To: Daniel Dehennin; +Cc: ding, Emacs Development

On Wed, 23 Jun 2010 23:02:16 +0200 Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote: 

DD> Daniel Dehennin <daniel.dehennin@baby-gnu.org> writes:
>> Ok, looking in elisp manual, I saw nothing to expand positional
>> parameters in a string.
>> 
>> I first saw this functionality in nnmail-split-fancy, so I look in the
>> code a find the nnmail-expand-newtext in nnmail.el.
>> 
>> I adapt it to my needs, I think such function should be "mainstream".
>> 
>> What do you thing about this:
>> 
>> ;; I need the matched string because I found no way to get it from
>> ;; (match-data)
>> (defun my-expand (string matched &optional lowercase)
>> "Replace positional parameters with the text matched by groups in the
>> <matched> string.
>> If the optional lowercase parameter is set, the matched text by groups
>> is forced to lowercase."

DD> No feedback about this features?

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?

Thanks
Ted



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-07-08 13:57                   ` Ted Zlatanov
@ 2010-07-12 19:43                     ` Daniel Dehennin
  2010-07-30 17:43                       ` replace matches in any string (was: [PATCH] Use replace-match in posting-style.) Ted Zlatanov
  0 siblings, 1 reply; 42+ messages in thread
From: Daniel Dehennin @ 2010-07-12 19:43 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding, Emacs Development

[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]

Ted Zlatanov <tzz@lifelogs.com> 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

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* replace matches in any string (was: [PATCH] Use replace-match in posting-style.)
  2010-07-12 19:43                     ` Daniel Dehennin
@ 2010-07-30 17:43                       ` Ted Zlatanov
  2010-09-01 13:55                         ` replace matches in any string Ted Zlatanov
  0 siblings, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-07-30 17:43 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

I'll try to explain more clearly since there haven't been responses.
Daniel said:

"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."

So for example, we can say:

(when (string-match
       "\\(daniel\\)"
       "daniel.dehennin@baby-gnu.org")
  (replace-match "Daniel is \\1" nil nil "daniel.dehennin@baby-gnu.org" 1))
-> "Daniel is daniel.dehennin@baby-gnu.org"

But replace-match needs to be passed the same string that matched
("daniel.dehennin@baby-gnu.org" in the example).  How can we replace \\1
and the other positional parameters in arbitrary text?  Gnus has
nnmail-expand-newtext[1] to do this and it would be great to avoid special
code to do it, or if such code can't be avoided, at least move it
outside Gnus because IMO it's generally applicable and useful.

Thanks
Ted

[1] presented without comment, as it is in the source :)

(defun nnmail-expand-newtext (newtext)
  (let ((len (length newtext))
	(pos 0)
	c expanded beg N did-expand)
    (while (< pos len)
      (setq beg pos)
      (while (and (< pos len)
		  (not (= (aref newtext pos) ?\\)))
	(setq pos (1+ pos)))
      (unless (= beg pos)
	(push (substring newtext beg pos) expanded))
      (when (< pos len)
	;; We hit a \; expand it.
	(setq did-expand t
	      pos (1+ pos)
	      c (aref newtext pos))
	(if (not (or (= c ?\&)
		     (and (>= c ?1)
			  (<= c ?9))))
	    ;; \ followed by some character we don't expand.
	    (push (char-to-string c) expanded)
	  ;; \& or \N
	  (if (= c ?\&)
	      (setq N 0)
	    (setq N (- c ?0)))
	  (when (match-beginning N)
	    (push (if nnmail-split-lowercase-expanded
		      (downcase (buffer-substring (match-beginning N)
						  (match-end N)))
		    (buffer-substring (match-beginning N) (match-end N)))
		  expanded))))
      (setq pos (1+ pos)))
    (if did-expand
	(apply 'concat (nreverse expanded))
      newtext)))




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-06-23 21:02                 ` Daniel Dehennin
  2010-07-08 13:57                   ` Ted Zlatanov
@ 2010-08-29 20:07                   ` Lars Magne Ingebrigtsen
  2010-08-30 13:41                     ` Ted Zlatanov
  1 sibling, 1 reply; 42+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-29 20:07 UTC (permalink / raw)
  To: ding

Daniel Dehennin <daniel.dehennin@baby-gnu.org> writes:

> No feedback about this features?

Good question.  :-)  Was it ever applied?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-08-29 20:07                   ` [PATCH] Use replace-match in posting-style Lars Magne Ingebrigtsen
@ 2010-08-30 13:41                     ` Ted Zlatanov
  2010-08-30 17:11                       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-08-30 13:41 UTC (permalink / raw)
  To: ding

On Sun, 29 Aug 2010 22:07:58 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Daniel Dehennin <daniel.dehennin@baby-gnu.org> writes:
>> No feedback about this features?

LMI> Good question.  :-)  Was it ever applied?

I'm waiting for comments on emacs-devel about the match replacement
function.  I still think it's generally useful (being able to replace \1
and such in generic text, not just the original string).  I have no
issues with the patch otherwise so if you or anyone else want to apply
it, go ahead.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-08-30 13:41                     ` Ted Zlatanov
@ 2010-08-30 17:11                       ` Lars Magne Ingebrigtsen
  2010-08-31 18:42                         ` Ted Zlatanov
  0 siblings, 1 reply; 42+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-30 17:11 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> I'm waiting for comments on emacs-devel about the match replacement
> function.  I still think it's generally useful (being able to replace \1
> and such in generic text, not just the original string).  I have no
> issues with the patch otherwise so if you or anyone else want to apply
> it, go ahead.

It sounds useful, but it would be nice to have a comment from the
emacs-devel people first...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-08-30 17:11                       ` Lars Magne Ingebrigtsen
@ 2010-08-31 18:42                         ` Ted Zlatanov
  2010-08-31 18:47                           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-08-31 18:42 UTC (permalink / raw)
  To: ding

On Mon, 30 Aug 2010 19:11:12 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> I'm waiting for comments on emacs-devel about the match replacement
>> function.  I still think it's generally useful (being able to replace \1
>> and such in generic text, not just the original string).  I have no
>> issues with the patch otherwise so if you or anyone else want to apply
>> it, go ahead.

LMI> It sounds useful, but it would be nice to have a comment from the
LMI> emacs-devel people first...

Yeah...  It seems like a no-brainer but for some reason no one has
commented.  Maybe I should make the subject "git vs. Bazaar on Windows
rules my keyboard shortcuts" to get eyeballs.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-08-31 18:42                         ` Ted Zlatanov
@ 2010-08-31 18:47                           ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 42+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-08-31 18:47 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> Yeah...  It seems like a no-brainer but for some reason no one has
> commented.  Maybe I should make the subject "git vs. Bazaar on Windows
> rules my keyboard shortcuts" to get eyeballs.

Tee hee.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-07-30 17:43                       ` replace matches in any string (was: [PATCH] Use replace-match in posting-style.) Ted Zlatanov
@ 2010-09-01 13:55                         ` Ted Zlatanov
  2010-09-02 11:29                           ` Stefan Monnier
  0 siblings, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-01 13:55 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

On Fri, 30 Jul 2010 12:43:28 -0500 Ted Zlatanov <tzz@lifelogs.com> wrote: 

TZ> I'll try to explain more clearly since there haven't been responses.
TZ> Daniel said:

TZ> "The idea is to use the match-data informations to expand positional
TZ> parameters in any string, where replace-match only works on the one the
TZ> match occurs."

TZ> So for example, we can say:

TZ> (when (string-match
TZ>        "\\(daniel\\)"
TZ>        "daniel.dehennin@baby-gnu.org")
TZ>   (replace-match "Daniel is \\1" nil nil "daniel.dehennin@baby-gnu.org" 1))
TZ> -> "Daniel is daniel.dehennin@baby-gnu.org"

TZ> But replace-match needs to be passed the same string that matched
TZ> ("daniel.dehennin@baby-gnu.org" in the example).  How can we replace \\1
TZ> and the other positional parameters in arbitrary text?  Gnus has
TZ> nnmail-expand-newtext[1] to do this and it would be great to avoid special
TZ> code to do it, or if such code can't be avoided, at least move it
TZ> outside Gnus because IMO it's generally applicable and useful.

I haven't heard any comments on this.  It's blocking a Gnus feature so
I'd really like to get it done; the code is ready[1] so I simply need to
know if this functionality should be in Emacs or only in Gnus.

Ted

[1] --or we'll make Lars hack it until it's ready, you've been warned--




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-01 13:55                         ` replace matches in any string Ted Zlatanov
@ 2010-09-02 11:29                           ` Stefan Monnier
  2010-09-02 13:10                             ` Ted Zlatanov
  0 siblings, 1 reply; 42+ messages in thread
From: Stefan Monnier @ 2010-09-02 11:29 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding, emacs-devel

> I haven't heard any comments on this.  It's blocking a Gnus feature so
> I'd really like to get it done; the code is ready[1] so I simply need to
> know if this functionality should be in Emacs or only in Gnus.

I do not understand the feature you request.
Rather than code that supposedly implements the feature, try to post
examples of uses you'd like to see work.

I have the impression that what you want is already provided by
replace-match, tho only in the case when the match was performed on
a string rather than in a buffer.


        Stefan



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 11:29                           ` Stefan Monnier
@ 2010-09-02 13:10                             ` Ted Zlatanov
  2010-09-02 14:44                               ` Lars Magne Ingebrigtsen
  2010-09-02 16:21                               ` Stefan Monnier
  0 siblings, 2 replies; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-02 13:10 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

On Thu, 02 Sep 2010 13:29:41 +0200 Stefan Monnier <monnier@iro.umontreal.ca> wrote: 

SM> I do not understand the feature you request.
SM> Rather than code that supposedly implements the feature, try to post
SM> examples of uses you'd like to see work.

I believe the following is accurate.  Daniel, please correct me if I'm
wrong in my description.

Given:

(let ((regex "\\(alpha\\)")
      (string "gamma alpha beta"))
  (when (string-match regex string)
    (replace-match "[first greek letter \\1]" nil nil string 1)))
-> "gamma [first greek letter alpha] beta"

We want the equivalent but against any string, not just the original
string (the `replace-match' docs say STRING has to be the one used for
the original `string-match').  The use case is when you say to match X
in an e-mail address, then set the target group to "something-X-other".
We want to do it with regex "\\(X\\)" against "userX@valid.domain" and
target group "something-\\1-other".  Does that make sense?  Basically we
want \1 but without the context of that original string we matched:

(let ((regex "\\(alpha\\)")
      (string "gamma alpha beta"))
  (when (string-match regex string)
    (our-new-function "found greek letter \\1")))
-> "found greek letter alpha"

As I said, `nnmail-expand-newtext' implements this for Gnus purposes and
it can handle \[0-9] arguments and \& for the whole match but it's not
generic.  It needed to be extended for Daniel Dehennin's patch and so we
came to this.

SM> I have the impression that what you want is already provided by
SM> replace-match, tho only in the case when the match was performed on
SM> a string rather than in a buffer.

I hope so.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 13:10                             ` Ted Zlatanov
@ 2010-09-02 14:44                               ` Lars Magne Ingebrigtsen
  2010-09-02 16:21                               ` Stefan Monnier
  1 sibling, 0 replies; 42+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-02 14:44 UTC (permalink / raw)
  To: ding; +Cc: emacs-devel

Ted Zlatanov <tzz@lifelogs.com> writes:

> We want to do it with regex "\\(X\\)" against "userX@valid.domain" and
> target group "something-\\1-other".  Does that make sense?  Basically we
> want \1 but without the context of that original string we matched:
>
> (let ((regex "\\(alpha\\)")
>       (string "gamma alpha beta"))
>   (when (string-match regex string)
>     (our-new-function "found greek letter \\1")))
> -> "found greek letter alpha"

If you look at the low-level stuff that's actually saved by
`string-match' and friends, it's basically a list of start/end points,
and that's it, I think.

(progn (string-match "\\(alpha\\)" "gamma alpha beta")
       (match-data))
=> (6 11 6 11)

So when you say `(match-string 1)', it just uses the range 6-11 and does
a buffer-substring on that, or, if you give the latter function a string
parameter, then a substring on that.

So, for reasons of efficiency (I'm guessing), the actual substrings that
were matched aren't stored anywhere.

Now, the simplest change here would be if `string-match' and friends
also saved what it did the match on in addition to the current match
data.  Then things like

(replace-match "letter \\1" nil nil t)

would "remember" that we're referring to the string in question.  The
performance impact should be minimal -- just an extra `setq' on a global
C variable that would refer to the string we matched.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 13:10                             ` Ted Zlatanov
  2010-09-02 14:44                               ` Lars Magne Ingebrigtsen
@ 2010-09-02 16:21                               ` Stefan Monnier
  2010-09-02 16:45                                 ` David Kastrup
  2010-09-02 17:08                                 ` Ted Zlatanov
  1 sibling, 2 replies; 42+ messages in thread
From: Stefan Monnier @ 2010-09-02 16:21 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding, emacs-devel

> (let ((regex "\\(alpha\\)")
>       (string "gamma alpha beta"))
>   (when (string-match regex string)
>     (replace-match "[first greek letter \\1]" nil nil string 1)))
> -> "gamma [first greek letter alpha] beta"

> We want the equivalent but against any string, not just the original
> string (the `replace-match' docs say STRING has to be the one used for
> the original `string-match').  The use case is when you say to match X
> in an e-mail address, then set the target group to "something-X-other".
> We want to do it with regex "\\(X\\)" against "userX@valid.domain" and
> target group "something-\\1-other".  Does that make sense?  Basically we
> want \1 but without the context of that original string we matched:

I think I'm beginning to understand.
First, you don't want

  (replace-match "[first greek letter \\1]" nil nil string 1)
but
  (replace-match "[first greek letter \\1]" nil nil string)

then second, you do get the behavior you want in the particular case
where the string-match matched the whole string.
So to simulate:

> (let ((regex "\\(alpha\\)")
>       (string "gamma alpha beta"))
>   (when (string-match regex string)
>     (our-new-function "found greek letter \\1")))
> -> "found greek letter alpha"

you'd want:

   (let ((regex "\\(alpha\\)")
         (string "gamma alpha beta"))
     (when (string-match (concat "\\`.*?\\(?:" regex "\\).*\\'") string)
       (replace-match "found greek letter \\1" nil nil string)))

will do what you want, assuming your strings don't contain newlines, and
assuming that providing `string' is not a problem.
Of course, such string matching is a bit less optimized (and even less
so if you replace "." with "\\(?:.\\|\n\\)" to handle newlines), so it
might not be ideal.

We could implement this feature efficiently by generalizing the `subexp'
argument so that rather than subgroup-number it can also take a special
new value `whole-string' which means "not just the whole matched text,
but the whole freakin' string".  Then you could do:

   (let ((regex "\\(alpha\\)")
         (string "gamma alpha beta"))
     (when (string-match regex string)
       (replace-match "found greek letter \\1" nil nil string 'whole-string)))


-- Stefan



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 16:21                               ` Stefan Monnier
@ 2010-09-02 16:45                                 ` David Kastrup
  2010-09-02 17:08                                 ` Ted Zlatanov
  1 sibling, 0 replies; 42+ messages in thread
From: David Kastrup @ 2010-09-02 16:45 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> I think I'm beginning to understand.
> First, you don't want
>
>   (replace-match "[first greek letter \\1]" nil nil string 1)
> but
>   (replace-match "[first greek letter \\1]" nil nil string)
>
> then second, you do get the behavior you want in the particular case
> where the string-match matched the whole string.
> So to simulate:
>
>> (let ((regex "\\(alpha\\)")
>>       (string "gamma alpha beta"))
>>   (when (string-match regex string)
>>     (our-new-function "found greek letter \\1")))
>> -> "found greek letter alpha"
>
> you'd want:
>
>    (let ((regex "\\(alpha\\)")
>          (string "gamma alpha beta"))
>      (when (string-match (concat "\\`.*?\\(?:" regex "\\).*\\'") string)
>        (replace-match "found greek letter \\1" nil nil string)))

You mean like

(let ((regex "\\(alpha\\)")
      (string "gamma alpha beta"))
   (when (string-match regex string)
     (match-substitute-replacement "found greek letter \\1" nil nil string)))

-- 
David Kastrup




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 16:21                               ` Stefan Monnier
  2010-09-02 16:45                                 ` David Kastrup
@ 2010-09-02 17:08                                 ` Ted Zlatanov
  2010-09-02 17:22                                   ` David Kastrup
  1 sibling, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-02 17:08 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

On Thu, 02 Sep 2010 18:21:22 +0200 Stefan Monnier <monnier@iro.umontreal.ca> wrote: 

SM>    (let ((regex "\\(alpha\\)")
SM>          (string "gamma alpha beta"))
SM>      (when (string-match (concat "\\`.*?\\(?:" regex "\\).*\\'") string)
SM>        (replace-match "found greek letter \\1" nil nil string)))

SM> will do what you want, assuming your strings don't contain newlines, and
SM> assuming that providing `string' is not a problem.

SM> We could implement this feature efficiently by generalizing the `subexp'
SM> argument so that rather than subgroup-number it can also take a special
SM> new value `whole-string' which means "not just the whole matched text,
SM> but the whole freakin' string".  Then you could do:

SM>    (let ((regex "\\(alpha\\)")
SM>          (string "gamma alpha beta"))
SM>      (when (string-match regex string)
SM>        (replace-match "found greek letter \\1" nil nil string 'whole-string)))

That would be great.  Then we wouldn't have to play the string-match
regex escaping game above.  But it complicates the code a bit to provide
`string'.  I think Lars's suggestion to always save `string' to the same
global variable is sensible; then we could say

 (replace-match "found greek letter \\1" nil nil 'whole-last-string)

to mean "replace in the whole freakin' string you last matched on" :)

In a few tests your example worked great.  Lars, WDYT?

In general, it would be really nice if there was a
match-string/string-match/replace-match API variation that worked like
Perl's $1...$9 and Perl's named captures.  Those simply contain the
matched substring.  Putting a name on the capture is especially nice in
recent Perls, so you can refer to the captured data symbolically without
the fragile index.  But that's not necessary for the feature I'm
requesting so put it on the wishlist...

SM> Of course, such string matching is a bit less optimized (and even less
SM> so if you replace "." with "\\(?:.\\|\n\\)" to handle newlines), so it
SM> might not be ideal.

I think it will be used in non-performance-critical pieces so it's OK.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 17:08                                 ` Ted Zlatanov
@ 2010-09-02 17:22                                   ` David Kastrup
  2010-09-02 17:51                                     ` Ted Zlatanov
  2010-09-02 20:27                                     ` replace matches in any string Stefan Monnier
  0 siblings, 2 replies; 42+ messages in thread
From: David Kastrup @ 2010-09-02 17:22 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> SM> We could implement this feature efficiently by generalizing the `subexp'
> SM> argument so that rather than subgroup-number it can also take a special
> SM> new value `whole-string' which means "not just the whole matched text,
> SM> but the whole freakin' string".  Then you could do:
>
> SM>    (let ((regex "\\(alpha\\)")
> SM>          (string "gamma alpha beta"))
> SM>      (when (string-match regex string)
> SM>        (replace-match "found greek letter \\1" nil nil string 'whole-string)))
>
> That would be great.  Then we wouldn't have to play the string-match
> regex escaping game above.  But it complicates the code a bit to
> provide `string'.

Hardly.

> I think Lars's suggestion to always save `string' to the same global
> variable is sensible;

For one thing I guess it is too late to change the API.  For another,
that prevents strings from being garbage-collected as long as they are
present in some match-data.  While the same is true of buffers, a dead
buffer does not take significant space.

> then we could say
>
>  (replace-match "found greek letter \\1" nil nil 'whole-last-string)
>
> to mean "replace in the whole freakin' string you last matched on" :)
>
> In a few tests your example worked great.  Lars, WDYT?
>
> In general, it would be really nice if there was a
> match-string/string-match/replace-match API variation that worked like
> Perl's $1...$9 and Perl's named captures.  Those simply contain the
> matched substring.

What's wrong with match-substitute-replacement ?

-- 
David Kastrup




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 17:22                                   ` David Kastrup
@ 2010-09-02 17:51                                     ` Ted Zlatanov
  2010-09-02 18:04                                       ` David Kastrup
  2010-09-02 20:27                                     ` replace matches in any string Stefan Monnier
  1 sibling, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-02 17:51 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

On Thu, 02 Sep 2010 19:22:35 +0200 David Kastrup <dak@gnu.org> wrote: 

DK> Ted Zlatanov <tzz@lifelogs.com> writes:
>> That would be great.  Then we wouldn't have to play the string-match
>> regex escaping game above.  But it complicates the code a bit to
>> provide `string'.

DK> Hardly.

Is "a tiny bit" more accurate?  In any case,
`match-substitute-replacement' seems like the right function.  Thank
you.

>> I think Lars's suggestion to always save `string' to the same global
>> variable is sensible;

DK> For one thing I guess it is too late to change the API.

There's no change!  Saving the string is setting just one pointer
reference and does not change any existing code or APIs.

DK> For another, that prevents strings from being garbage-collected as
DK> long as they are present in some match-data.  While the same is true
DK> of buffers, a dead buffer does not take significant space.

Only one string would be kept around, not all the matches (I think
you're thinking of the tacked-on wishlist item below).

>> In general, it would be really nice if there was a
>> match-string/string-match/replace-match API variation that worked like
>> Perl's $1...$9 and Perl's named captures.  Those simply contain the
>> matched substring.

DK> What's wrong with match-substitute-replacement ?

It works for numeric capture offsets, thank you.  Named captures,
however, make regular expressions much easier to read and reuse.  Emacs,
being 25% regular expressions, would surely benefit from this.

We already have the `\(?NUM: ... \)' construct to explicitly set the
offset, so named captures could be as simple as `\(?'name': ... \)' or
some similar syntax.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-04-12 12:18               ` Daniel Dehennin
  2010-06-23 21:02                 ` Daniel Dehennin
@ 2010-09-02 17:59                 ` Ted Zlatanov
  2010-09-02 19:32                   ` Daniel Dehennin
  2010-09-02 19:50                   ` [PATCH] Permit the use of regular expression match and replace in posting styles Daniel Dehennin
  1 sibling, 2 replies; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-02 17:59 UTC (permalink / raw)
  To: ding

On Mon, 12 Apr 2010 14:18:20 +0200 Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote: 

DD> What do you thing about this:

DD> ;; I need the matched string because I found no way to get it from
DD> ;; (match-data)
DD> (defun my-expand (string matched &optional lowercase)
DD>   "Replace positional parameters with the text matched by groups in the
DD> <matched> string.
DD> If the optional lowercase parameter is set, the matched text by groups
DD> is forced to lowercase."

Daniel, can you try match-substitute-replacement in your code?  It was
introduced in 2007 after Emacs 22 was released, and I don't know if
XEmacs supports it.  So even if it does what we need, we may need to
fall back on our own copy of it.  Argh...  At least it's not terribly
complicated, see subr.el:

(defun match-substitute-replacement (replacement
				     &optional fixedcase literal string subexp)
  "Return REPLACEMENT as it will be inserted by `replace-match'.
In other words, all back-references in the form `\\&' and `\\N'
are substituted with actual strings matched by the last search.
Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the same
meaning as for `replace-match'."
  (let ((match (match-string 0 string)))
    (save-match-data
      (set-match-data (mapcar (lambda (x)
				(if (numberp x)
				    (- x (match-beginning 0))
				  x))
			      (match-data t)))
      (replace-match replacement fixedcase literal match subexp))))

Thanks for your patience.  This topic may evolve and I'm sorry it's
taken so long.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 17:51                                     ` Ted Zlatanov
@ 2010-09-02 18:04                                       ` David Kastrup
  2010-09-02 19:12                                         ` Ted Zlatanov
  0 siblings, 1 reply; 42+ messages in thread
From: David Kastrup @ 2010-09-02 18:04 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 02 Sep 2010 19:22:35 +0200 David Kastrup <dak@gnu.org> wrote: 
>
> DK> Ted Zlatanov <tzz@lifelogs.com> writes:
>>> That would be great.  Then we wouldn't have to play the string-match
>>> regex escaping game above.  But it complicates the code a bit to
>>> provide `string'.
>
> DK> Hardly.
>
> Is "a tiny bit" more accurate?  In any case,
> `match-substitute-replacement' seems like the right function.  Thank
> you.
>
>>> I think Lars's suggestion to always save `string' to the same global
>>> variable is sensible;
>
> DK> For one thing I guess it is too late to change the API.
>
> There's no change!  Saving the string is setting just one pointer
> reference and does not change any existing code or APIs.

A function using save-match-data may be used in any hook or other stuff
called nearly asynchronously.  It is a very bad idea to add some global
variable to the match data (which is everything that affects matching)
without making save-match-data, match-data and set-match-data involved.

> DK> For another, that prevents strings from being garbage-collected as
> DK> long as they are present in some match-data.  While the same is true
> DK> of buffers, a dead buffer does not take significant space.
>
> Only one string would be kept around, not all the matches (I think
> you're thinking of the tacked-on wishlist item below).

Huh?  Of course only one string would be kept around, the source string
on which the match was made.  And that is at least as long as all
matches combined (at least when the matches are not inside one another).

-- 
David Kastrup




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 18:04                                       ` David Kastrup
@ 2010-09-02 19:12                                         ` Ted Zlatanov
       [not found]                                           ` <8739tsosyg.fsf_-_@maguirefamily.org>
  0 siblings, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-02 19:12 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

On Thu, 02 Sep 2010 20:04:39 +0200 David Kastrup <dak@gnu.org> wrote: 

DK> Ted Zlatanov <tzz@lifelogs.com> writes:
DK> For one thing I guess it is too late to change the API.
>> 
>> There's no change!  Saving the string is setting just one pointer
>> reference and does not change any existing code or APIs.

DK> A function using save-match-data may be used in any hook or other stuff
DK> called nearly asynchronously.  It is a very bad idea to add some global
DK> variable to the match data (which is everything that affects matching)
DK> without making save-match-data, match-data and set-match-data involved.

I understand.  So it has to be local to the match data if introduced at
all.  Thanks for your explanation.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Use replace-match in posting-style.
  2010-09-02 17:59                 ` Ted Zlatanov
@ 2010-09-02 19:32                   ` Daniel Dehennin
  2010-09-02 19:50                   ` [PATCH] Permit the use of regular expression match and replace in posting styles Daniel Dehennin
  1 sibling, 0 replies; 42+ messages in thread
From: Daniel Dehennin @ 2010-09-02 19:32 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

Ted Zlatanov <tzz@lifelogs.com> writes:

> Daniel, can you try match-substitute-replacement in your code?  It was
> introduced in 2007 after Emacs 22 was released, and I don't know if
> XEmacs supports it.  So even if it does what we need, we may need to
> fall back on our own copy of it.  Argh...  At least it's not terribly
> complicated, see subr.el:

It seems that it's not available in XEmacs[1]


[...]

> Thanks for your patience.  This topic may evolve and I'm sorry it's
> taken so long.


I made a new patch.

Footnotes: 
[1]  http://hg.debian.org/hg/xemacs/xemacs/file/b5611afbcc76/lisp/subr.el

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1


[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH] Permit the use of regular expression match and replace in posting styles.
  2010-09-02 17:59                 ` Ted Zlatanov
  2010-09-02 19:32                   ` Daniel Dehennin
@ 2010-09-02 19:50                   ` Daniel Dehennin
  2010-09-02 21:56                     ` Ted Zlatanov
  1 sibling, 1 reply; 42+ messages in thread
From: Daniel Dehennin @ 2010-09-02 19:50 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]


* lisp/gnus-msg.el (gnus-configure-posting-styles): Use
  match-substitute-replacement to replace positional parameters in
  attributes.
---
 lisp/gnus-msg.el |    6 +++++-
 texi/gnus.texi   |   22 ++++++++++++++--------
 2 files changed, 19 insertions(+), 9 deletions(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Permit-the-use-of-regular-expression-match-and-repla.patch --]
[-- Type: text/x-patch; name="0001-Permit-the-use-of-regular-expression-match-and-repla.patch", Size: 2260 bytes --]

diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el
index a2a2652..b44942b 100644
--- a/lisp/gnus-msg.el
+++ b/lisp/gnus-msg.el
@@ -1890,7 +1890,11 @@ this is a reply."
 	    (setq v
 		  (cond
 		   ((stringp value)
-		    value)
+		    (if (and (stringp match)
+			     (string-match-p "\\\\[&[:digit:]]" value)
+			     (match-beginning 1))
+			(match-substitute-replacement value nil nil group)
+		      value))
 		   ((or (symbolp value)
 			(functionp value))
 		    (cond ((functionp value)
diff --git a/texi/gnus.texi b/texi/gnus.texi
index 688d56f..b1ce15e 100644
--- a/texi/gnus.texi
+++ b/texi/gnus.texi
@@ -13459,14 +13459,20 @@ the headers of the article; if the value is @code{nil}, the header
 name will be removed.  If the attribute name is @code{eval}, the form
 is evaluated, and the result is thrown away.
 
-The attribute value can be a string (used verbatim), a function with
-zero arguments (the return value will be used), a variable (its value
-will be used) or a list (it will be @code{eval}ed and the return value
-will be used).  The functions and sexps are called/@code{eval}ed in the
-message buffer that is being set up.  The headers of the current article
-are available through the @code{message-reply-headers} variable, which
-is a vector of the following headers: number subject from date id
-references chars lines xref extra.
+The attribute value can be a string, a function with zero arguments
+(the return value will be used), a variable (its value will be used)
+or a list (it will be @code{eval}ed and the return value will be
+used).  The functions and sexps are called/@code{eval}ed in the
+message buffer that is being set up.  The headers of the current
+article are available through the @code{message-reply-headers}
+variable, which is a vector of the following headers: number subject
+from date id references chars lines xref extra.
+
+In the case of a string value, if the @code{match} is a regular
+expression, a @samp{match-substitute-replacement} is proceed on the
+value to replace the positional parameters @samp{\@var{n}} by the
+corresponding parenthetical matches (see @xref{Replacing the Text that
+Matched, , Text Replacement, elisp, The Emacs Lisp Reference Manual}.)
 
 @vindex message-reply-headers
 

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 17:22                                   ` David Kastrup
  2010-09-02 17:51                                     ` Ted Zlatanov
@ 2010-09-02 20:27                                     ` Stefan Monnier
  2010-09-02 22:18                                       ` Lars Magne Ingebrigtsen
  2010-09-03  5:33                                       ` David Kastrup
  1 sibling, 2 replies; 42+ messages in thread
From: Stefan Monnier @ 2010-09-02 20:27 UTC (permalink / raw)
  To: David Kastrup; +Cc: ding, emacs-devel

> For one thing I guess it is too late to change the API.  For another,
> that prevents strings from being garbage-collected as long as they are
> present in some match-data.  While the same is true of buffers, a dead
> buffer does not take significant space.

We already save the matched object if it's a buffer, and no, the
potential "space leak" is not a significant problem.

> What's wrong with match-substitute-replacement ?

Indeed, I had forgotten about it.


        Stefan



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: Recommended gnus spam filter system?
       [not found]                                           ` <8739tsosyg.fsf_-_@maguirefamily.org>
@ 2010-09-02 21:52                                             ` Ted Zlatanov
  0 siblings, 0 replies; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-02 21:52 UTC (permalink / raw)
  To: ding; +Cc: Camm Maguire, Karl Fogel

On Thu, 02 Sep 2010 15:17:59 -0400 Camm Maguire <camm@maguirefamily.org> wrote: 

CM> Greetings!  What is the preferred method of dealing with spam under
CM> gnus?  I.e. what are most people using with satisfaction?

You can use the Ding Mailing List <ding@gnus.org> or the gnu.emacs.gnus
newsgroup for Gnus questions.  I've redirected this thread there.

There's a manual section covering spam fighting and I know spam.el,
which I mostly wrote and maintain, is used by many users.  It's not the
only solution though.

On Thu, 02 Sep 2010 16:38:24 -0400 Karl Fogel <kfogel@red-bean.com> wrote: 

KF> To answer your question: I think spam filtering is generally considered
KF> outside the purview of Gnus.  Spam filtering is computationally
KF> expensive and most people do it before the mails hit their mail client
KF> (e.g., they do it on the server), or at least with a separate program.
KF> I am not aware of any spam filtering software for Emacs in general, let
KF> alone for Gnus.

spam.el can do server-side or client-side filtering.  On the client side
you can use spam-stat.el for an entire ELisp solution (either within
spam.el or by itself).  I personally do server-side CRM114.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Permit the use of regular expression match and replace in posting styles.
  2010-09-02 19:50                   ` [PATCH] Permit the use of regular expression match and replace in posting styles Daniel Dehennin
@ 2010-09-02 21:56                     ` Ted Zlatanov
  2010-09-04 22:47                       ` Mike Kupfer
  0 siblings, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-02 21:56 UTC (permalink / raw)
  To: ding

On Thu,  2 Sep 2010 21:50:50 +0200 Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote: 

DD> * lisp/gnus-msg.el (gnus-configure-posting-styles): Use
DD>   match-substitute-replacement to replace positional parameters in
DD>   attributes.

Is there an XEmacs user that can help with the cloning and testing
`match-substitute-replacement' when it's not available in ELisp?  It
should be pretty easy; we already do such cloning in a few places.  See
my previous e-mail: this is a tiny function.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 20:27                                     ` replace matches in any string Stefan Monnier
@ 2010-09-02 22:18                                       ` Lars Magne Ingebrigtsen
  2010-09-03  5:33                                       ` David Kastrup
  1 sibling, 0 replies; 42+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-02 22:18 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> For one thing I guess it is too late to change the API.  For another,
>> that prevents strings from being garbage-collected as long as they are
>> present in some match-data.  While the same is true of buffers, a dead
>> buffer does not take significant space.
>
> We already save the matched object if it's a buffer, and no, the
> potential "space leak" is not a significant problem.

It's one string per match data, so it's not significant.

>> What's wrong with match-substitute-replacement ?
>
> Indeed, I had forgotten about it.

Oh, that exists?  Never mind, then.  :-)  So you already save all the
matched substrings in case somebody calls a the function
`match-substitute-replacement', which nobody has heard of (there's one
(1) use of the function in question in the Emacs sources...

Hang on.  This is the definition:

(defun match-substitute-replacement (replacement
				     &optional fixedcase literal string subexp)
  "Return REPLACEMENT as it will be inserted by `replace-match'.
In other words, all back-references in the form `\\&' and `\\N'
are substituted with actual strings matched by the last search.
Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the same
meaning as for `replace-match'."
  (let ((match (match-string 0 string)))
    (save-match-data
      (set-match-data (mapcar (lambda (x)
				(if (numberp x)
				    (- x (match-beginning 0))
				  x))
			      (match-data t)))
      (replace-match replacement fixedcase literal match subexp))))

This doesn't help at all.

The use case is that you had some string do a match, but you don't have
access to the string variable.  You just want the matches that you know
were made, aka perlish $1, $2, $3.  I reiterate my first posting on this
issue as a feature request.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-02 20:27                                     ` replace matches in any string Stefan Monnier
  2010-09-02 22:18                                       ` Lars Magne Ingebrigtsen
@ 2010-09-03  5:33                                       ` David Kastrup
  2010-09-03 17:06                                         ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 42+ messages in thread
From: David Kastrup @ 2010-09-03  5:33 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> For one thing I guess it is too late to change the API.  For another,
>> that prevents strings from being garbage-collected as long as they are
>> present in some match-data.  While the same is true of buffers, a dead
>> buffer does not take significant space.
>
> We already save the matched object if it's a buffer,

What about my last sentence before yours did you not understand?

-- 
David Kastrup




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: replace matches in any string
  2010-09-03  5:33                                       ` David Kastrup
@ 2010-09-03 17:06                                         ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 42+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-03 17:06 UTC (permalink / raw)
  To: emacs-devel; +Cc: ding

David Kastrup <dak@gnu.org> writes:

>>> For one thing I guess it is too late to change the API.  For another,
>>> that prevents strings from being garbage-collected as long as they are
>>> present in some match-data.  While the same is true of buffers, a dead
>>> buffer does not take significant space.
>>
>> We already save the matched object if it's a buffer,
>
> What about my last sentence before yours did you not understand?

I didn't understand the bit where you seem to imply that saving a
reference to one (1) string would take significant space.  (Unless, of
course, you're using a `save-match-data', where you'd save one (1)
string extra per nesting.  I think.)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Permit the use of regular expression match and replace in posting styles.
  2010-09-02 21:56                     ` Ted Zlatanov
@ 2010-09-04 22:47                       ` Mike Kupfer
  2010-09-05  2:36                         ` Ted Zlatanov
  0 siblings, 1 reply; 42+ messages in thread
From: Mike Kupfer @ 2010-09-04 22:47 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

Ted Zlatanov wrote:

> On Thu,  2 Sep 2010 21:50:50 +0200 Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote: 
> 
> DD> * lisp/gnus-msg.el (gnus-configure-posting-styles): Use
> DD>   match-substitute-replacement to replace positional parameters in
> DD>   attributes.
> 
> Is there an XEmacs user that can help with the cloning and testing
> `match-substitute-replacement' when it's not available in ELisp?  It
> should be pretty easy; we already do such cloning in a few places.  See
> my previous e-mail: this is a tiny function.

If you haven't already gotten a volunteer, I guess I can help.  But I'm
unclear on what sort of testing you'd like.

cheers,
mike



^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Permit the use of regular expression match and replace in posting styles.
  2010-09-04 22:47                       ` Mike Kupfer
@ 2010-09-05  2:36                         ` Ted Zlatanov
  2010-09-06 22:43                           ` Mike Kupfer
  0 siblings, 1 reply; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-05  2:36 UTC (permalink / raw)
  To: ding

On Sat, 04 Sep 2010 15:47:58 -0700 Mike Kupfer <mike.kupfer@xemacs.org> wrote: 

MK> Ted Zlatanov wrote:
>> On Thu,  2 Sep 2010 21:50:50 +0200 Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote: 
>> 
DD> * lisp/gnus-msg.el (gnus-configure-posting-styles): Use
DD> match-substitute-replacement to replace positional parameters in
DD> attributes.
>> 
>> Is there an XEmacs user that can help with the cloning and testing
>> `match-substitute-replacement' when it's not available in ELisp?  It
>> should be pretty easy; we already do such cloning in a few places.  See
>> my previous e-mail: this is a tiny function.

MK> If you haven't already gotten a volunteer, I guess I can help.  But I'm
MK> unclear on what sort of testing you'd like.

We need you to find out how to make `match-substitute-replacement' work
in XEmacs, basically.  If you need to copy what it does (the full
function was posted already) that's fine, but it's better if we can use
XEmacs's builtins.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Permit the use of regular expression match and replace in posting styles.
  2010-09-05  2:36                         ` Ted Zlatanov
@ 2010-09-06 22:43                           ` Mike Kupfer
  2010-09-06 23:18                             ` Ted Zlatanov
  0 siblings, 1 reply; 42+ messages in thread
From: Mike Kupfer @ 2010-09-06 22:43 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

Ted Zlatanov wrote:

> We need you to find out how to make `match-substitute-replacement' work
> in XEmacs, basically.  If you need to copy what it does (the full
> function was posted already) that's fine, but it's better if we can use
> XEmacs's builtins.

Okay.  XEmacs can't currently use the given implementation because it's
GPLv3, and XEmacs hasn't yet made the move to GPLv3.  (There has been
work in this area, but it's not quite done.)  But that also means that
XEmacs can't ship new versions of Gnus, because they, too, are GPLv3.

One suggestion that I got was for someone to reimplement
match-substitute-replacement from scratch (i.e., just working from the
documentation).  But AFAICT, XEmacs's string-matching functions are
pretty much the same as Emacs's, so we'd probably end up with something
that looks a lot like the implementation that you posted.  And frankly,
my Lisp skills are such that I'm reluctant to tackle this.

In the short term, I suppose that you could include
match-substitute-replacement with Gnus itself.  That would presumably
satisfy XEmacs users who get Gnus directly from gnus.org.  I did some
light testing, and it looks like match-substitute-replacement will just
work on XEmacs.  How does that sound?

mike




^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH] Permit the use of regular expression match and replace in posting styles.
  2010-09-06 22:43                           ` Mike Kupfer
@ 2010-09-06 23:18                             ` Ted Zlatanov
  0 siblings, 0 replies; 42+ messages in thread
From: Ted Zlatanov @ 2010-09-06 23:18 UTC (permalink / raw)
  To: ding

On Mon, 06 Sep 2010 15:43:14 -0700 Mike Kupfer <mike.kupfer@xemacs.org> wrote: 

MK> Ted Zlatanov wrote:
>> We need you to find out how to make `match-substitute-replacement' work
>> in XEmacs, basically.  If you need to copy what it does (the full
>> function was posted already) that's fine, but it's better if we can use
>> XEmacs's builtins.
...
MK> In the short term, I suppose that you could include
MK> match-substitute-replacement with Gnus itself.  That would presumably
MK> satisfy XEmacs users who get Gnus directly from gnus.org.  I did some
MK> light testing, and it looks like match-substitute-replacement will just
MK> work on XEmacs.  How does that sound?

That sounds fine.  It's OK to implement such functions inside Gnus when
the Emacs we're using doesn't support it.

Ted




^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2010-09-06 23:18 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-07 21:15 [PATCH] Use replace-match in posting-style Daniel Dehennin
2009-07-08 18:51 ` Ted Zlatanov
2010-04-10  9:57   ` Daniel Dehennin
2010-04-10 19:10     ` Johan Bockgård
2010-04-10 23:22       ` Daniel Dehennin
2010-04-11 13:13         ` Andreas Schwab
2010-04-11 14:04           ` Daniel Dehennin
2010-04-11 15:06             ` Andreas Schwab
2010-04-12 12:18               ` Daniel Dehennin
2010-06-23 21:02                 ` Daniel Dehennin
2010-07-08 13:57                   ` Ted Zlatanov
2010-07-12 19:43                     ` Daniel Dehennin
2010-07-30 17:43                       ` replace matches in any string (was: [PATCH] Use replace-match in posting-style.) Ted Zlatanov
2010-09-01 13:55                         ` replace matches in any string Ted Zlatanov
2010-09-02 11:29                           ` Stefan Monnier
2010-09-02 13:10                             ` Ted Zlatanov
2010-09-02 14:44                               ` Lars Magne Ingebrigtsen
2010-09-02 16:21                               ` Stefan Monnier
2010-09-02 16:45                                 ` David Kastrup
2010-09-02 17:08                                 ` Ted Zlatanov
2010-09-02 17:22                                   ` David Kastrup
2010-09-02 17:51                                     ` Ted Zlatanov
2010-09-02 18:04                                       ` David Kastrup
2010-09-02 19:12                                         ` Ted Zlatanov
     [not found]                                           ` <8739tsosyg.fsf_-_@maguirefamily.org>
2010-09-02 21:52                                             ` Recommended gnus spam filter system? Ted Zlatanov
2010-09-02 20:27                                     ` replace matches in any string Stefan Monnier
2010-09-02 22:18                                       ` Lars Magne Ingebrigtsen
2010-09-03  5:33                                       ` David Kastrup
2010-09-03 17:06                                         ` Lars Magne Ingebrigtsen
2010-08-29 20:07                   ` [PATCH] Use replace-match in posting-style Lars Magne Ingebrigtsen
2010-08-30 13:41                     ` Ted Zlatanov
2010-08-30 17:11                       ` Lars Magne Ingebrigtsen
2010-08-31 18:42                         ` Ted Zlatanov
2010-08-31 18:47                           ` Lars Magne Ingebrigtsen
2010-09-02 17:59                 ` Ted Zlatanov
2010-09-02 19:32                   ` Daniel Dehennin
2010-09-02 19:50                   ` [PATCH] Permit the use of regular expression match and replace in posting styles Daniel Dehennin
2010-09-02 21:56                     ` Ted Zlatanov
2010-09-04 22:47                       ` Mike Kupfer
2010-09-05  2:36                         ` Ted Zlatanov
2010-09-06 22:43                           ` Mike Kupfer
2010-09-06 23:18                             ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).