summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/ChangeLog3
-rw-r--r--lisp/gnus/gnus.el13
2 files changed, 10 insertions, 6 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 5867a5c0bc9..8859ce8c4ad 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -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.
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 12215dee702..b62bf051c5d 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -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."