Changes committed gnus/lisp (6 files)

"Miles Bader" <[email protected]> Fri, 27 Feb 2009 00:35:59 +0100
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog gnus-art.el gnus-dired.el gnus-util.el gnus.el
          message.el

Merge from emacs--devo--0

Patches applied:

 * emacs--devo--0  (patch 1542, 1547-1548, 1550-1552, 1554)

   - Update from CVS
   - Merge from gnus--devo--0

2009-02-26  Tobias C. Rittweiler  <[email protected]>  (tiny change)

   * contrib/sendmail.el (sendmail-send-it): `call-process-region' can return a
   string.  (Bug#2428)

2009-02-07  Glenn Morris  <[email protected]>

   * contrib/sendmail.el (mail-bury-selects-summary, mail-yank-original): Doc fix.
   (rmail-output-to-rmail-buffer): Autoload it.
   (mail-do-fcc): Give it a doc string.  Update for mbox Rmail, simplify.

2009-02-25  Katsumi Yamaoka  <[email protected]>

   * lisp/gnus-dired.el: Remove autoload for gnus-setup-message.
   (gnus-dired-attach): Fake this-command value to prevent Gnus from
   displaying Gnus logo; always use compose-mail.

2009-02-23  Katsumi Yamaoka  <[email protected]>

   * lisp/gnus-dired.el: Tell autoload that gnus-setup-message is a macro.

2009-02-15  Glenn Morris  <[email protected]>

   * lisp/gnus-util.el (rmail-insert-rmail-file-header)
   (rmail-count-new-messages, rmail-show-message): Remove unnecessary
   autoloads.
   (rmail-default-rmail-file): Remove unnecessary declaration.
   (gnus-output-to-rmail): Handle mbox Rmail as well as Babyl Rmail.

2009-02-14  Glenn Morris  <[email protected]>

   * lisp/gnus.el (rmail-default-rmail-file): Remove declaration of deleted
   variable (only used in gnus-util, which declares it anyway).
   (rmail-output-to-rmail-file): Remove autoload of deleted function,
   which was only needed by gnus-art (changed to not use it any more).
   (rmail-insert-rmail-file-header): Remove autoload of deleted function,
   only used in gnus-util, which autoloads it itself.
   (rmail-update-summary): Fix autoload.

   * lisp/gnus-art.el (gnus-summary-save-in-mail): Use gnus-output-to-rmail
   rather than rmail-output-to-rmail-file.

2009-02-07  Glenn Morris  <[email protected]>

   * lisp/message.el (rmail-msg-restore-non-pruned-header): Remove unneeded
   autoload of function that no longer exists.
   (rmail-toggle-header): Declare.
   (message-forward-rmail-make-body): Handle mbox Rmail.

2009-02-26  Glenn Morris  <[email protected]>

   * texi/gnus.texi: Minor updates for mbox Rmail.

2009-02-26  Karl Berry  <[email protected]>

   * texi/gnus-coding.texi,
   * texi/gnus.texi,
   * texi/message.texi,
   * texi/pgg.texi,
   * texi/sasl.texi,
   * texi/sieve.texi: Consistently use @insertcopying in the Top node,
   @contents at the front (after @end titlepage),
   and @direntry after @copying.
   (Bug#1988)

Revision: [email protected]/gnus--devo--0--patch-581


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1988 gnus/lisp/ChangeLog:7.1989
--- ChangeLog:7.1988	Wed Feb 18 11:01:48 2009
+++ ChangeLog	Fri Feb 27 00:35:59 2009
@@ -1,3 +1,13 @@
+2009-02-25  Katsumi Yamaoka  <[email protected]>
+
+	* gnus-dired.el: Remove autoload for gnus-setup-message.
+	(gnus-dired-attach): Fake this-command value to prevent Gnus from
+	displaying Gnus logo; always use compose-mail.
+
+2009-02-23  Katsumi Yamaoka  <[email protected]>
+
+	* gnus-dired.el: Tell autoload that gnus-setup-message is a macro.
+
 2009-02-18  Katsumi Yamaoka  <[email protected]>
 
 	* gnus-nocem.el (gnus-nocem-groups): Remove invalid NoCeM groups.
@@ -10,6 +20,34 @@
 
 	* gnus-art.el (gnus-button-alist): Recognize Konqueror info links.
 
+2009-02-15  Glenn Morris  <[email protected]>
+
+	* gnus-util.el (rmail-insert-rmail-file-header)
+	(rmail-count-new-messages, rmail-show-message): Remove unnecessary
+	autoloads.
+	(rmail-default-rmail-file): Remove unnecessary declaration.
+	(gnus-output-to-rmail): Handle mbox Rmail as well as Babyl Rmail.
+
+2009-02-14  Glenn Morris  <[email protected]>
+
+	* gnus.el (rmail-default-rmail-file): Remove declaration of deleted
+	variable (only used in gnus-util, which declares it anyway).
+	(rmail-output-to-rmail-file): Remove autoload of deleted function,
+	which was only needed by gnus-art (changed to not use it any more).
+	(rmail-insert-rmail-file-header): Remove autoload of deleted function,
+	only used in gnus-util, which autoloads it itself.
+	(rmail-update-summary): Fix autoload.
+
+	* gnus-art.el (gnus-summary-save-in-mail): Use gnus-output-to-rmail
+	rather than rmail-output-to-rmail-file.
+
+2009-02-07  Glenn Morris  <[email protected]>
+
+	* message.el (rmail-msg-restore-non-pruned-header): Remove unneeded
+	autoload of function that no longer exists.
+	(rmail-toggle-header): Declare.
+	(message-forward-rmail-make-body): Handle mbox Rmail.
+
 2009-01-31  Glenn Morris  <[email protected]>
 
 	* gnus-sum.el (gnus-summary-next-article): XEmacs-friendly version of
Index: gnus-art.el
diff -u gnus/lisp/gnus-art.el:7.289 gnus/lisp/gnus-art.el:7.290
--- gnus-art.el:7.289	Mon Feb 16 00:40:13 2009
+++ gnus-art.el	Fri Feb 27 00:35:59 2009
@@ -537,6 +537,7 @@
   :group 'gnus-article-saving
   :type 'regexp)
 
+;; Note that "Rmail format" is mbox since Emacs 23, but Babyl before.
 (defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail
   "A function to save articles in your favourite format.
 The function will be called by way of the `gnus-summary-save-article'
@@ -3876,6 +3877,9 @@
     (save-excursion
       (save-restriction
 	(widen)
+	;; Note that unlike gnus-summary-save-in-mail, there is no
+	;; check to see if filename is Babyl.  Rmail in Emacs 23 does
+	;; not use Babyl.
 	(gnus-output-to-rmail filename))))
   filename)
 
@@ -3894,7 +3898,7 @@
 	(if (and (file-readable-p filename)
 		 (file-regular-p filename)
 		 (mail-file-babyl-p filename))
-	    (rmail-output-to-rmail-file filename t)
+	    (gnus-output-to-rmail filename)
 	  (gnus-output-to-mail filename)))))
   filename)
 
Index: gnus-dired.el
diff -u gnus/lisp/gnus-dired.el:7.15 gnus/lisp/gnus-dired.el:7.16
--- gnus-dired.el:7.15	Thu Jan 22 08:02:16 2009
+++ gnus-dired.el	Fri Feb 27 00:35:59 2009
@@ -53,7 +53,6 @@
 ;; Autoloads to avoid byte-compiler warnings.  These are used only if the user
 ;; customizes `gnus-dired-mail-mode' to use Message and/or Gnus.
 (autoload 'message-buffers "message")
-(autoload 'gnus-setup-message "gnus-msg")
 (autoload 'gnus-print-buffer "gnus-sum")
 
 (defvar gnus-dired-mode nil
@@ -162,9 +161,17 @@
 				    bufs)
 				   nil t)))
 	;; setup a new mail composition buffer
-	(if (eq gnus-dired-mail-mode 'gnus-user-agent)
-	    (gnus-setup-message 'message (message-mail))
-	  ;; FIXME: Is this the right thing?
+	(let ((mail-user-agent gnus-dired-mail-mode)
+	      ;; A workaround to prevent Gnus from displaying the Gnus
+	      ;; logo when invoking this command without loading Gnus.
+	      ;; Gnus demonstrates it when gnus.elc is being loaded if
+	      ;; a command of which the name is prefixed with "gnus"
+	      ;; causes that autoloading.  See the code in question,
+	      ;; that is the one first found in gnus.el by performing
+	      ;; `C-s this-command'.
+	      (this-command (if (eq gnus-dired-mail-mode 'gnus-user-agent)
+				'gnoose-dired-attach
+			      this-command)))
 	  (compose-mail))
 	(setq destination (current-buffer)))
 
Index: gnus-util.el
diff -u gnus/lisp/gnus-util.el:7.86 gnus/lisp/gnus-util.el:7.87
--- gnus-util.el:7.86	Thu Jan 22 08:02:16 2009
+++ gnus-util.el	Fri Feb 27 00:35:59 2009
@@ -52,9 +52,6 @@
 
 (autoload 'message-fetch-field "message")
 (autoload 'gnus-get-buffer-window "gnus-win")
-(autoload 'rmail-insert-rmail-file-header "rmail")
-(autoload 'rmail-count-new-messages "rmail")
-(autoload 'rmail-show-message "rmail")
 (autoload 'nnheader-narrow-to-headers "nnheader")
 (autoload 'nnheader-replace-chars-in-string "nnheader")
 (autoload 'mail-header-remove-comments "mail-parse")
@@ -1053,31 +1050,45 @@
      (autoload 'rmail-summary-displayed "rmail")
      (autoload 'rmail-maybe-display-summary "rmail"))))
 
-(defvar rmail-default-rmail-file)
 (defvar mm-text-coding-system)
 
 (declare-function mm-append-to-file "mm-util"
                   (start end filename &optional codesys inhibit))
 
 (defun gnus-output-to-rmail (filename &optional ask)
-  "Append the current article to an Rmail file named FILENAME."
+  "Append the current article to an Rmail file named FILENAME.
+In Emacs 22 this writes Babyl format; in Emacs 23 it writes mbox unless
+FILENAME exists and is Babyl format."
   (require 'rmail)
   (require 'mm-util)
-  ;; Most of these codes are borrowed from rmailout.el.
+  ;; Some of this codes is borrowed from rmailout.el.
   (setq filename (expand-file-name filename))
-  (setq rmail-default-rmail-file filename)
+  ;; FIXME should we really be messing with this defcustom?
+  ;; It is not needed for the operation of this function.
+  (if (boundp 'rmail-default-rmail-file)
+      (setq rmail-default-rmail-file filename) ; 22
+    (setq rmail-default-file filename))        ; 23
   (let ((artbuf (current-buffer))
-	(tmpbuf (get-buffer-create " *Gnus-output*")))
+	(tmpbuf (get-buffer-create " *Gnus-output*"))
+        ;; Babyl rmail.el defines this, mbox does not.
+        (babyl (fboundp 'rmail-insert-rmail-file-header)))
     (save-excursion
-      (or (get-file-buffer filename)
-	  (file-exists-p filename)
+      ;; Note that we ignore the possibility of visiting a Babyl
+      ;; format buffer in Emacs 23, since Rmail no longer supports that.
+     (or (get-file-buffer filename)
+         (progn
+           ;; In case someone wants to write to a Babyl file from Emacs 23.
+           (when (file-exists-p filename)
+             (setq babyl (mail-file-babyl-p filename))
+             t))
 	  (if (or (not ask)
 		  (gnus-yes-or-no-p
 		   (concat "\"" filename "\" does not exist, create it? ")))
 	      (let ((file-buffer (create-file-buffer filename)))
 		(save-excursion
 		  (set-buffer file-buffer)
-		  (rmail-insert-rmail-file-header)
+                  (if (fboundp 'rmail-insert-rmail-file-header)
+                      (rmail-insert-rmail-file-header))
 		  (let ((require-final-newline nil)
 			(coding-system-for-write mm-text-coding-system))
 		    (gnus-write-buffer filename)))
@@ -1086,32 +1097,56 @@
       (set-buffer tmpbuf)
       (erase-buffer)
       (insert-buffer-substring artbuf)
-      (gnus-convert-article-to-rmail)
+      (if babyl
+          (gnus-convert-article-to-rmail)
+        ;; Non-Babyl case copied from gnus-output-to-mail.
+        (goto-char (point-min))
+        (if (looking-at "From ")
+            (forward-line 1)
+          (insert "From nobody " (current-time-string) "\n"))
+        (let (case-fold-search)
+          (while (re-search-forward "^From " nil t)
+            (beginning-of-line)
+            (insert ">"))))
       ;; Decide whether to append to a file or to an Emacs buffer.
       (let ((outbuf (get-file-buffer filename)))
 	(if (not outbuf)
-	    (let ((file-name-coding-system nnmail-pathname-coding-system))
-	      (mm-append-to-file (point-min) (point-max) filename))
+            (progn
+              (unless babyl             ; from gnus-output-to-mail
+                (let ((buffer-read-only nil))
+                  (goto-char (point-max))
+                  (forward-char -2)
+                  (unless (looking-at "\n\n")
+                    (goto-char (point-max))
+                    (unless (bolp)
+                      (insert "\n"))
+                    (insert "\n"))))
+              (let ((file-name-coding-system nnmail-pathname-coding-system))
+                (mm-append-to-file (point-min) (point-max) filename)))
 	  ;; File has been visited, in buffer OUTBUF.
 	  (set-buffer outbuf)
 	  (let ((buffer-read-only nil)
 		(msg (and (boundp 'rmail-current-message)
 			  (symbol-value 'rmail-current-message))))
 	    ;; If MSG is non-nil, buffer is in RMAIL mode.
+            ;; Compare this with rmail-output-to-rmail-buffer in Emacs 23.
 	    (when msg
-	      (widen)
-	      (narrow-to-region (point-max) (point-max)))
+              (unless babyl
+                (rmail-swap-buffers-maybe)
+                (rmail-maybe-set-message-counters))
+              (widen)
+              (narrow-to-region (point-max) (point-max)))
 	    (insert-buffer-substring tmpbuf)
 	    (when msg
-	      (goto-char (point-min))
-	      (widen)
-	      (search-backward "\n\^_")
-	      (narrow-to-region (point) (point-max))
+              (when babyl
+                (goto-char (point-min))
+                (widen)
+                (search-backward "\n\^_")
+                (narrow-to-region (point) (point-max)))
 	      (rmail-count-new-messages t)
 	      (when (rmail-summary-exists)
 		(rmail-select-summary
 		 (rmail-update-summary)))
-	      (rmail-count-new-messages t)
 	      (rmail-show-message msg))
 	    (save-buffer)))))
     (kill-buffer tmpbuf)))
Index: gnus.el
diff -u gnus/lisp/gnus.el:7.87 gnus/lisp/gnus.el:7.88
--- gnus.el:7.87	Thu Jan 22 08:02:16 2009
+++ gnus.el	Fri Feb 27 00:35:59 2009
@@ -2802,9 +2802,6 @@
 
 (defvar gnus-reffed-article-number nil)
 
-;;; Let the byte-compiler know that we know about this variable.
-(defvar rmail-default-rmail-file)
-
 (defvar gnus-dead-summary nil)
 
 (defvar gnus-invalid-group-regexp "[: `'\"/]\\|^$"
@@ -2843,10 +2840,14 @@
      ("babel" babel-as-string)
      ("nnmail" nnmail-split-fancy nnmail-article-group)
      ("nnvirtual" nnvirtual-catchup-group nnvirtual-convert-headers)
-     ("rmailout" rmail-output rmail-output-to-rmail-file)
-     ("rmail" rmail-insert-rmail-file-header rmail-count-new-messages
-      rmail-show-message rmail-summary-exists
-      rmail-select-summary rmail-update-summary)
+     ;; This is only used in message.el, which has an autoload.
+     ("rmailout" rmail-output)
+     ;; Next two used in gnus-util, which has autoloads, and contrib/sendmail.
+     ("rmail" rmail-count-new-messages rmail-show-message
+      ;; Next two only used in gnus-util.
+      rmail-summary-exists rmail-select-summary)
+     ;; Only used in gnus-util, which has an autoload.
+     ("rmailsum" rmail-update-summary)
      ("gnus-audio" :interactive t gnus-audio-play)
      ("gnus-xmas" gnus-xmas-splash)
      ("gnus-soup" :interactive t
Index: message.el
diff -u gnus/lisp/message.el:7.280 gnus/lisp/message.el:7.281
--- message.el:7.280	Thu Jan  8 21:24:06 2009
+++ message.el	Fri Feb 27 00:35:58 2009
@@ -1824,7 +1824,6 @@
 (autoload 'nnvirtual-find-group-art "nnvirtual")
 (autoload 'rmail-dont-reply-to "mail-utils")
 (autoload 'rmail-msg-is-pruned "rmail")
-(autoload 'rmail-msg-restore-non-pruned-header "rmail")
 (autoload 'rmail-output "rmailout")
 
 
@@ -5222,6 +5221,13 @@
 	    (if (and message-fcc-handler-function
 		     (not (eq message-fcc-handler-function 'rmail-output)))
 		(funcall message-fcc-handler-function file)
+	      ;; FIXME this option, rmail-output (also used if
+	      ;; message-fcc-handler-function is nil) is not
+	      ;; documented anywhere AFAICS.  It should work in Emacs
+	      ;; 23; I suspect it does not work in Emacs 22.
+	      ;; FIXME I don't see the need for the two different cases here.
+	      ;; mail-use-rfc822 makes no difference (in Emacs 23),and
+	      ;; the third argument just controls \"Wrote file\" message.
 	      (if (and (file-readable-p file) (mail-file-babyl-p file))
 		  (rmail-output file 1 nil t)
 		(let ((mail-use-rfc822 t))
@@ -7232,12 +7238,16 @@
       (message-forward-make-body-plain forward-buffer)))
   (message-position-point))
 
+(declare-function rmail-toggle-header "rmail" (&optional arg))
+
 ;;;###autoload
 (defun message-forward-rmail-make-body (forward-buffer)
   (save-window-excursion
     (set-buffer forward-buffer)
     (if (rmail-msg-is-pruned)
-	(rmail-msg-restore-non-pruned-header)))
+	(if (fboundp 'rmail-msg-restore-non-pruned-header)
+	    (rmail-msg-restore-non-pruned-header) ; Emacs 22
+	  (rmail-toggle-header 0))))		  ; Emacs 23
   (message-forward-make-body forward-buffer))
 
 ;; Fixme: Should have defcustom.