aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-10-11 00:35:42 +0000
committerRichard M. Stallman1994-10-11 00:35:42 +0000
commit0ea48932ec3886c4ec1cd16447ca28002e674bf3 (patch)
tree4bc2908a3e32a562ae6aaf0cd9ad23af99fb582c
parent22486a7f29e0163c90d4b6153f442f316d9ed28b (diff)
downloademacs-0ea48932ec3886c4ec1cd16447ca28002e674bf3.tar.gz
emacs-0ea48932ec3886c4ec1cd16447ca28002e674bf3.zip
(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.
-rw-r--r--lisp/mail/mail-hist.el18
1 files changed, 13 insertions, 5 deletions
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.")
99Returns nil if not in a header, implying that point is in the body of 99Returns nil if not in a header, implying that point is in the body of
100the message." 100the message."
101 (if (save-excursion 101 (if (save-excursion
102 (re-search-backward (concat "^" mail-header-separator) nil t)) 102 (re-search-backward (concat "^" (regexp-quote mail-header-separator))
103 nil t))
103 nil ; then we are in the body of the message 104 nil ; then we are in the body of the message
104 (save-excursion 105 (save-excursion
105 (let* ((body-start ; limit possibility of false headers 106 (let* ((body-start ; limit possibility of false headers
106 (save-excursion 107 (save-excursion
107 (re-search-forward (concat "^" mail-header-separator) nil t))) 108 (re-search-forward
109 (concat "^" (regexp-quote mail-header-separator))
110 nil t)))
108 (name-start 111 (name-start
109 (re-search-backward mail-hist-header-regexp nil t)) 112 (re-search-backward mail-hist-header-regexp nil t))
110 (name-end 113 (name-end
@@ -123,7 +126,9 @@ Places point on the first non-whitespace on the line following the
123colon after the header name, or on the second space following that if 126colon after the header name, or on the second space following that if
124the header is empty." 127the header is empty."
125 (let ((boundary (save-excursion 128 (let ((boundary (save-excursion
126 (re-search-forward (concat "^" mail-header-separator) nil t)))) 129 (re-search-forward
130 (concat "^" (regexp-quote mail-header-separator))
131 nil t))))
127 (and 132 (and
128 boundary 133 boundary
129 (let ((unstopped t)) 134 (let ((unstopped t))
@@ -168,7 +173,8 @@ colon, or just after the colon if it is not followed by whitespace."
168 (mail-hist-beginning-of-header) 173 (mail-hist-beginning-of-header)
169 (let ((start (point))) 174 (let ((start (point)))
170 (or (mail-hist-forward-header 1) 175 (or (mail-hist-forward-header 1)
171 (re-search-forward (concat "^" mail-header-separator))) 176 (re-search-forward
177 (concat "^" (regexp-quote mail-header-separator))))
172 (beginning-of-line) 178 (beginning-of-line)
173 (buffer-substring start (1- (point)))))) 179 (buffer-substring start (1- (point))))))
174 180
@@ -212,7 +218,9 @@ This function normally would be called when the message is sent."
212 (let ((body-contents 218 (let ((body-contents
213 (save-excursion 219 (save-excursion
214 (goto-char (point-min)) 220 (goto-char (point-min))
215 (re-search-forward (concat "^" mail-header-separator) nil) 221 (re-search-forward
222 (concat "^" (regexp-quote mail-header-separator))
223 nil)
216 (forward-line 1) 224 (forward-line 1)
217 (buffer-substring (point) (point-max))))) 225 (buffer-substring (point) (point-max)))))
218 (mail-hist-add-header-contents-to-ring "body" body-contents))))) 226 (mail-hist-add-header-contents-to-ring "body" body-contents)))))