+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.
: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
(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.
(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)
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).
(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"))
(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.