Replace "Maintainer: FSF" with the emacs-devel mailing address
[bpt/emacs.git] / lisp / mail / sendmail.el
index 3b262e3..76764ce 100644 (file)
@@ -1,9 +1,9 @@
 ;;; sendmail.el --- mail sending commands for Emacs
 
-;; Copyright (C) 1985-1986, 1992-1996, 1998, 2000-2012
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-1996, 1998, 2000-2014 Free Software
+;; Foundation, Inc.
 
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
@@ -243,15 +243,14 @@ Used by `mail-yank-original' via `mail-indent-citation'."
   :type 'integer
   :group 'sendmail)
 
-;; FIXME make it really obsolete.
 (defvar mail-yank-hooks nil
   "Obsolete hook for modifying a citation just inserted in the mail buffer.
 Each hook function can find the citation between (point) and (mark t).
 And each hook function should leave point and mark around the citation
 text as modified.
-
 This is a normal hook, misnamed for historical reasons.
-It is semi-obsolete and mail agents should no longer use it.")
+It is obsolete and mail agents should no longer use it.")
+(make-obsolete-variable 'mail-yank-hooks 'mail-citation-hook "19.34")
 
 ;;;###autoload
 (defcustom mail-citation-hook nil
@@ -616,7 +615,7 @@ This also saves the value of `send-mail-function' via Customize."
   ;; (kill-local-variable 'enable-multibyte-characters)
   (set-buffer-multibyte (default-value 'enable-multibyte-characters))
   (if current-input-method
-      (inactivate-input-method))
+      (deactivate-input-method))
 
   ;; Local variables for Mail mode.
   (setq mail-send-actions actions)
@@ -1115,6 +1114,7 @@ external program defined by `sendmail-program'."
   (let ((errbuf (if mail-interactive
                    (generate-new-buffer " sendmail errors")
                  0))
+        (error nil)
        (tembuf (generate-new-buffer " sendmail temp"))
        (multibyte enable-multibyte-characters)
        (case-fold-search nil)
@@ -1279,10 +1279,13 @@ external program defined by `sendmail-program'."
                     (exit-value (apply 'call-process-region args)))
                (cond ((or (null exit-value) (eq 0 exit-value)))
                      ((numberp exit-value)
+                       (setq error t)
                       (error "Sending...failed with exit value %d" exit-value))
                      ((stringp exit-value)
+                       (setq error t)
                       (error "Sending...terminated by signal: %s" exit-value))
                      (t
+                       (setq error t)
                       (error "SENDMAIL-SEND-IT -- fall through: %S" exit-value))))
            (or fcc-was-found
                (error "No recipients")))
@@ -1291,12 +1294,15 @@ external program defined by `sendmail-program'."
                (goto-char (point-min))
                (while (re-search-forward "\n\n* *" nil t)
                  (replace-match "; "))
-               (if (not (zerop (buffer-size)))
-                   (error "Sending...failed to %s"
-                          (buffer-substring (point-min) (point-max)))))))
+               (unless (zerop (buffer-size))
+                  (setq error t)
+                  (error "Sending...failed to %s"
+                         (buffer-substring (point-min) (point-max)))))))
       (kill-buffer tembuf)
-      (if (bufferp errbuf)
-         (kill-buffer errbuf)))))
+      (if (and (bufferp errbuf)
+               (not error))
+          (kill-buffer errbuf)
+        (switch-to-buffer-other-window errbuf)))))
 
 (autoload 'rmail-output-to-rmail-buffer "rmailout")
 
@@ -1414,6 +1420,7 @@ just append to the file, in Babyl format if necessary."
 
 (defun mail-sent-via ()
   "Make a Sent-via header line from each To or CC header line."
+  (declare (obsolete "nobody can remember what it is for." "24.1"))
   (interactive)
   (save-excursion
     ;; put a marker at the end of the header
@@ -1433,9 +1440,6 @@ just append to the file, in Babyl format if necessary."
                                   (point)))))
          ;; Insert a copy, with altered header field name.
          (insert-before-markers "Sent-via:" to-line))))))
-
-(make-obsolete 'mail-sent-via "nobody can remember what it is for." "24.1")
-
 \f
 (defun mail-to ()
   "Move point to end of To field, creating it if necessary."
@@ -1496,6 +1500,9 @@ just append to the file, in Babyl format if necessary."
            (insert "\nMail-Followup-To: "))))
 
 (defun mail-position-on-field (field &optional soft)
+  "Move to the start of the contents of header field FIELD.
+If there is none, insert one, unless SOFT is non-nil.
+If there are multiple FIELD fields, this goes to the first."
   (let (end
        (case-fold-search t))
     (setq end (mail-header-end))
@@ -1970,7 +1977,7 @@ you can move to one of them and type C-c C-c to recover that one."
             (if (not (yes-or-no-p
                       (format "Recover mail draft from auto save file %s? "
                               file-name)))
-                (error "mail-recover cancelled")
+                (error "mail-recover canceled")
               (let ((buffer-read-only nil)
                     (buffer-coding buffer-file-coding-system)
                     ;; Auto-save files are written in internal