1998-09-17 Katsumi Yamaoka <yamaoka@jpl.org>
[elisp/gnus.git-] / lisp / gnus-msg.el
index a998d19..875d510 100644 (file)
@@ -192,7 +192,10 @@ Thank you for your help in stamping out bugs.
 (defun gnus-extended-version ()
   "Stringified gnus version."
   (interactive) ; ???
-  (concat gnus-product-name "/" gnus-version-number))
+  (concat gnus-product-name "/" gnus-version-number " (based on "
+         gnus-original-product-name " " gnus-original-version-number ")"))
+
+(defconst gnus-inviolable-extended-version (gnus-extended-version))
 
 (defvar gnus-article-reply nil)
 (defmacro gnus-setup-message (config &rest forms)
@@ -247,11 +250,20 @@ Thank you for your help in stamping out bugs.
 
 ;;; Post news commands of Gnus group mode and summary mode
 
-(defun gnus-group-mail ()
-  "Start composing a mail."
-  (interactive)
-  (gnus-setup-message 'message
-    (message-mail)))
+(defun gnus-group-mail (&optional arg)
+  "Start composing a mail.
+If ARG, use the group under the point to find a posting style.
+If ARG is 1, prompt for a group name to find the posting style."
+  (interactive "P")
+  (let ((gnus-newsgroup-name
+        (if arg
+            (if (= 1 (prefix-numeric-value arg))
+                (completing-read "Use posting style of group: "
+                                 gnus-active-hashtb nil
+                                 (gnus-read-active-file-p))
+              (gnus-group-group-name))
+          "")))
+    (gnus-setup-message 'message (message-mail))))
 
 (defun gnus-group-post-news (&optional arg)
   "Start composing a news message.
@@ -374,11 +386,6 @@ header line with the old Message-ID."
   ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
   ;; this buffer should be passed to all mail/news reply/post routines.
   (setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*"))
-  (buffer-disable-undo gnus-article-copy)
-  (save-excursion
-    (set-buffer gnus-article-copy)
-    (when (fboundp 'set-buffer-multibyte)
-      (set-buffer-multibyte t)))
   (let ((article-buffer (or article-buffer gnus-article-buffer))
        end beg)
     (if (not (and (get-buffer article-buffer)
@@ -412,7 +419,7 @@ header line with the old Message-ID."
                         (or (search-forward "\n\n" nil t) (point)))
          ;; Insert the original article headers.
          (insert-buffer-substring gnus-original-article-buffer beg end)
-         (gnus-article-decode-rfc1522)))
+         (article-decode-encoded-words)))
       gnus-article-copy)))
 
 (defun gnus-post-news (post &optional group header article-buffer yank subject
@@ -508,14 +515,16 @@ If SILENT, don't prompt the user."
                   (list gnus-post-method)))
               gnus-secondary-select-methods
               (mapcar 'cdr gnus-server-alist)
+              (mapcar 'car gnus-opened-servers)
               (list gnus-select-method)
               (list group-method)))
             method-alist post-methods method)
        ;; Weed out all mail methods.
        (while methods
          (setq method (gnus-server-get-method "" (pop methods)))
-         (when (or (gnus-method-option-p method 'post)
-                   (gnus-method-option-p method 'post-mail))
+         (when (and (or (gnus-method-option-p method 'post)
+                        (gnus-method-option-p method 'post-mail))
+                    (not (member method post-methods)))
            (push method post-methods)))
        ;; Create a name-method alist.
        (setq method-alist
@@ -539,7 +548,7 @@ If SILENT, don't prompt the user."
      ((and (eq gnus-post-method 'current)
           (not (eq (car group-method) 'nndraft))
           (not arg))
-      group-method) 
+      group-method)
      ((and gnus-post-method
           (not (eq gnus-post-method 'current)))
       gnus-post-method)
@@ -563,8 +572,7 @@ automatically."
   ;; Stripping headers should be specified with mail-yank-ignored-headers.
   (when yank
     (gnus-summary-goto-subject (car yank)))
-  (let ((gnus-article-reply t)
-       (gnus-inhibit-posting-styles t))
+  (let ((gnus-article-reply t))
     (gnus-setup-message (if yank 'reply-yank 'reply)
       (gnus-summary-select-article)
       (set-buffer (gnus-copy-article-buffer))
@@ -684,7 +692,8 @@ The current group name will be inserted at \"%s\".")
        (gnus-summary-select-article)
        (set-buffer gnus-original-article-buffer)
        (if (and (<= (length (message-tokenize-header
-                             (setq newsgroups (mail-fetch-field "newsgroups"))
+                             (setq newsgroups
+                                   (mail-fetch-field "newsgroups"))
                              ", "))
                     1)
                 (or (not (setq followup-to (mail-fetch-field "followup-to")))
@@ -848,7 +857,6 @@ The source file has to be in the Emacs load path."
     ;; Go through all the files looking for non-default values for variables.
     (save-excursion
       (set-buffer (gnus-get-buffer-create " *gnus bug info*"))
-      (buffer-disable-undo (current-buffer))
       (while files
        (erase-buffer)
        (when (and (setq file (locate-library (pop files)))
@@ -961,7 +969,7 @@ this is a reply."
                       (concat "^" (regexp-quote mail-header-separator) "$")
                       nil t)
                  (replace-match "" t t ))
-               (unless (gnus-request-accept-article group method t)
+               (unless (gnus-request-accept-article group method t t)
                  (gnus-message 1 "Couldn't store article in group %s: %s"
                                group (gnus-status-message method))
                  (sit-for 2))
@@ -992,7 +1000,7 @@ this is a reply."
          (and gnus-newsgroup-name
               (gnus-group-find-parameter
                gnus-newsgroup-name 'gcc-self)))
-        result 
+        result
         (groups
          (cond
           ((null gnus-message-archive-method)
@@ -1096,7 +1104,7 @@ this is a reply."
            (if (and (not (stringp (car attribute)))
                     (not (eq 'body (car attribute)))
                     (not (setq variable
-                               (cdr (assq (car attribute) 
+                               (cdr (assq (car attribute)
                                           gnus-posting-style-alist)))))
                (message "Couldn't find attribute %s" (car attribute))
              ;; We get the value.