Merge from emacs--devo--0
authorMiles Bader <miles@gnu.org>
Thu, 26 Feb 2009 23:35:59 +0000 (23:35 +0000)
committerMiles Bader <miles@gnu.org>
Thu, 26 Feb 2009 23:35:59 +0000 (23:35 +0000)
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  <tcr@freebits.de>  (tiny change)

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

2009-02-07  Glenn Morris  <rgm@gnu.org>

   * 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  <yamaoka@jpl.org>

   * 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  <yamaoka@jpl.org>

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

2009-02-15  Glenn Morris  <rgm@gnu.org>

   * 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  <rgm@gnu.org>

   * 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  <rgm@gnu.org>

   * 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  <rgm@gnu.org>

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

2009-02-26  Karl Berry  <karl@gnu.org>

   * 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: emacs@sv.gnu.org/gnus--devo--0--patch-581

16 files changed:
contrib/ChangeLog
contrib/sendmail.el
lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-dired.el
lisp/gnus-util.el
lisp/gnus.el
lisp/message.el
texi/ChangeLog
texi/emacs-mime.texi
texi/gnus-coding.texi
texi/gnus.texi
texi/message.texi
texi/pgg.texi
texi/sasl.texi
texi/sieve.texi

index 0e71d94..14a29b0 100644 (file)
@@ -1,3 +1,14 @@
+2009-02-26  Tobias C. Rittweiler  <tcr@freebits.de>  (tiny change)
+
+       * sendmail.el (sendmail-send-it): `call-process-region' can return a
+       string.  (Bug#2428)
+
+2009-02-07  Glenn Morris  <rgm@gnu.org>
+
+       * 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-01-23  Glenn Morris  <rgm@gnu.org>
 
        * sendmail.el (mail-bury): Revert previous change now pmail is no more.
index 8d33ece..1016387 100644 (file)
@@ -428,9 +428,9 @@ so you can edit or delete these lines."
 
 ;;;###autoload
 (defcustom mail-bury-selects-summary t
-  "If non-nil, try to show RMAIL summary buffer after returning from mail.
+  "If non-nil, try to show Rmail summary buffer after returning from mail.
 The functions \\[mail-send-on-exit] or \\[mail-dont-send] select
-the RMAIL summary buffer before returning, if it exists and this variable
+the Rmail summary buffer before returning, if it exists and this variable
 is non-nil."
   :type 'boolean
   :group 'sendmail)
@@ -783,7 +783,7 @@ Prefix arg means don't delete this window."
          (if (display-multi-frame-p)
              (delete-frame (selected-frame))
            ;; The previous frame is where normally they have the
-           ;; RMAIL buffer displayed.
+           ;; Rmail buffer displayed.
            (other-frame -1)))
       (let (rmail-flag summary-buffer)
        (and (not arg)
@@ -1167,8 +1167,13 @@ external program defined by `sendmail-program'."
                              )
                      )
                     (exit-value (apply 'call-process-region args)))
-               (or (null exit-value) (eq 0 exit-value)
-                   (error "Sending...failed with exit value %d" exit-value)))
+               (cond ((or (null exit-value) (eq 0 exit-value)))
+                     ((numberp exit-value)
+                      (error "Sending...failed with exit value %d" exit-value))
+                     ((stringp exit-value)
+                      (error "Sending...terminated by signal: %s" exit-value))
+                     (t
+                      (error "SENDMAIL-SEND-IT -- fall through: %S" exit-value))))
            (or fcc-was-found
                (error "No recipients")))
          (if mail-interactive
@@ -1183,132 +1188,119 @@ external program defined by `sendmail-program'."
       (if (bufferp errbuf)
          (kill-buffer errbuf)))))
 
+(autoload 'rmail-output-to-rmail-buffer "rmailout")
+
 (defun mail-do-fcc (header-end)
+  "Find and act on any FCC: headers in the current message before HEADER-END.
+If a buffer is visiting the FCC file, append to it before
+offering to save it, if it was modified initially.  If this is an
+Rmail buffer, update Rmail as needed.  If there is no buffer,
+just append to the file, in Babyl format if necessary."
   (unless (markerp header-end)
     (error "Value of `header-end' must be a marker"))
   (let (fcc-list
-       (rmailbuf (current-buffer))
-       (time (current-time))
-       (tembuf (generate-new-buffer " rmail output"))
-       (case-fold-search t))
+       (mailbuf (current-buffer))
+       (time (current-time)))
     (save-excursion
       (goto-char (point-min))
-      (while (re-search-forward "^FCC:[ \t]*" header-end t)
-       (push (buffer-substring (point)
-                                (progn
-                                  (end-of-line)
-                                  (skip-chars-backward " \t")
-                                  (point)))
-              fcc-list)
-       (delete-region (match-beginning 0)
-                      (progn (forward-line 1) (point))))
-      (set-buffer tembuf)
-      (erase-buffer)
-      ;; This initial newline is written out if the fcc file already exists.
-      (insert "\nFrom " (user-login-name) " "
-             (current-time-string time) "\n")
-      ;; Insert the time zone before the year.
-      (forward-char -1)
-      (forward-word -1)
-      (require 'mail-utils)
-      (insert (mail-rfc822-time-zone time) " ")
-      (goto-char (point-max))
-      (insert-buffer-substring rmailbuf)
-      ;; Make sure messages are separated.
-      (goto-char (point-max))
-      (insert ?\n)
-      (goto-char 2)
-      ;; ``Quote'' "^From " as ">From "
-      ;;  (note that this isn't really quoting, as there is no requirement
-      ;;   that "^[>]+From " be quoted in the same transparent way.)
-      (let ((case-fold-search nil))
-       (while (search-forward "\nFrom " nil t)
-         (forward-char -5)
-         (insert ?>)))
-      (dolist (fcc fcc-list)
-       (let* ((buffer (find-buffer-visiting fcc))
-              (curbuf (current-buffer))
-              dont-write-the-file
-              buffer-matches-file
-              (beg (point-min)) (end (point-max))
-              (beg2 (save-excursion (goto-char (point-min))
-                                    (forward-line 2) (point))))
-         (if buffer
-             ;; File is present in a buffer => append to that buffer.
-             (with-current-buffer buffer
-               (setq buffer-matches-file
-                     (and (not (buffer-modified-p))
-                          (verify-visited-file-modtime buffer)))
-               ;; Keep the end of the accessible portion at the same place
-               ;; unless it is the end of the buffer.
-               (let ((max (if (/= (1+ (buffer-size)) (point-max))
-                              (point-max))))
-                 (unwind-protect
-                     ;; Code below lifted from rmailout.el
-                     ;; function rmail-output-to-rmail-file:
-                     (let ((buffer-read-only nil)
-                           (msg (and (boundp 'rmail-current-message)
-                                     rmail-current-message)))
-                       ;; If MSG is non-nil, buffer is in RMAIL mode.
-                       (if msg
-                           (progn
-                             ;; Append to an ordinary buffer as a
-                             ;; Unix mail message.
-                             (rmail-maybe-set-message-counters)
-                             (widen)
-                             (narrow-to-region (point-max) (point-max))
-                             (insert "\C-l\n0, unseen,,\n*** EOOH ***\n"
-                                     "Date: " (mail-rfc822-date) "\n")
-                             (insert-buffer-substring curbuf beg2 end)
-                             (insert "\n\C-_")
-                             (goto-char (point-min))
-                             (widen)
-                             (search-backward "\n\^_")
-                             (narrow-to-region (point) (point-max))
-                             (rmail-count-new-messages t)
-                             (rmail-show-message msg)
-                             (setq max nil))
-                         ;; Output file not in rmail mode
-                         ;; => just insert at the end.
-                         (narrow-to-region (point-min) (1+ (buffer-size)))
-                         (goto-char (point-max))
-                         (insert-buffer-substring curbuf beg end))
-                       (or buffer-matches-file
-                           (progn
-                             (if (y-or-n-p (format "Save file %s? "
-                                                   fcc))
-                                 (save-buffer))
-                             (setq dont-write-the-file t))))
-                   (if max (narrow-to-region (point-min) max))))))
-         ;; Append to the file directly,
-         ;; unless we've already taken care of it.
-         (unless dont-write-the-file
-           (if (and (file-exists-p fcc)
-                    ;; Check that the file isn't empty.  We don't
-                    ;; want to insert a newline at the start of an
-                    ;; empty file.
-                    (not (zerop (nth 7 (file-attributes fcc))))
-                    (mail-file-babyl-p fcc))
-               ;; If the file is a Babyl file,
-               ;; convert the message to Babyl format.
-               (let ((coding-system-for-write
-                      (or rmail-file-coding-system
-                          'emacs-mule)))
-                 (with-current-buffer (get-buffer-create " mail-temp")
-                   (setq buffer-read-only nil)
-                   (erase-buffer)
-                   (insert "\C-l\n0, unseen,,\n*** EOOH ***\nDate: "
-                           (mail-rfc822-date) "\n")
-                   (insert-buffer-substring curbuf beg2 end)
-                   (insert "\n\C-_")
-                   (write-region (point-min) (point-max) fcc t)
-                   (erase-buffer)))
-             (write-region
-              (1+ (point-min)) (point-max) fcc t)))
-         (and buffer (not dont-write-the-file)
-              (with-current-buffer buffer
-                (set-visited-file-modtime))))))
-    (kill-buffer tembuf)))
+      (let ((case-fold-search t))
+       (while (re-search-forward "^FCC:[ \t]*" header-end t)
+         (push (buffer-substring (point)
+                                 (progn
+                                   (end-of-line)
+                                   (skip-chars-backward " \t")
+                                   (point)))
+               fcc-list)
+         (delete-region (match-beginning 0)
+                        (progn (forward-line 1) (point)))))
+      (with-temp-buffer
+       ;; This initial newline is not written out if we create a new
+       ;; file (see below).
+       (insert "\nFrom " (user-login-name) " " (current-time-string time) "\n")
+       ;; Insert the time zone before the year.
+       (forward-char -1)
+       (forward-word -1)
+       (require 'mail-utils)
+       (insert (mail-rfc822-time-zone time) " ")
+       (goto-char (point-max))
+       (insert-buffer-substring mailbuf)
+       ;; Make sure messages are separated.
+       (goto-char (point-max))
+       (insert ?\n)
+       (goto-char 2)
+       ;; ``Quote'' "^From " as ">From "
+       ;;  (note that this isn't really quoting, as there is no requirement
+       ;;   that "^[>]+From " be quoted in the same transparent way.)
+       (let ((case-fold-search nil))
+         (while (search-forward "\nFrom " nil t)
+           (forward-char -5)
+           (insert ?>)))
+       (dolist (fcc fcc-list)
+         (let* ((buffer (find-buffer-visiting fcc))
+                (curbuf (current-buffer))
+                dont-write-the-file
+                buffer-matches-file
+                (beg (point-min))      ; the initial blank line
+                (end (point-max))
+                ;; After the ^From line.
+                (beg2 (save-excursion (goto-char (point-min))
+                                      (forward-line 2) (point))))
+           (if buffer
+               ;; File is present in a buffer => append to that buffer.
+               (with-current-buffer buffer
+                 (setq buffer-matches-file
+                       (and (not (buffer-modified-p))
+                            (verify-visited-file-modtime buffer)))
+                 (let ((msg (bound-and-true-p rmail-current-message))
+                       (buffer-read-only nil))
+                   ;; If MSG is non-nil, buffer is in Rmail mode.
+                   (if msg
+                       (let ((buff (generate-new-buffer " *mail-do-fcc")))
+                         (unwind-protect
+                             (progn
+                               (with-current-buffer buff
+                                 (insert-buffer-substring curbuf (1+ beg) end))
+                               (rmail-output-to-rmail-buffer buff msg))
+                           (kill-buffer buff)))
+                     ;; Output file not in Rmail mode => just insert
+                     ;; at the end.
+                     (save-restriction
+                       (widen)
+                       (goto-char (point-max))
+                       (insert-buffer-substring curbuf beg end)))
+                   ;; Offer to save the buffer if it was modified
+                   ;; before we started.
+                   (unless buffer-matches-file
+                     (if (y-or-n-p (format "Save file %s? " fcc))
+                         (save-buffer))
+                     (setq dont-write-the-file t)))))
+           ;; Append to the file directly, unless we've already taken
+           ;; care of it.
+           (unless dont-write-the-file
+             (if (and (file-exists-p fcc)
+                      (mail-file-babyl-p fcc))
+                 ;; If the file is a Babyl file, convert the message to
+                 ;; Babyl format.  Even though Rmail no longer uses
+                 ;; Babyl, this code can remain for the time being, on
+                 ;; the off-chance one FCCs to a Babyl file that has
+                 ;; not yet been converted to mbox.
+                 (let ((coding-system-for-write
+                        (or rmail-file-coding-system 'emacs-mule)))
+                   (with-temp-buffer
+                     (insert "\C-l\n0, unseen,,\n*** EOOH ***\nDate: "
+                             (mail-rfc822-date) "\n")
+                     (insert-buffer-substring curbuf beg2 end)
+                     (insert "\n\C-_")
+                     (write-region (point-min) (point-max) fcc t)))
+               ;; Ensure there is a blank line between messages, but
+               ;; not at the very start of the file.
+               (write-region (if (file-exists-p fcc)
+                                 (point-min)
+                               (1+ (point-min)))
+                             (point-max) fcc t)))
+           (and buffer (not dont-write-the-file)
+                (with-current-buffer buffer
+                  (set-visited-file-modtime)))))))))
 
 (defun mail-sent-via ()
   "Make a Sent-via header line from each To or CC header line."
@@ -1461,7 +1453,7 @@ However, if `mail-yank-prefix' is non-nil, insert that prefix on each line."
          (forward-line 1))))))
 
 (defun mail-yank-original (arg)
-  "Insert the message being replied to, if any (in rmail).
+  "Insert the message being replied to, if any (in Rmail).
 Puts point after the text and mark before.
 Normally, indents each nonblank line ARG spaces (default 3).
 However, if `mail-yank-prefix' is non-nil, insert that prefix on each line.
index 5754e05..2c03a90 100644 (file)
@@ -1,3 +1,13 @@
+2009-02-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * 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  <yamaoka@jpl.org>
+
+       * gnus-dired.el: Tell autoload that gnus-setup-message is a macro.
+
 2009-02-18  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-nocem.el (gnus-nocem-groups): Remove invalid NoCeM groups.
 
        * gnus-art.el (gnus-button-alist): Recognize Konqueror info links.
 
+2009-02-15  Glenn Morris  <rgm@gnu.org>
+
+       * 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  <rgm@gnu.org>
+
+       * 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  <rgm@gnu.org>
+
+       * 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  <rgm@gnu.org>
 
        * gnus-sum.el (gnus-summary-next-article): XEmacs-friendly version of
index d855b3d..91fccf7 100644 (file)
@@ -537,6 +537,7 @@ that the symbol of the saver function, which is specified by
   :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 @@ Directory to save to is default to `gnus-article-save-directory'."
     (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 @@ Directory to save to is default to `gnus-article-save-directory'."
        (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 3009913..a610991 100644 (file)
@@ -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 @@ filenames."
                                    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 d37bdf3..3827bc1 100644 (file)
@@ -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 @@ with potentially long computations."
      (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 @@ with potentially long computations."
       (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 a59211e..d1f719e 100644 (file)
@@ -2802,9 +2802,6 @@ gnus-registry.el will populate this if it's loaded.")
 
 (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 @@ gnus-registry.el will populate this if it's loaded.")
      ("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 ee71162..89dceb3 100644 (file)
@@ -1824,7 +1824,6 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'."
 (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")
 
 \f
@@ -5222,6 +5221,13 @@ Otherwise, generate and save a value for `canlock-password' first."
            (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 @@ is for the internal use."
       (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.
index 9ca837f..5ab3f3a 100644 (file)
@@ -1,3 +1,19 @@
+2009-02-26  Glenn Morris  <rgm@gnu.org>
+
+       * gnus.texi: Minor updates for mbox Rmail.
+
+2009-02-26  Karl Berry  <karl@gnu.org>
+
+       * gnus-coding.texi,
+       * gnus.texi,
+       * message.texi,
+       * pgg.texi,
+       * sasl.texi,
+       * sieve.texi: Consistently use @insertcopying in the Top node,
+       @contents at the front (after @end titlepage),
+       and @direntry after @copying.
+       (Bug#1988)
+
 2009-02-20  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * dir: Add auth.texi.
@@ -6284,7 +6300,7 @@ Thu Feb 25 00:28:49 1999  Shenghuo ZHU  <zsh@cs.rochester.edu>
        * gnus.texi (Mail Folders): Addition.
 
     Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-    2007, 2008 Free Software Foundation, Inc.
+    2007, 2008, 2009 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
index 50c39bd..d66790c 100644 (file)
@@ -47,6 +47,8 @@ developing GNU and promoting software freedom.''
 @insertcopying
 @end titlepage
 
+@contents
+
 @node Top
 @top Emacs MIME
 
@@ -66,6 +68,10 @@ Procedures), RFC2049 (Conformance Criteria and Examples).  It is highly
 recommended that anyone who intends writing @acronym{MIME}-compliant software
 read at least RFC2045 and RFC2047.
 
+@ifnottex
+@insertcopying
+@end ifnottex
+
 @menu
 * Decoding and Viewing::  A framework for decoding and viewing.
 * Composing::             @acronym{MML}; a language for describing @acronym{MIME} parts.
@@ -1873,8 +1879,6 @@ Documentation of the text/plain format parameter for flowed text.
 @chapter Index
 @printindex cp
 
-@summarycontents
-@contents
 @bye
 
 \f
index 324cba4..a384e8b 100644 (file)
@@ -7,7 +7,8 @@
 @syncodeindex pg cp
 
 @copying
-Copyright (C) 2004, 2005, 2007, 2008, 2009  Free Software Foundation, Inc.
+Copyright @copyright{} 2004, 2005, 2007, 2008, 2009  Free Software
+Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -42,9 +43,14 @@ license to the document, as described in section 6 of the license.
 @c anyway hoping that it might annoy someone enough to fix it.  ;-)
 @c Fixing only a paragraph also is appreciated.
 
+@ifnottex
 @node Top
 @top Gnus Coding Style and Maintainance Guide
 This manual describes @dots{}
+
+@insertcopying 
+@end ifnottex
+
 @menu
 * Gnus Coding Style:: Gnus Coding Style
 * Gnus Maintainance Guide:: Gnus Maintainance Guide
index 15d249e..cabf691 100644 (file)
@@ -320,10 +320,6 @@ developing GNU and promoting software freedom.''
 @end iflatex
 @end iftex
 
-@ifnottex
-@insertcopying
-@end ifnottex
-
 @dircategory Emacs
 @direntry
 * Gnus: (gnus).         The newsreader Gnus.
@@ -331,8 +327,6 @@ developing GNU and promoting software freedom.''
 @iftex
 @finalout
 @end iftex
-@setchapternewpage odd
-
 
 
 @titlepage
@@ -344,6 +338,8 @@ developing GNU and promoting software freedom.''
 @insertcopying
 @end titlepage
 
+@summarycontents
+@contents
 
 @node Top
 @top The Gnus Newsreader
@@ -358,6 +354,10 @@ luck.
 @c Adjust ../Makefile.in if you change the following line:
 This manual corresponds to No Gnus v0.11.
 
+@ifnottex
+@insertcopying
+@end ifnottex
+
 @end ifinfo
 
 @iftex
@@ -684,7 +684,7 @@ Mail Sources
 Choosing a Mail Back End
 
 * Unix Mail Box::               Using the (quite) standard Un*x mbox.
-* Rmail Babyl::                 Emacs programs use the Rmail Babyl format.
+* Babyl::                       Babyl was used by older versions of Rmail.
 * Mail Spool::                  Store your mail in a private spool?
 * MH Spool::                    An mhspool-like back end.
 * Maildir::                     Another one-file-per-message format.
@@ -2208,7 +2208,7 @@ means Gnus never ignores old articles.
 @vindex gnus-auto-select-subject
 If @code{gnus-auto-select-first} is non-@code{nil}, select an article
 automatically when entering a group with the @kbd{SPACE} command.
-Which article this is is controlled by the
+Which article this is controlled by the
 @code{gnus-auto-select-subject} variable.  Valid values for this
 variable are:
 
@@ -4390,7 +4390,7 @@ FIXME: As a first step, convert the commentary of @file{nnir} to texi.
 @node nnmairix
 @subsection nnmairix
 
-@cindex mairix 
+@cindex mairix
 @cindex nnmairix
 This paragraph describes how to set up mairix and the back end
 @code{nnmairix} for indexing and searching your mail from within
@@ -4480,7 +4480,7 @@ to certain mairix searches.  This way, you can easily create a group
 containing mails from a certain sender, with a certain subject line or
 even for one specific thread based on the Message-ID.  If you check for
 new mail in these folders (e.g. by pressing @kbd{g} or @kbd{M-g}), they
-automatically update themselves by calling mairix. 
+automatically update themselves by calling mairix.
 
 You might ask why you need @code{nnmairix} at all, since mairix already
 creates the group, populates it with links to the mails so that you can
@@ -8524,7 +8524,8 @@ Save the current article in a Unix mail box (mbox) file
 @kindex O r (Summary)
 @findex gnus-summary-save-article-rmail
 Save the current article in Rmail format
-(@code{gnus-summary-save-article-rmail}).
+(@code{gnus-summary-save-article-rmail}).  This is mbox since Emacs 23,
+Babyl in older versions.
 
 @item O f
 @kindex O f (Summary)
@@ -8610,7 +8611,11 @@ functions below, or you can create your own.
 @findex gnus-summary-save-in-rmail
 @vindex gnus-rmail-save-name
 @findex gnus-plain-save-name
-This is the default format, @dfn{Babyl}.  Uses the function in the
+This is the default format, that used by the Rmail package.  Since Emacs
+23, Rmail uses standard mbox format.  Before this, it used the
+@dfn{Babyl} format.  Accordingly, this command writes mbox format since
+Emacs 23, unless appending to an existing Babyl file.  In older versions
+of Emacs, it always uses Babyl format.  Uses the function in the
 @code{gnus-rmail-save-name} variable to get a file name to save the
 article in.  The default is @code{gnus-plain-save-name}.
 
@@ -14470,7 +14475,7 @@ List of strings to be used as the switches to
 Does essentially the same, but uses @code{telnet} instead of @samp{netcat}
 to connect to the real @acronym{NNTP} server from the intermediate host.
 @code{telnet} is a bit less robust because of things like
-line-end-conversion, but sometimes @code{netcat} is simply not available.  
+line-end-conversion, but sometimes @code{netcat} is simply not available.
 
 @code{nntp-open-via-rlogin-and-telnet}-specific variables:
 
@@ -16473,8 +16478,8 @@ mail, which should help.
 @vindex nnmh-get-new-mail
 @vindex nnfolder-get-new-mail
 This might be too much, if, for instance, you are reading mail quite
-happily with @code{nnml} and just want to peek at some old Rmail
-file you have stashed away with @code{nnbabyl}.  All back ends have
+happily with @code{nnml} and just want to peek at some old (pre-Emacs
+23) Rmail file you have stashed away with @code{nnbabyl}.  All back ends have
 variables called back-end-@code{get-new-mail}.  If you want to disable
 the @code{nnbabyl} mail reading, you edit the virtual server for the
 group to have a setting where @code{nnbabyl-get-new-mail} to @code{nil}.
@@ -16498,7 +16503,7 @@ Spool}).
 
 @menu
 * Unix Mail Box::               Using the (quite) standard Un*x mbox.
-* Rmail Babyl::                 Emacs programs use the Rmail Babyl format.
+* Babyl::                       Babyl was used by older versions of Rmail.
 * Mail Spool::                  Store your mail in a private spool?
 * MH Spool::                    An mhspool-like back end.
 * Maildir::                     Another one-file-per-message format.
@@ -16538,27 +16543,26 @@ into groups.  Default is @code{t}.
 @end table
 
 
-@node Rmail Babyl
-@subsubsection Rmail Babyl
+@node Babyl
+@subsubsection Babyl
 @cindex nnbabyl
-@cindex Rmail mbox
 
 @vindex nnbabyl-active-file
 @vindex nnbabyl-mbox-file
-The @dfn{nnbabyl} back end will use a Babyl mail box (aka. @dfn{Rmail
-mbox}) to store mail.  @code{nnbabyl} will add extra headers to each
-mail article to say which group it belongs in.
+The @dfn{nnbabyl} back end will use a Babyl mail box to store mail.
+@code{nnbabyl} will add extra headers to each mail article to say which
+group it belongs in.
 
 Virtual server settings:
 
 @table @code
 @item nnbabyl-mbox-file
 @vindex nnbabyl-mbox-file
-The name of the Rmail mbox file.  The default is @file{~/RMAIL}
+The name of the Babyl file.  The default is @file{~/RMAIL}
 
 @item nnbabyl-active-file
 @vindex nnbabyl-active-file
-The name of the active file for the rmail box.  The default is
+The name of the active file for the Babyl file.  The default is
 @file{~/.rmail-active}
 
 @item nnbabyl-get-new-mail
@@ -17154,7 +17158,8 @@ to understand the mail files folks already had in existence.  Gnus (and
 VM, for that matter) continue to support this format because it's
 perceived as having some good qualities in those mailer-specific
 headers/status bits stuff.  Rmail itself still exists as well, of
-course, and is still maintained by Stallman.
+course, and is still maintained within Emacs.  Since Emacs 23, it
+uses standard mbox format rather than Babyl.
 
 Both of the above forms leave your mail in a single file on your
 file system, and they must parse that entire file each time you take a
@@ -18640,9 +18645,8 @@ as a newsgroup.  Several files types are supported:
 
 @table @code
 @cindex Babyl
-@cindex Rmail mbox
 @item babyl
-The Babyl (Rmail) mail box.
+The Babyl format.
 
 @cindex mbox
 @cindex Unix mbox
@@ -25036,7 +25040,7 @@ the value @samp{spam} means @samp{nnimap+your-server:spam}.  The value
 @vindex nnimap-split-download-body
 Note for IMAP users: if you use the @code{spam-check-bogofilter},
 @code{spam-check-ifile}, and @code{spam-check-stat} spam back ends,
-you should also set set the variable @code{nnimap-split-download-body}
+you should also set the variable @code{nnimap-split-download-body}
 to @code{t}.  These spam back ends are most useful when they can
 ``scan'' the full message body.  By default, the nnimap back end only
 retrieves the message headers; @code{nnimap-split-download-body} tells
@@ -26594,10 +26598,10 @@ of all messages matching a particular set of criteria.
 @end enumerate
 
 @menu
-* Setup::                       
-* Fancy splitting to parent::   
-* Store custom flags and keywords::  
-* Store arbitrary data::        
+* Setup::
+* Fancy splitting to parent::
+* Store custom flags and keywords::
+* Store arbitrary data::
 @end menu
 
 @node Setup
@@ -28830,6 +28834,7 @@ was inserted directly.
 @item
 @code{message-insinuate-rmail}
 
+@c FIXME should that not be 'message-user-agent?
 Adding @code{(message-insinuate-rmail)} and @code{(setq
 mail-user-agent 'gnus-user-agent)} in @file{.emacs} convinces Rmail to
 compose, reply and forward messages in message-mode, where you can
@@ -30516,7 +30521,7 @@ Below is a slightly shortened version of the @code{nndir} back end.
 
 @lisp
 ;;; @r{nndir.el --- single directory newsgroup access for Gnus}
-;; @r{Copyright (C) 1995,96 Free Software Foundation, Inc.}
+;; @r{Copyright (C) 1995,1996 Free Software Foundation, Inc.}
 
 ;;; @r{Code:}
 
@@ -31276,8 +31281,6 @@ former).  The manual is unambiguous, but it can be confusing.
 @chapter Key Index
 @printindex ky
 
-@summarycontents
-@contents
 @bye
 
 @iftex
index a55d81e..f863485 100644 (file)
@@ -32,7 +32,6 @@ developing GNU and promoting software freedom.''
 @iftex
 @finalout
 @end iftex
-@setchapternewpage odd
 
 @titlepage
 @title Message Manual
@@ -43,11 +42,17 @@ developing GNU and promoting software freedom.''
 @vskip 0pt plus 1filll
 @insertcopying
 @end titlepage
-@page
+
+@summarycontents
+@contents
 
 @node Top
 @top Message
 
+@ifnottex
+@insertcopying
+@end ifnottex
+
 All message composition from Gnus (both mail and news) takes place in
 Message mode buffers.
 
@@ -2432,8 +2437,6 @@ basis of the new @code{Cc} header, except if this header is
 @chapter Key Index
 @printindex ky
 
-@summarycontents
-@contents
 @bye
 
 @c End:
index 9f0a21a..871e1ba 100644 (file)
@@ -1,12 +1,13 @@
 \input texinfo                  @c -*-texinfo-*-
 
 @setfilename pgg
+@settitle PGG @value{VERSION}
 
 @set VERSION 0.1
 
-
 @copying
-This file describes PGG, an Emacs interface to various PGP implementations.
+This file describes PGG @value{VERSION}, an Emacs interface to various
+PGP implementations.
 
 Copyright @copyright{} 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 Free Software Foundation, Inc.
@@ -30,9 +31,6 @@ developing GNU and promoting software freedom.''
 * PGG: (pgg).   Emacs interface to various PGP implementations.
 @end direntry
 
-@settitle PGG @value{VERSION}
-
-
 @titlepage
 @title PGG
 
@@ -42,14 +40,20 @@ developing GNU and promoting software freedom.''
 @vskip 0pt plus 1filll
 @insertcopying
 @end titlepage
-@page
+
+@contents
 
 @node Top
 @top PGG
-This manual describes PGG.  PGG is an interface library between Emacs
+
+PGG is an interface library between Emacs
 and various tools for secure communication.  PGG also provides a simple
 user interface to encrypt, decrypt, sign, and verify MIME messages.
 
+@ifnottex
+@insertcopying 
+@end ifnottex
+
 @menu
 * Overview::                    What PGG is.
 * Prerequisites::               Complicated stuff you may have to do.
@@ -491,8 +495,6 @@ If non-@code{nil}, don't check the checksum of the packets.
 @unnumbered Variable Index
 @printindex vr
 
-@summarycontents
-@contents
 @bye
 
 @c End:
index 1d15eed..75c352a 100644 (file)
@@ -3,16 +3,10 @@
 @setfilename sasl.info
 
 @set VERSION 0.2
-
-@dircategory Emacs
-@direntry
-* SASL: (sasl).   The Emacs SASL library.
-@end direntry
-
 @settitle Emacs SASL Library @value{VERSION}
 
 @copying
-This file describes the Emacs SASL library.
+This file describes the Emacs SASL library, version @value{VERSION}.
 
 Copyright @copyright{} 2000, 2004, 2005, 2006, 2007, 2008, 2009
 Free Software Foundation, Inc.
@@ -37,10 +31,14 @@ license to the document, as described in section 6 of the license.
 @end quotation
 @end copying
 
-@tex
+@dircategory Emacs
+@direntry
+* SASL: (sasl).   The Emacs SASL library.
+@end direntry
+
 
 @titlepage
-@title Emacs SASL Library
+@title Emacs SASL Library @value{VERSION}
 
 @author by Daiki Ueno
 @page
@@ -48,17 +46,18 @@ license to the document, as described in section 6 of the license.
 @vskip 0pt plus 1filll
 @insertcopying
 @end titlepage
-@page
 
-@end tex
 
 @node Top
 @top Emacs SASL
-This manual describes the Emacs SASL library.
 
-A common interface to share several authentication mechanisms between
+SASL is a common interface to share several authentication mechanisms between
 applications using different protocols.
 
+@ifnottex
+@insertcopying 
+@end ifnottex
+
 @menu
 * Overview::                    What Emacs SASL library is.
 * How to use::                  Adding authentication support to your applications.
index 45b7aa6..c95f36c 100644 (file)
@@ -44,13 +44,13 @@ developing GNU and promoting software freedom.''
 @insertcopying
 @end titlepage
 
+@summarycontents
+@contents
 
 @node Top
 @top Sieve Support for Emacs
 
-This manual documents the Emacs Sieve package.
-
-It is intended as a users manual for Sieve Mode and Manage Sieve, and
+This is intended as a users manual for Sieve Mode and Manage Sieve, and
 as a reference manual for the @samp{sieve-manage} protocol Emacs Lisp
 API.
 
@@ -58,7 +58,9 @@ Sieve is a language for server-side filtering of mail.  The language
 is documented in RFC 3028.  This manual does not attempt to document
 the language, so keep RFC 3028 around.
 
-A good online Sieve resources is @uref{http://www.cyrusoft.com/sieve/}.
+@ifnottex
+@insertcopying
+@end ifnottex
 
 @menu
 * Installation::          Getting ready to use the package.
@@ -352,8 +354,6 @@ A Protocol for Remotely Managing Sieve Scripts
 @unnumbered Index
 @printindex cp
 
-@summarycontents
-@contents
 @bye
 
 @c End: