* lisp/gnus-vers.el (gnus-revision-number): Increment to 02.
authorueno <ueno>
Sun, 8 Sep 2002 05:08:03 +0000 (05:08 +0000)
committerueno <ueno>
Sun, 8 Sep 2002 05:08:03 +0000 (05:08 +0000)
* lisp/gnus-msg.el (gnus-named-posting-styles): New variable.
(gnus-summary-send-map): Bind "P" to
gnus-summary-execute-command-with-posting-style.
(gnus-configure-posting-styles): Expand named entries in
gnus-posting-styles.
(gnus-summary-execute-command-with-posting-style): New command.

ChangeLog
lisp/gnus-msg.el
lisp/gnus-vers.el

index 70835da..df5a4e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2002-09-08  Daiki Ueno  <ueno@unixuser.org>
+
+       * lisp/gnus-vers.el (gnus-revision-number): Increment to 02.
+
+       * lisp/gnus-msg.el (gnus-named-posting-styles): New variable.
+       (gnus-summary-send-map): Bind "P" to
+       gnus-summary-execute-command-with-posting-style.
+       (gnus-configure-posting-styles): Expand named entries in
+       gnus-posting-styles.
+       (gnus-summary-execute-command-with-posting-style): New command.
+       
 2002-09-06  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * lisp/gnus-vers.el (gnus-revision-number): Increment to 01.
index 3a7c3df..a9be535 100644 (file)
@@ -142,6 +142,9 @@ See Info node `(gnus)Posting Styles'."
                                        (variable)
                                        (sexp)))))))
 
+(defvar gnus-named-posting-styles nil
+  "Alist mapping names to the user-defined posting styles.")
+
 (defcustom gnus-gcc-mark-as-read nil
   "If non-nil, automatically mark Gcc articles as read."
   :version "21.1"
@@ -351,7 +354,8 @@ Thank you for your help in stamping out bugs.
   "om" gnus-summary-mail-forward
   "op" gnus-summary-post-forward
   "Om" gnus-summary-digest-mail-forward
-  "Op" gnus-summary-digest-post-forward)
+  "Op" gnus-summary-digest-post-forward
+  "P" gnus-summary-execute-command-with-posting-style)
 
 (gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map)
   "b" gnus-summary-resend-bounced-mail
@@ -1930,6 +1934,16 @@ this is a reply."
                 (t
                  ;; This is a form to be evaled.
                  (eval match)))))
+         ;; Expand all the named elements in style.
+         (setq style (apply (function nconc)
+                            (mapcar
+                             (lambda (attribute)
+                               (if (stringp attribute)
+                                   (copy-sequence
+                                    (cdr (assoc attribute
+                                                gnus-named-posting-styles)))
+                                 (list attribute)))
+                             style)))
          ;; We have a match, so we set the variables.
          (dolist (attribute style)
            (setq element (pop attribute)
@@ -2028,6 +2042,18 @@ this is a reply."
                         (insert "From: " (message-make-from) "\n"))))
                  nil 'local)))))
 
+(defun gnus-summary-execute-command-with-posting-style (style command)
+  "Temporarily select a posting-style named STYLE and execute COMMAND."
+  (interactive
+   (let ((style (completing-read "Posting style: "
+                                gnus-named-posting-styles nil t)))
+     (list style
+          (key-binding
+           (read-key-sequence
+            (format "Command to execute with %s:" style))))))
+  (let ((gnus-posting-styles (list (list ".*" style))))
+    (call-interactively command)))
+
 
 ;;; @ for MIME Edit mode
 ;;;
index b0c30e0..9e921eb 100644 (file)
@@ -34,7 +34,7 @@
 (require 'product)
 (provide 'gnus-vers)
 
-(defconst gnus-revision-number "01"
+(defconst gnus-revision-number "02"
   "Revision number for this version of gnus.")
 
 ;; Product information of this gnus.