diff options
author | Julien Danjou <julien@danjou.info> | 2010-10-08 12:16:05 +0000 |
---|---|---|
committer | Katsumi Yamaoka <yamaoka@jpl.org> | 2010-10-08 12:16:05 +0000 |
commit | d2abc29aeba15149bc12219c5e43d6a98ff4acdb (patch) | |
tree | 4a3a3c5d0776375ec0ac4fc29c8444e8491b9ed3 /lisp/gnus/gnus.el | |
parent | 4628bef1eea0f60e846fe6b6591725aa92952de9 (diff) | |
download | emacs-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.el | 13 |
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." |