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.
This commit is contained in:
parent
30eaaa34b1
commit
43c2d6cfb5
1 changed files with 8 additions and 23 deletions
|
@ -55,6 +55,7 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(require 'ring)
|
(require 'ring)
|
||||||
|
(require 'sendmail)
|
||||||
|
|
||||||
(defgroup mail-hist nil
|
(defgroup mail-hist nil
|
||||||
"Headers and message body history for outgoing mail."
|
"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.
|
"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
|
Returns nil if not in a header, implying that point is in the body of
|
||||||
the message."
|
the message."
|
||||||
(if (save-excursion
|
(if (< (point) (mail-text-start))
|
||||||
(re-search-backward (concat "^" (regexp-quote mail-header-separator)
|
|
||||||
"$")
|
|
||||||
nil t))
|
|
||||||
nil ; then we are in the body of the message
|
nil ; then we are in the body of the message
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let* ((body-start ; limit possibility of false headers
|
(let* ((body-start
|
||||||
(save-excursion
|
(mail-text-start))
|
||||||
(re-search-forward
|
|
||||||
(concat "^" (regexp-quote mail-header-separator) "$")
|
|
||||||
nil t)))
|
|
||||||
(name-start
|
(name-start
|
||||||
(re-search-backward mail-hist-header-regexp nil t))
|
(re-search-backward mail-hist-header-regexp nil t))
|
||||||
(name-end
|
(name-end
|
||||||
|
@ -132,12 +127,9 @@ nil.
|
||||||
Places point on the first non-whitespace on the line following the
|
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
|
colon after the header name, or on the second space following that if
|
||||||
the header is empty."
|
the header is empty."
|
||||||
(let ((boundary (save-excursion
|
(let ((boundary (mail-header-end)))
|
||||||
(re-search-forward
|
|
||||||
(concat "^" (regexp-quote mail-header-separator) "$")
|
|
||||||
nil t))))
|
|
||||||
(and
|
(and
|
||||||
boundary
|
(> boundary 0)
|
||||||
(let ((unstopped t))
|
(let ((unstopped t))
|
||||||
(setq boundary (save-excursion
|
(setq boundary (save-excursion
|
||||||
(goto-char boundary)
|
(goto-char boundary)
|
||||||
|
@ -180,8 +172,7 @@ colon, or just after the colon if it is not followed by whitespace."
|
||||||
(mail-hist-beginning-of-header)
|
(mail-hist-beginning-of-header)
|
||||||
(let ((start (point)))
|
(let ((start (point)))
|
||||||
(or (mail-hist-forward-header 1)
|
(or (mail-hist-forward-header 1)
|
||||||
(re-search-forward
|
(goto-char (mail-header-start)))
|
||||||
(concat "^" (regexp-quote mail-header-separator) "$")))
|
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(buffer-substring start (1- (point))))))
|
(buffer-substring start (1- (point))))))
|
||||||
|
|
||||||
|
@ -235,13 +226,7 @@ This function normally would be called when the message is sent."
|
||||||
(mail-hist-add-header-contents-to-ring
|
(mail-hist-add-header-contents-to-ring
|
||||||
(mail-hist-current-header-name)))
|
(mail-hist-current-header-name)))
|
||||||
(let ((body-contents
|
(let ((body-contents
|
||||||
(save-excursion
|
(buffer-substring (mail-text-start) (point-max))))
|
||||||
(goto-char (point-min))
|
|
||||||
(re-search-forward
|
|
||||||
(concat "^" (regexp-quote mail-header-separator) "$")
|
|
||||||
nil)
|
|
||||||
(forward-line 1)
|
|
||||||
(buffer-substring (point) (point-max)))))
|
|
||||||
(mail-hist-add-header-contents-to-ring "body" body-contents)))))
|
(mail-hist-add-header-contents-to-ring "body" body-contents)))))
|
||||||
|
|
||||||
(defun mail-hist-previous-input (header)
|
(defun mail-hist-previous-input (header)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue