emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101850: gnus.el (gnus-expand-group-p


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101850: gnus.el (gnus-expand-group-parameter): Only return and act on what was matched.
Date: Fri, 08 Oct 2010 12:16:05 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101850
author: Julien Danjou <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Fri 2010-10-08 12:16:05 +0000
message:
  gnus.el (gnus-expand-group-parameter): Only return and act on what was 
matched.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2010-10-08 07:35:21 +0000
+++ b/lisp/gnus/ChangeLog       2010-10-08 12:16:05 +0000
@@ -81,6 +81,9 @@
 
 2010-10-06  Julien Danjou  <address@hidden>
 
+       * gnus.el (gnus-expand-group-parameter): Only return and act on what
+       was matched.
+
        * sieve-manage.el: Update example in `Commentary'.
 
        * sieve.el (sieve-open-server): Use sieve-manage-authenticate.

=== modified file 'lisp/gnus/gnus.el'
--- a/lisp/gnus/gnus.el 2010-10-07 22:26:11 +0000
+++ b/lisp/gnus/gnus.el 2010-10-08 12:16:05 +0000
@@ -3815,12 +3815,13 @@
 
 (defun gnus-expand-group-parameter (match value group)
   "Use MATCH to expand VALUE in GROUP."
-  (with-temp-buffer
-    (insert group)
-    (goto-char (point-min))
-    (while (re-search-forward match nil t)
-      (replace-match value))
-    (buffer-string)))
+  (let ((start (string-match match group)))
+    (if start
+        (let ((matched-string (substring group start (match-end 0))))
+          ;; Build match groups
+          (string-match match matched-string)
+          (replace-match value nil nil matched-string))
+      group)))
 
 (defun gnus-expand-group-parameters (match parameters group)
   "Go through PARAMETERS and expand them according to the match data."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]