diff options
| author | Tassilo Horn | 2014-07-31 13:11:41 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2014-07-31 13:11:41 +0000 |
| commit | def546a8b82f60478c780bf3cbdbceedcf7a2ccd (patch) | |
| tree | df57cac397f55ed6ceaa4af2540e7f6985a074a8 | |
| parent | 21a7129a0b8a5c2a38c0c1b3e02b0e3f813cfa7e (diff) | |
| download | emacs-def546a8b82f60478c780bf3cbdbceedcf7a2ccd.tar.gz emacs-def546a8b82f60478c780bf3cbdbceedcf7a2ccd.zip | |
[Gnus] Allow list-valued gcc-self group params
* lisp/gnus/gnus-msg.el (gnus-inews-insert-gcc):
Allow `gcc-self' to be a list of groups and t.
* doc/misc/gnus.texi (Group Parameters):
Document that `gcc-self' may also be a list.
| -rw-r--r-- | doc/misc/gnus.texi | 15 | ||||
| -rw-r--r-- | lisp/gnus/gnus-msg.el | 33 |
2 files changed, 29 insertions, 19 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 80c1cc2ef03..a25d7c540f3 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -2880,12 +2880,17 @@ news group. | |||
| 2880 | @item gcc-self | 2880 | @item gcc-self |
| 2881 | @cindex gcc-self | 2881 | @cindex gcc-self |
| 2882 | If @code{(gcc-self . t)} is present in the group parameter list, newly | 2882 | If @code{(gcc-self . t)} is present in the group parameter list, newly |
| 2883 | composed messages will be @code{Gcc}'d to the current group. If | 2883 | composed messages will be @code{gcc}d to the current group. If |
| 2884 | @code{(gcc-self . none)} is present, no @code{Gcc:} header will be | 2884 | @code{(gcc-self . none)} is present, no @code{Gcc:} header will be |
| 2885 | generated, if @code{(gcc-self . "string")} is present, this string will | 2885 | generated, if @code{(gcc-self . "group")} is present, this string will |
| 2886 | be inserted literally as a @code{gcc} header. This parameter takes | 2886 | be inserted literally as a @code{Gcc:} header. It should be a group |
| 2887 | precedence over any default @code{Gcc} rules as described later | 2887 | name. The @code{gcc-self} value may also be a list of strings and |
| 2888 | (@pxref{Archived Messages}), with the exception for messages to resend. | 2888 | @code{t}, e.g., @code{(gcc-self "group1" "group2" t)} means to |
| 2889 | @code{gcc} the newly composed message into the groups @code{"group1"} | ||
| 2890 | and @code{"group2"}, and into the current group. The @code{gcc-self} | ||
| 2891 | parameter takes precedence over any default @code{Gcc} rules as | ||
| 2892 | described later (@pxref{Archived Messages}), with the exception for | ||
| 2893 | messages to resend. | ||
| 2889 | 2894 | ||
| 2890 | @strong{Caveat}: Adding @code{(gcc-self . t)} to the parameter list of | 2895 | @strong{Caveat}: Adding @code{(gcc-self . t)} to the parameter list of |
| 2891 | @code{nntp} groups (or the like) isn't valid. An @code{nntp} server | 2896 | @code{nntp} groups (or the like) isn't valid. An @code{nntp} server |
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 469b9d2cf81..8b9842918da 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el | |||
| @@ -1726,7 +1726,20 @@ this is a reply." | |||
| 1726 | (var (or gnus-outgoing-message-group gnus-message-archive-group)) | 1726 | (var (or gnus-outgoing-message-group gnus-message-archive-group)) |
| 1727 | (gcc-self-val | 1727 | (gcc-self-val |
| 1728 | (and group (not (gnus-virtual-group-p group)) | 1728 | (and group (not (gnus-virtual-group-p group)) |
| 1729 | (gnus-group-find-parameter group 'gcc-self))) | 1729 | (gnus-group-find-parameter group 'gcc-self t))) |
| 1730 | (gcc-self-get (lambda (gcc-self-val group) | ||
| 1731 | (if (stringp gcc-self-val) | ||
| 1732 | (if (string-match " " gcc-self-val) | ||
| 1733 | (concat "\"" gcc-self-val "\"") | ||
| 1734 | gcc-self-val) | ||
| 1735 | ;; In nndoc groups, we use the parent group name | ||
| 1736 | ;; instead of the current group. | ||
| 1737 | (let ((group (or (gnus-group-find-parameter | ||
| 1738 | gnus-newsgroup-name 'parent-group) | ||
| 1739 | group))) | ||
| 1740 | (if (string-match " " group) | ||
| 1741 | (concat "\"" group "\"") | ||
| 1742 | group))))) | ||
| 1730 | result | 1743 | result |
| 1731 | (groups | 1744 | (groups |
| 1732 | (cond | 1745 | (cond |
| @@ -1777,19 +1790,11 @@ this is a reply." | |||
| 1777 | (if gcc-self-val | 1790 | (if gcc-self-val |
| 1778 | ;; Use the `gcc-self' param value instead. | 1791 | ;; Use the `gcc-self' param value instead. |
| 1779 | (progn | 1792 | (progn |
| 1780 | (insert | 1793 | (insert (if (listp gcc-self-val) |
| 1781 | (if (stringp gcc-self-val) | 1794 | (mapconcat (lambda (val) |
| 1782 | (if (string-match " " gcc-self-val) | 1795 | (funcall gcc-self-get val group)) |
| 1783 | (concat "\"" gcc-self-val "\"") | 1796 | gcc-self-val ", ") |
| 1784 | gcc-self-val) | 1797 | (funcall gcc-self-get gcc-self-val group))) |
| 1785 | ;; In nndoc groups, we use the parent group name | ||
| 1786 | ;; instead of the current group. | ||
| 1787 | (let ((group (or (gnus-group-find-parameter | ||
| 1788 | gnus-newsgroup-name 'parent-group) | ||
| 1789 | group))) | ||
| 1790 | (if (string-match " " group) | ||
| 1791 | (concat "\"" group "\"") | ||
| 1792 | group)))) | ||
| 1793 | (if (not (eq gcc-self-val 'none)) | 1798 | (if (not (eq gcc-self-val 'none)) |
| 1794 | (insert "\n") | 1799 | (insert "\n") |
| 1795 | (gnus-delete-line))) | 1800 | (gnus-delete-line))) |