From d39cab9f8947c87c60bbb8147d19bc145b155ebb Mon Sep 17 00:00:00 2001 From: Josh Huber Date: Sun, 21 Apr 2002 02:42:45 +0000 Subject: [PATCH] lisp/ChangeLog addition: 2002-04-20 Josh Huber * 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 | 33 +++++++++++++++++++++++++++++++++ lisp/gnus-msg.el | 35 ++++++++++++++++++++++++++++++++++- lisp/message.el | 38 ++++++++++++++++++++++++++------------ 3 files changed, 93 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5cee7d5c5..252c77fe0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,36 @@ +2002-04-20 Josh Huber + + * 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 + + * 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 * gnus-win.el (gnus-configure-windows-hook): Fix typo. diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 681b61bed..c8bdd2e0e 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -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. diff --git a/lisp/message.el b/lisp/message.el index 70d50c6f7..d6dc3c96e 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -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. -- 2.25.1