gnus.el (gnus-expand-group-parameter): Only return and act on what was matched.

This commit is contained in:
Julien Danjou 2010-10-08 12:16:05 +00:00 committed by Katsumi Yamaoka
parent 4628bef1ee
commit d2abc29aeb
2 changed files with 10 additions and 6 deletions

View 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.

View 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."