(mml2015-epg-sign): Save the signing keys in
[gnus] / lisp / gnus-msg.el
index 32bec9e..8ae9518 100644 (file)
@@ -1,6 +1,7 @@
 ;;; gnus-msg.el --- mail and post interface for Gnus
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-;;        Free Software Foundation, Inc.
+
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;;   2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -20,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -66,8 +67,10 @@ message in, you can set this variable to a function that checks the
 current newsgroup name and then returns a suitable group name (or list
 of names)."
   :group 'gnus-message
-  :type '(choice (string :tag "Group")
-                (function)))
+  :type '(choice (const nil)
+                (function)
+                (string :tag "Group")
+                (repeat :tag "List of groups" (string :tag "Group"))))
 
 (defcustom gnus-mailing-list-groups nil
   "*If non-nil a regexp matching groups that are really mailing lists.
@@ -142,7 +145,7 @@ See Info node `(gnus)Posting Styles'."
 
 (defcustom gnus-gcc-mark-as-read nil
   "If non-nil, automatically mark Gcc articles as read."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-message
   :type 'boolean)
 
@@ -154,7 +157,7 @@ See Info node `(gnus)Posting Styles'."
 If it is `all', attach files as external parts;
 if a regexp and matches the Gcc group name, attach files as external parts;
 if nil, attach files as normal parts."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-message
   :type '(choice (const nil :tag "None")
                 (const all :tag "Any")
@@ -212,7 +215,7 @@ List of charsets that are permitted to be unencoded.")
     "gnus-agent.el" "gnus-cache.el" "gnus-srvr.el"
     "mm-util.el" "mm-decode.el" "nnmail.el" "message.el")
   "Files whose variables will be reported in `gnus-bug'."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-message
   :type '(repeat (string :tag "File")))
 
@@ -220,7 +223,7 @@ List of charsets that are permitted to be unencoded.")
   '(mm-mime-mule-charset-alist
     nnmail-split-fancy message-minibuffer-local-map)
   "Variables that should not be reported in `gnus-bug'."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-message
   :type '(repeat (symbol :tag "Variable")))
 
@@ -228,7 +231,7 @@ List of charsets that are permitted to be unencoded.")
   '(nndraft nnml nnimap nnmaildir nnmh nnfolder nndir)
   "A list of back ends that are not used in \"real\" newsgroups.
 This variable is used only when `gnus-post-method' is `current'."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-group-foreign
   :type '(repeat (symbol :tag "Back end")))
 
@@ -252,7 +255,8 @@ See also the `mml-default-encrypt-method' variable."
   :group 'gnus-message
   :type 'boolean)
 
-(defcustom gnus-confirm-mail-reply-to-news nil
+(defcustom gnus-confirm-mail-reply-to-news (and gnus-novice-user
+                                               (not gnus-expert-user))
   "If non-nil, Gnus requests confirmation when replying to news.
 This is done because new users often reply by mistake when reading
 news.
@@ -260,7 +264,7 @@ This can also be a function receiving the group name as the only
 parameter which should return non-nil iff a confirmation is needed, or
 a regexp, in which case a confirmation is asked for iff the group name
 matches the regexp."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-message
   :type '(choice (const :tag "No" nil)
                 (const :tag "Yes" t)
@@ -273,7 +277,7 @@ matches the regexp."
 when replying by mail.  See the `gnus-confirm-mail-reply-to-news' variable
 for fine-tuning this.
 If nil, Gnus will never ask for confirmation if replying to mail."
-  :version "21.4"
+  :version "22.1"
   :group 'gnus-message
   :type 'boolean)
 
@@ -281,6 +285,7 @@ If nil, Gnus will never ask for confirmation if replying to mail."
   "If non-nil, Gnus tries to suggest a default address to resend to.
 If nil, the address field will always be empty after invoking
 `gnus-summary-resend-message'."
+  :version "22.1"
   :group 'gnus-message
   :type 'boolean)
 
@@ -469,27 +474,19 @@ Gcc: header for archiving purposes."
   ;; COMPOSEFUNC should return t if succeed.  Undocumented ???
   t)
 
-(defvar save-selected-window-window)
-
 ;;;###autoload
 (defun gnus-button-mailto (address)
   "Mail to ADDRESS."
   (set-buffer (gnus-copy-article-buffer))
   (gnus-setup-message 'message
-    (message-reply address))
-  (and (boundp 'save-selected-window-window)
-       (not (window-live-p save-selected-window-window))
-       (setq save-selected-window-window (selected-window))))
+    (message-reply address)))
 
 ;;;###autoload
 (defun gnus-button-reply (&optional to-address wide)
   "Like `message-reply'."
   (interactive)
   (gnus-setup-message 'message
-    (message-reply to-address wide))
-  (and (boundp 'save-selected-window-window)
-       (not (window-live-p save-selected-window-window))
-       (setq save-selected-window-window (selected-window))))
+    (message-reply to-address wide)))
 
 ;;;###autoload
 (define-mail-user-agent 'gnus-user-agent
@@ -520,7 +517,7 @@ Gcc: header for archiving purposes."
     (gnus-make-local-hook 'message-header-hook)
     (add-hook 'message-header-hook 'gnus-agent-possibly-save-gcc nil t))
   (setq message-post-method
-       `(lambda (arg)
+       `(lambda (&optional arg)
           (gnus-post-method arg ,gnus-newsgroup-name)))
   (setq message-newsreader (setq message-mailer (gnus-extended-version)))
   (message-add-action
@@ -850,6 +847,7 @@ header line with the old Message-ID."
              (delete-region (point) (point-max))
              (insert yank-string))
            (gnus-article-delete-text-of-type 'annotation)
+           (gnus-article-delete-text-of-type 'multipart)
            (gnus-remove-text-with-property 'gnus-prev)
            (gnus-remove-text-with-property 'gnus-next)
            (gnus-remove-text-with-property 'gnus-decoration)
@@ -877,7 +875,8 @@ header line with the old Message-ID."
            ;; Decode charsets.
            (let ((gnus-article-decode-hook
                   (delq 'article-decode-charset
-                        (copy-sequence gnus-article-decode-hook))))
+                        (copy-sequence gnus-article-decode-hook)))
+                 (rfc2047-quote-decoded-words-containing-tspecials t))
              (run-hooks 'gnus-article-decode-hook)))))
       gnus-article-copy)))
 
@@ -1038,17 +1037,18 @@ If SILENT, don't prompt the user."
   "Stringified Gnus version and Emacs version.
 See the variable `gnus-user-agent'."
   (interactive)
-  (let* ((float-output-format nil)
-        (gnus-v
-         (concat "Gnus/"
-                 (prin1-to-string (gnus-continuum-version gnus-version) t)
-                 " (" gnus-version ")"))
-        (emacs-v (gnus-emacs-version)))
-    (if (stringp gnus-user-agent)
-       gnus-user-agent
-      (concat gnus-v
-             (when emacs-v
-               (concat " " emacs-v))))))
+  (if (stringp gnus-user-agent)
+      gnus-user-agent
+    ;; `gnus-user-agent' is a list:
+    (let* ((float-output-format nil)
+          (gnus-v
+           (when (memq 'gnus gnus-user-agent)
+             (concat "Gnus/"
+                     (prin1-to-string (gnus-continuum-version gnus-version) t)
+                     " (" gnus-version ")")))
+          (emacs-v (gnus-emacs-version)))
+      (concat gnus-v (when (and gnus-v emacs-v) " ")
+             emacs-v))))
 
 \f
 ;;;
@@ -1666,7 +1666,7 @@ this is a reply."
             (gcc (cond
                   ((functionp group)
                    (funcall group))
-                  ((or (stringp group) (list group))
+                  ((or (stringp group) (listp group))
                    group))))
        (when gcc
          (insert "Gcc: "
@@ -1870,11 +1870,13 @@ this is a reply."
            (when (and filep v)
              (setq v (with-temp-buffer
                        (insert-file-contents v)
-                       (goto-char (point-max))
-                       (skip-chars-backward "\n")
-                       (delete-region (+ (point) (if (bolp) 0 1))
-                                      (point-max))
-                       (buffer-string))))
+                       (buffer-substring
+                        (point-min)
+                        (progn
+                          (goto-char (point-max))
+                          (if (zerop (skip-chars-backward "\n"))
+                              (point)
+                            (1+ (point))))))))
            (setq results (delq (assoc element results) results))
            (push (cons element v) results))))
       ;; Now we have all the styles, so we insert them.