1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

(mail-hist-put-headers-into-history)

(mail-hist-current-header-contents, mail-hist-forward-header)
(mail-hist-current-header-name):
Use regexp-quote on mail-header-separator.
This commit is contained in:
Richard M. Stallman 1994-10-11 00:35:42 +00:00
parent 22486a7f29
commit 0ea48932ec

View file

@ -99,12 +99,15 @@ Oldest elements are dumped first.")
Returns nil if not in a header, implying that point is in the body of
the message."
(if (save-excursion
(re-search-backward (concat "^" mail-header-separator) nil t))
(re-search-backward (concat "^" (regexp-quote mail-header-separator))
nil t))
nil ; then we are in the body of the message
(save-excursion
(let* ((body-start ; limit possibility of false headers
(save-excursion
(re-search-forward (concat "^" mail-header-separator) nil t)))
(re-search-forward
(concat "^" (regexp-quote mail-header-separator))
nil t)))
(name-start
(re-search-backward mail-hist-header-regexp nil t))
(name-end
@ -123,7 +126,9 @@ 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
(re-search-forward (concat "^" mail-header-separator) nil t))))
(re-search-forward
(concat "^" (regexp-quote mail-header-separator))
nil t))))
(and
boundary
(let ((unstopped t))
@ -168,7 +173,8 @@ colon, or just after the colon if it is not followed by whitespace."
(mail-hist-beginning-of-header)
(let ((start (point)))
(or (mail-hist-forward-header 1)
(re-search-forward (concat "^" mail-header-separator)))
(re-search-forward
(concat "^" (regexp-quote mail-header-separator))))
(beginning-of-line)
(buffer-substring start (1- (point))))))
@ -212,7 +218,9 @@ This function normally would be called when the message is sent."
(let ((body-contents
(save-excursion
(goto-char (point-min))
(re-search-forward (concat "^" mail-header-separator) nil)
(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)))))