lisp/ChangeLog addition:
authorJosh Huber <huber@alum.wpi.edu>
Sun, 21 Apr 2002 02:42:45 +0000 (02:42 +0000)
committerJosh Huber <huber@alum.wpi.edu>
Sun, 21 Apr 2002 02:42:45 +0000 (02:42 +0000)
2002-04-20  Josh Huber  <huber@alum.wpi.edu>

* gnus-msg.el:
* gnus-msg.el (gnus-message-replysign): New.
* gnus-msg.el (gnus-message-replyencrypt): New.
* gnus-msg.el (gnus-message-replysignencrypted): New.
* gnus-msg.el (gnus-summary-reply): Use the three new variables
(above) to automatically encrypt/sign to encrypted/signed
messages.
* message.el:
* message.el (message-mode-map): Add keybinding for
`message-to-list-only'
* message.el (message-mode): Add description for
`message-to-list-only'
* message.el (message-to-list-only): New.
* message.el (message-make-mft): Changed to use the cl loop macro,
and added optional flag to return only the matched list. (for use
in new message-to-list-only function)

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

index 5cee7d5..252c77f 100644 (file)
@@ -1,3 +1,36 @@
+2002-04-20  Josh Huber  <huber@alum.wpi.edu>
+
+       * gnus-msg.el:
+       * gnus-msg.el (gnus-message-replysign): New.
+       * gnus-msg.el (gnus-message-replyencrypt): New.
+       * gnus-msg.el (gnus-message-replysignencrypted): New.
+       * gnus-msg.el (gnus-summary-reply): Use the three new variables
+       (above) to automatically encrypt/sign to encrypted/signed
+       messages.
+       * message.el:
+       * message.el (message-mode-map): Add keybinding for
+       `message-to-list-only'
+       * message.el (message-mode): Add description for
+       `message-to-list-only'
+       * message.el (message-to-list-only): New.
+       * message.el (message-make-mft): Changed to use the cl loop macro,
+       and added optional flag to return only the matched list. (for use
+       in new message-to-list-only function)
+
+2002-04-20  Josh Huber  <huber@alum.wpi.edu>
+
+       * gnus-msg.el:
+       * gnus-msg.el (gnus-message-replysign):
+       * gnus-msg.el (gnus-replysign): New.
+       * gnus-msg.el (gnus-replyencrypt): New.
+       * gnus-msg.el (gnus-replysignencrypted): New.
+       * gnus-msg.el (gnus-summary-reply):
+       * message.el:
+       * message.el (message-mode-map):
+       * message.el (message-mode):
+       * message.el (message-to-list-only): New.
+       * message.el (message-make-mft):
+
 2002-04-19  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-win.el (gnus-configure-windows-hook): Fix typo.
index 681b61b..c8bdd2e 100644 (file)
@@ -219,6 +219,26 @@ This variable is used only when `gnus-post-method' is `current'."
   :group 'gnus-group-foreign
   :type '(repeat (symbol :tab "Back end")))
 
+(defcustom gnus-message-replysign
+  nil
+  "Automatically sign replys to signed messages.
+See also the `mml-default-sign-method' variable."
+  :group 'gnus-message
+  :type 'boolean)
+
+(defcustom gnus-message-replyencrypt
+  nil
+  "Automatically encrypt replys to encrypted messages.
+See also the `mml-default-encrypt-method' variable."
+  :group 'gnus-message
+  :type 'boolean)
+
+(defcustom gnus-message-replysignencrypted
+  nil
+  "Setting this causes automatically encryped messages to also be signed."
+  :group 'gnus-message
+  :type 'boolean)
+
 ;;; Internal variables.
 
 (defvar gnus-inhibit-posting-styles nil
@@ -989,7 +1009,20 @@ If VERY-WIDE, make a very wide reply."
       (mml-quote-region (point) (point-max))
       (message-reply nil wide)
       (when yank
-       (gnus-inews-yank-articles yank)))))
+       (gnus-inews-yank-articles yank))
+      (when (or gnus-message-replysign gnus-message-replyencrypt)
+       (let (signed encrypted)
+         (save-excursion
+           (set-buffer (or gnus-article-buffer article-buffer))
+           (setq signed (memq 'signed gnus-article-wash-types))
+           (setq encrypted (memq 'encrypted gnus-article-wash-types)))
+         (cond ((and gnus-message-replysign signed)
+                (mml-secure-message mml-default-sign-method 'sign))
+               ((and gnus-message-replyencrypt encrypted)
+                (mml-secure-message mml-default-encrypt-method
+                                    (if gnus-message-replysignencrypted
+                                        'signencrypt
+                                      'encrypt)))))))))
 
 (defun gnus-summary-reply-with-original (n &optional wide)
   "Start composing a reply mail to the current message.
index 70d50c6..d6dc3c9 100644 (file)
@@ -1563,6 +1563,7 @@ Point is left at the beginning of the narrowed-to region."
 
   (define-key message-mode-map "\C-c\C-t" 'message-insert-to)
   (define-key message-mode-map "\C-c\C-n" 'message-insert-newsgroups)
+  (define-key message-mode-map "\C-c\C-l" 'message-to-list-only)
 
   (define-key message-mode-map "\C-c\C-u" 'message-insert-or-toggle-importance)
   (define-key message-mode-map "\C-c\M-n" 'message-insert-disposition-notification-to)
@@ -1733,6 +1734,7 @@ C-c C-f  move to a header field (and create it if there isn't):
         C-c C-f C-m  move to Mail-Followup-To
         C-c C-f C-i  cycle through Importance values
 C-c C-t  `message-insert-to' (add a To header to a news followup)
+C-c C-l  `message-to-list-only' (removes all but list address in to/cc)
 C-c C-n  `message-insert-newsgroups' (add a Newsgroup header to a news reply)
 C-c C-b  `message-goto-body' (move to beginning of message text).
 C-c C-i  `message-goto-signature' (move to the beginning of the signature).
@@ -3937,8 +3939,20 @@ give as trustworthy answer as possible."
   (or mail-host-address
       (message-make-fqdn)))
 
-(defun message-make-mft ()
-  "Return the Mail-Followup-To header."
+(defun message-to-list-only ()
+  (interactive)
+  (let ((listaddr (message-make-mft t)))
+    (when listaddr
+      (save-excursion
+       (message-remove-header "to")
+       (message-remove-header "cc")
+       (message-position-on-field "To" "X-Draft-From")
+       (insert listaddr)))))
+
+(defun message-make-mft (&optional only-show-subscribed)
+  "Return the Mail-Followup-To header. If passed the optional
+argument `only-show-subscribed' only return the subscribed address (and
+not the additional To and Cc header contents)."
   (let* ((case-fold-search t)
         (to (message-fetch-field "To"))
         (cc (message-fetch-field "cc"))
@@ -3968,16 +3982,16 @@ give as trustworthy answer as possible."
                             (mapcar 'funcall
                                     message-subscribed-address-functions))))
     (save-match-data
-      (when (eval
-            (apply 'append '(or)
-                   (mapcar
-                    #'(lambda (regexp)
-                        (mapcar
-                         #'(lambda (recipient)
-                             `(string-match ,regexp ,recipient))
-                         recipients))
-                    mft-regexps)))
-       msg-recipients))))
+      (let ((subscribed-lists nil)
+           (list
+            (loop for recipient in recipients
+              when (loop for regexp in mft-regexps
+                     when (string-match regexp recipient) return t)
+              return recipient)))
+       (when list
+         (if only-show-subscribed
+             list
+           msg-recipients))))))
 
 (defun message-generate-headers (headers)
   "Prepare article HEADERS.