Import Oort Gnus v0.19.
[elisp/gnus.git-] / lisp / gnus-msg.el
index 84b1701..5f90549 100644 (file)
@@ -146,9 +146,6 @@ See Info node `(gnus)Posting Styles'."
   :group 'gnus-message
   :type 'boolean)
 
-(defvar gnus-inews-mark-gcc-as-read nil
-  "Obsolete variable. Use `gnus-gcc-mark-as-read' instead.")
-
 (make-obsolete-variable 'gnus-inews-mark-gcc-as-read
                        'gnus-gcc-mark-as-read)
 
@@ -440,10 +437,8 @@ Thank you for your help in stamping out bugs.
             (let ((mbl1 mml-buffer-list))
               (setq mml-buffer-list mbl)  ;; Global value
               (set (make-local-variable 'mml-buffer-list) mbl1);; Local value
-              ;; LOCAL argument of add-hook differs between GNU Emacs
-              ;; and XEmacs. make-local-hook makes sure they are local.
-              (make-local-hook 'kill-buffer-hook)
-              (make-local-hook 'change-major-mode-hook)
+              (gnus-make-local-hook 'kill-buffer-hook)
+              (gnus-make-local-hook 'change-major-mode-hook)
               (add-hook 'change-major-mode-hook 'mml-destroy-buffers nil t)
               (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))
           (mml-destroy-buffers)
@@ -517,7 +512,7 @@ Gcc: header for archiving purposes."
        (while (setq elem (pop alist))
          (when (or (and (stringp (car elem))
                         (string-match (car elem) group))
-                   (and (gnus-functionp (car elem))
+                   (and (functionp (car elem))
                         (funcall (car elem) group))
                    (and (symbolp (car elem))
                         (symbol-value (car elem))))
@@ -525,11 +520,11 @@ Gcc: header for archiving purposes."
 
 (defun gnus-inews-add-send-actions (winconf buffer article
                                            &optional config yanked)
-  (make-local-hook 'message-sent-hook)
+  (gnus-make-local-hook 'message-sent-hook)
   (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc
                                 'gnus-inews-do-gcc) nil t)
   (when gnus-agent
-    (make-local-hook 'message-header-hook)
+    (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)
@@ -691,7 +686,12 @@ network.  The corresponding backend must have a 'request-post method."
                  gnus-newsgroup-name))
          ;; #### see comment in gnus-setup-message -- drv
          (gnus-setup-message 'message
-           (message-news (gnus-group-real-name gnus-newsgroup-name))))
+           (progn
+             (message-news (gnus-group-real-name gnus-newsgroup-name))
+             (set (make-local-variable 'gnus-discouraged-post-methods)
+                  (delq
+                   (car (gnus-find-method-for-group gnus-newsgroup-name))
+                   (copy-sequence gnus-discouraged-post-methods))))))
       (save-excursion
        (set-buffer buffer)
        (setq gnus-newsgroup-name group)))))
@@ -1204,7 +1204,8 @@ automatically."
 
 (defun gnus-summary-wide-reply-with-original (n)
   "Start composing a wide reply mail to the current message.
-The original article will be yanked."
+The original article will be yanked.
+Uses the process/prefix convention."
   (interactive "P")
   (gnus-summary-reply-with-original n t))
 
@@ -1692,7 +1693,9 @@ this is a reply."
                         ;; Gnus is not running?
                         (gnus-alive-p)
                         (or gnus-gcc-mark-as-read
-                            gnus-inews-mark-gcc-as-read))
+                            (and
+                             (boundp 'gnus-inews-mark-gcc-as-read)
+                             (symbol-value 'gnus-inews-mark-gcc-as-read))))
                (gnus-group-mark-article-read group (cdr group-art)))
              (kill-buffer (current-buffer)))))))))
 
@@ -1703,7 +1706,7 @@ this is a reply."
       (message-narrow-to-headers)
       (let* ((group gnus-outgoing-message-group)
             (gcc (cond
-                  ((gnus-functionp group)
+                  ((functionp group)
                    (funcall group))
                   ((or (stringp group) (list group))
                    group))))
@@ -1744,7 +1747,7 @@ this is a reply."
           ((and (listp var) (stringp (car var)))
            ;; A list of groups.
            var)
-          ((gnus-functionp var)
+          ((functionp var)
            ;; A function.
            (funcall var group))
           (t
@@ -1757,7 +1760,7 @@ this is a reply."
                                 ;; Regexp.
                                 (when (string-match (caar var) group)
                                   (cdar var)))
-                               ((gnus-functionp (car var))
+                               ((functionp (car var))
                                 ;; Function.
                                 (funcall (car var) group))
                                (t
@@ -1842,9 +1845,9 @@ this is a reply."
                         (and header
                              (string-match (pop style) header))))))
               ((or (symbolp match)
-                   (gnus-functionp match))
+                   (functionp match))
                (cond
-                ((gnus-functionp match)
+                ((functionp match)
                  ;; Function to be called.
                  (funcall match))
                 ((boundp match)
@@ -1882,8 +1885,8 @@ this is a reply."
                   ((stringp value)
                    value)
                   ((or (symbolp value)
-                       (gnus-functionp value))
-                   (cond ((gnus-functionp value)
+                       (functionp value))
+                   (cond ((functionp value)
                           (funcall value))
                          ((boundp value)
                           (symbol-value value))))
@@ -1911,8 +1914,7 @@ this is a reply."
       (setq name (assq 'name results)
            address (assq 'address results))
       (setq results (delq name (delq address results)))
-      ;; make-local-hook is not obsolete in Emacs 20 or XEmacs.
-      (make-local-hook 'message-setup-hook)
+      (gnus-make-local-hook 'message-setup-hook)
       (setq results (sort results (lambda (x y)
                                    (string-lessp (car x) (car y)))))
       (dolist (result results)