]> git.eshelyaron.com Git - emacs.git/commitdiff
(mail-hist-put-headers-into-history)
authorRichard M. Stallman <rms@gnu.org>
Tue, 11 Oct 1994 00:35:42 +0000 (00:35 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 11 Oct 1994 00:35:42 +0000 (00:35 +0000)
(mail-hist-current-header-contents, mail-hist-forward-header)
(mail-hist-current-header-name):
Use regexp-quote on mail-header-separator.

lisp/mail/mail-hist.el

index 0c5c9ac57c261a8766f95331b1589b61f2ea7e12..3c9db59b50255289ec87544a305612bb6f373fc9 100644 (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)))))