diff options
| author | Julien Danjou | 2010-10-08 12:16:05 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-10-08 12:16:05 +0000 |
| commit | d2abc29aeba15149bc12219c5e43d6a98ff4acdb (patch) | |
| tree | 4a3a3c5d0776375ec0ac4fc29c8444e8491b9ed3 | |
| parent | 4628bef1eea0f60e846fe6b6591725aa92952de9 (diff) | |
| download | emacs-d2abc29aeba15149bc12219c5e43d6a98ff4acdb.tar.gz emacs-d2abc29aeba15149bc12219c5e43d6a98ff4acdb.zip | |
gnus.el (gnus-expand-group-parameter): Only return and act on what was matched.
| -rw-r--r-- | lisp/gnus/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/gnus/gnus.el | 13 |
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 @@ | |||
| 81 | 81 | ||
| 82 | 2010-10-06 Julien Danjou <julien@danjou.info> | 82 | 2010-10-06 Julien Danjou <julien@danjou.info> |
| 83 | 83 | ||
| 84 | * gnus.el (gnus-expand-group-parameter): Only return and act on what | ||
| 85 | was matched. | ||
| 86 | |||
| 84 | * sieve-manage.el: Update example in `Commentary'. | 87 | * sieve-manage.el: Update example in `Commentary'. |
| 85 | 88 | ||
| 86 | * sieve.el (sieve-open-server): Use sieve-manage-authenticate. | 89 | * 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." | |||
| 3815 | 3815 | ||
| 3816 | (defun gnus-expand-group-parameter (match value group) | 3816 | (defun gnus-expand-group-parameter (match value group) |
| 3817 | "Use MATCH to expand VALUE in GROUP." | 3817 | "Use MATCH to expand VALUE in GROUP." |
| 3818 | (with-temp-buffer | 3818 | (let ((start (string-match match group))) |
| 3819 | (insert group) | 3819 | (if start |
| 3820 | (goto-char (point-min)) | 3820 | (let ((matched-string (substring group start (match-end 0)))) |
| 3821 | (while (re-search-forward match nil t) | 3821 | ;; Build match groups |
| 3822 | (replace-match value)) | 3822 | (string-match match matched-string) |
| 3823 | (buffer-string))) | 3823 | (replace-match value nil nil matched-string)) |
| 3824 | group))) | ||
| 3824 | 3825 | ||
| 3825 | (defun gnus-expand-group-parameters (match parameters group) | 3826 | (defun gnus-expand-group-parameters (match parameters group) |
| 3826 | "Go through PARAMETERS and expand them according to the match data." | 3827 | "Go through PARAMETERS and expand them according to the match data." |