;;; 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-2015 Free Software
+;; Foundation, Inc.
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
;; Keywords: mail
;; This file is part of GNU Emacs.
: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
(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)
(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")))
(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")
(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
(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."
(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))
(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