emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117614: [Gnus] Allow list-valued gcc-self group par


From: Katsumi Yamaoka
Subject: [Emacs-diffs] trunk r117614: [Gnus] Allow list-valued gcc-self group params
Date: Thu, 31 Jul 2014 13:12:12 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117614
revision-id: address@hidden
parent: address@hidden
author: Tassilo Horn <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Thu 2014-07-31 13:11:41 +0000
message:
  [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.
modified:
  doc/misc/gnus.texi             gnus.texi-20091113204419-o5vbwnq5f7feedwu-6305
  lisp/gnus/gnus-msg.el          gnusmsg.el-20091113204419-o5vbwnq5f7feedwu-1127
=== modified file 'doc/misc/gnus.texi'
--- a/doc/misc/gnus.texi        2014-07-18 08:23:49 +0000
+++ b/doc/misc/gnus.texi        2014-07-31 13:11:41 +0000
@@ -2880,12 +2880,17 @@
 @item gcc-self
 @cindex gcc-self
 If @code{(gcc-self . t)} is present in the group parameter list, newly
-composed messages will be @code{Gcc}'d to the current group.  If
+composed messages will be @code{gcc}d to the current group.  If
 @code{(gcc-self . none)} is present, no @code{Gcc:} header will be
-generated, if @code{(gcc-self . "string")} is present, this string will
-be inserted literally as a @code{gcc} header.  This parameter takes
-precedence over any default @code{Gcc} rules as described later
-(@pxref{Archived Messages}), with the exception for messages to resend.
+generated, if @code{(gcc-self . "group")} is present, this string will
+be inserted literally as a @code{Gcc:} header.  It should be a group
+name.  The @code{gcc-self} value may also be a list of strings and
address@hidden, e.g., @code{(gcc-self "group1" "group2" t)} means to
address@hidden the newly composed message into the groups @code{"group1"}
+and @code{"group2"}, and into the current group.  The @code{gcc-self}
+parameter takes precedence over any default @code{Gcc} rules as
+described later (@pxref{Archived Messages}), with the exception for
+messages to resend.
 
 @strong{Caveat}: Adding @code{(gcc-self . t)} to the parameter list of
 @code{nntp} groups (or the like) isn't valid.  An @code{nntp} server

=== modified file 'lisp/gnus/gnus-msg.el'
--- a/lisp/gnus/gnus-msg.el     2014-07-18 08:23:49 +0000
+++ b/lisp/gnus/gnus-msg.el     2014-07-31 13:11:41 +0000
@@ -1726,7 +1726,20 @@
          (var (or gnus-outgoing-message-group gnus-message-archive-group))
         (gcc-self-val
          (and group (not (gnus-virtual-group-p group))
-              (gnus-group-find-parameter group 'gcc-self)))
+              (gnus-group-find-parameter group 'gcc-self t)))
+        (gcc-self-get (lambda (gcc-self-val group)
+                        (if (stringp gcc-self-val)
+                            (if (string-match " " gcc-self-val)
+                                (concat "\"" gcc-self-val "\"")
+                              gcc-self-val)
+                          ;; In nndoc groups, we use the parent group name
+                          ;; instead of the current group.
+                          (let ((group (or (gnus-group-find-parameter
+                                            gnus-newsgroup-name 'parent-group)
+                                           group)))
+                            (if (string-match " " group)
+                                (concat "\"" group "\"")
+                              group)))))
         result
         (groups
          (cond
@@ -1777,19 +1790,11 @@
          (if gcc-self-val
              ;; Use the `gcc-self' param value instead.
              (progn
-               (insert
-                (if (stringp gcc-self-val)
-                    (if (string-match " " gcc-self-val)
-                        (concat "\"" gcc-self-val "\"")
-                      gcc-self-val)
-                  ;; In nndoc groups, we use the parent group name
-                  ;; instead of the current group.
-                  (let ((group (or (gnus-group-find-parameter
-                                    gnus-newsgroup-name 'parent-group)
-                                   group)))
-                    (if (string-match " " group)
-                        (concat "\"" group "\"")
-                      group))))
+               (insert (if (listp gcc-self-val)
+                           (mapconcat (lambda (val)
+                                        (funcall gcc-self-get val group))
+                                      gcc-self-val ", ")
+                           (funcall gcc-self-get gcc-self-val group)))
                (if (not (eq gcc-self-val 'none))
                    (insert "\n")
                  (gnus-delete-line)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]