diff options
| author | Richard M. Stallman | 1998-04-30 06:30:27 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-04-30 06:30:27 +0000 |
| commit | 43c2d6cfb51bf7064c0ab32cb66537a31eec7d1c (patch) | |
| tree | 9bb6c79868f6072ab2800ffa644b1e8549d6b562 | |
| parent | 30eaaa34b1f7c5856a7da3a25db6d3b4a9f7b158 (diff) | |
| download | emacs-43c2d6cfb51bf7064c0ab32cb66537a31eec7d1c.tar.gz emacs-43c2d6cfb51bf7064c0ab32cb66537a31eec7d1c.zip | |
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.
| -rw-r--r-- | lisp/mail/mail-hist.el | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el index 86dcae229ee..a3465341158 100644 --- a/lisp/mail/mail-hist.el +++ b/lisp/mail/mail-hist.el | |||
| @@ -55,6 +55,7 @@ | |||
| 55 | 55 | ||
| 56 | ;;; Code: | 56 | ;;; Code: |
| 57 | (require 'ring) | 57 | (require 'ring) |
| 58 | (require 'sendmail) | ||
| 58 | 59 | ||
| 59 | (defgroup mail-hist nil | 60 | (defgroup mail-hist nil |
| 60 | "Headers and message body history for outgoing mail." | 61 | "Headers and message body history for outgoing mail." |
| @@ -104,17 +105,11 @@ Oldest elements are dumped first." | |||
| 104 | "Get name of mail header point is currently in, without the colon. | 105 | "Get name of mail header point is currently in, without the colon. |
| 105 | Returns nil if not in a header, implying that point is in the body of | 106 | Returns nil if not in a header, implying that point is in the body of |
| 106 | the message." | 107 | the message." |
| 107 | (if (save-excursion | 108 | (if (< (point) (mail-text-start)) |
| 108 | (re-search-backward (concat "^" (regexp-quote mail-header-separator) | ||
| 109 | "$") | ||
| 110 | nil t)) | ||
| 111 | nil ; then we are in the body of the message | 109 | nil ; then we are in the body of the message |
| 112 | (save-excursion | 110 | (save-excursion |
| 113 | (let* ((body-start ; limit possibility of false headers | 111 | (let* ((body-start |
| 114 | (save-excursion | 112 | (mail-text-start)) |
| 115 | (re-search-forward | ||
| 116 | (concat "^" (regexp-quote mail-header-separator) "$") | ||
| 117 | nil t))) | ||
| 118 | (name-start | 113 | (name-start |
| 119 | (re-search-backward mail-hist-header-regexp nil t)) | 114 | (re-search-backward mail-hist-header-regexp nil t)) |
| 120 | (name-end | 115 | (name-end |
| @@ -132,12 +127,9 @@ nil. | |||
| 132 | Places point on the first non-whitespace on the line following the | 127 | Places point on the first non-whitespace on the line following the |
| 133 | colon after the header name, or on the second space following that if | 128 | colon after the header name, or on the second space following that if |
| 134 | the header is empty." | 129 | the header is empty." |
| 135 | (let ((boundary (save-excursion | 130 | (let ((boundary (mail-header-end))) |
| 136 | (re-search-forward | ||
| 137 | (concat "^" (regexp-quote mail-header-separator) "$") | ||
| 138 | nil t)))) | ||
| 139 | (and | 131 | (and |
| 140 | boundary | 132 | (> boundary 0) |
| 141 | (let ((unstopped t)) | 133 | (let ((unstopped t)) |
| 142 | (setq boundary (save-excursion | 134 | (setq boundary (save-excursion |
| 143 | (goto-char boundary) | 135 | (goto-char boundary) |
| @@ -180,8 +172,7 @@ colon, or just after the colon if it is not followed by whitespace." | |||
| 180 | (mail-hist-beginning-of-header) | 172 | (mail-hist-beginning-of-header) |
| 181 | (let ((start (point))) | 173 | (let ((start (point))) |
| 182 | (or (mail-hist-forward-header 1) | 174 | (or (mail-hist-forward-header 1) |
| 183 | (re-search-forward | 175 | (goto-char (mail-header-start))) |
| 184 | (concat "^" (regexp-quote mail-header-separator) "$"))) | ||
| 185 | (beginning-of-line) | 176 | (beginning-of-line) |
| 186 | (buffer-substring start (1- (point)))))) | 177 | (buffer-substring start (1- (point)))))) |
| 187 | 178 | ||
| @@ -235,13 +226,7 @@ This function normally would be called when the message is sent." | |||
| 235 | (mail-hist-add-header-contents-to-ring | 226 | (mail-hist-add-header-contents-to-ring |
| 236 | (mail-hist-current-header-name))) | 227 | (mail-hist-current-header-name))) |
| 237 | (let ((body-contents | 228 | (let ((body-contents |
| 238 | (save-excursion | 229 | (buffer-substring (mail-text-start) (point-max)))) |
| 239 | (goto-char (point-min)) | ||
| 240 | (re-search-forward | ||
| 241 | (concat "^" (regexp-quote mail-header-separator) "$") | ||
| 242 | nil) | ||
| 243 | (forward-line 1) | ||
| 244 | (buffer-substring (point) (point-max))))) | ||
| 245 | (mail-hist-add-header-contents-to-ring "body" body-contents))))) | 230 | (mail-hist-add-header-contents-to-ring "body" body-contents))))) |
| 246 | 231 | ||
| 247 | (defun mail-hist-previous-input (header) | 232 | (defun mail-hist-previous-input (header) |