summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus.el
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2010-10-08 12:16:05 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-10-08 12:16:05 +0000
commitd2abc29aeba15149bc12219c5e43d6a98ff4acdb (patch)
tree4a3a3c5d0776375ec0ac4fc29c8444e8491b9ed3 /lisp/gnus/gnus.el
parent4628bef1eea0f60e846fe6b6591725aa92952de9 (diff)
downloademacs-d2abc29aeba15149bc12219c5e43d6a98ff4acdb.tar.gz
gnus.el (gnus-expand-group-parameter): Only return and act on what was matched.
Diffstat (limited to 'lisp/gnus/gnus.el')
-rw-r--r--lisp/gnus/gnus.el13
1 files changed, 7 insertions, 6 deletions
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."