Changes committed gnus/contrib (ChangeLog sendmail.el)
"Miles Bader" <[email protected]> Fri, 27 Feb 2009 00:35:59 +0100
| Newsgroups | gmane.emacs.gnus.commits |
|---|---|
| Message-ID | <[email protected]> |
Modified: ChangeLog sendmail.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/contrib/ChangeLog:7.81 gnus/contrib/ChangeLog:7.82 --- ChangeLog:7.81 Thu Feb 5 10:04:10 2009 +++ ChangeLog Fri Feb 27 00:35:59 2009 @@ -1,3 +1,14 @@ +2009-02-26 Tobias C. Rittweiler <[email protected]> (tiny change) + + * sendmail.el (sendmail-send-it): `call-process-region' can return a + string. (Bug#2428) + +2009-02-07 Glenn Morris <[email protected]> + + * 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 <[email protected]> * sendmail.el (mail-bury): Revert previous change now pmail is no more. Index: sendmail.el diff -u gnus/contrib/sendmail.el:7.14 gnus/contrib/sendmail.el:7.15 --- sendmail.el:7.14 Thu Feb 5 10:04:10 2009 +++ sendmail.el Fri Feb 27 00:35:59 2009 @@ -428,9 +428,9 @@ ;;;###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 @@ (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 @@ ) ) (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 @@ (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 @@ (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.