Commit 43c2d6cf authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

Require sendmail.

(mail-hist-current-header-name): Use mail-text-start.
(mail-hist-forward-header): Use mail-header-end.
(mail-hist-current-header-contents): Use mail-header-start.
(mail-hist-put-headers-into-history): Use mail-text-start.
parent 30eaaa34
......@@ -55,6 +55,7 @@
;;; Code:
(require 'ring)
(require 'sendmail)
(defgroup mail-hist nil
"Headers and message body history for outgoing mail."
......@@ -104,17 +105,11 @@ Oldest elements are dumped first."
"Get name of mail header point is currently in, without the colon.
Returns nil if not in a header, implying that point is in the body of
the message."
(if (save-excursion
(re-search-backward (concat "^" (regexp-quote mail-header-separator)
nil t))
(if (< (point) (mail-text-start))
nil ; then we are in the body of the message
(let* ((body-start ; limit possibility of false headers
(concat "^" (regexp-quote mail-header-separator) "$")
nil t)))
(let* ((body-start
(re-search-backward mail-hist-header-regexp nil t))
......@@ -132,12 +127,9 @@ nil.
Places point on the first non-whitespace on the line following the
colon after the header name, or on the second space following that if
the header is empty."
(let ((boundary (save-excursion
(concat "^" (regexp-quote mail-header-separator) "$")
nil t))))
(let ((boundary (mail-header-end)))
(> boundary 0)
(let ((unstopped t))
(setq boundary (save-excursion
(goto-char boundary)
......@@ -180,8 +172,7 @@ colon, or just after the colon if it is not followed by whitespace."
(let ((start (point)))
(or (mail-hist-forward-header 1)
(concat "^" (regexp-quote mail-header-separator) "$")))
(goto-char (mail-header-start)))
(buffer-substring start (1- (point))))))
......@@ -235,13 +226,7 @@ This function normally would be called when the message is sent."
(let ((body-contents
(goto-char (point-min))
(concat "^" (regexp-quote mail-header-separator) "$")
(forward-line 1)
(buffer-substring (point) (point-max)))))
(buffer-substring (mail-text-start) (point-max))))
(mail-hist-add-header-contents-to-ring "body" body-contents)))))
(defun mail-hist-previous-input (header)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment