From: Richard M. Stallman Date: Tue, 11 Oct 1994 00:35:42 +0000 (+0000) Subject: (mail-hist-put-headers-into-history) X-Git-Tag: emacs-19.34~6429 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ea48932ec3886c4ec1cd16447ca28002e674bf3;p=emacs.git (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. --- diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el index 0c5c9ac57c2..3c9db59b502 100644 --- a/lisp/mail/mail-hist.el +++ b/lisp/mail/mail-hist.el @@ -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)))))