]> git.eshelyaron.com Git - emacs.git/commitdiff
gnus.el (gnus-expand-group-parameter): Only return and act on what was matched.
authorJulien Danjou <julien@danjou.info>
Fri, 8 Oct 2010 12:16:05 +0000 (12:16 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 8 Oct 2010 12:16:05 +0000 (12:16 +0000)
lisp/gnus/ChangeLog
lisp/gnus/gnus.el

index 5867a5c0bc9cc295ba4709b488471b0c3644158b..8859ce8c4ad50c4d68f71bbbbe339a3a9cb84d1d 100644 (file)
@@ -81,6 +81,9 @@
 
 2010-10-06  Julien Danjou  <julien@danjou.info>
 
+       * 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.
index 12215dee702a43af01abcbcffb7b594ff7805f36..b62bf051c5d5e8940ed119f34b69dbabacf3ce44 100644 (file)
@@ -3815,12 +3815,13 @@ You should probably use `gnus-find-method-for-group' instead."
 
 (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."