Article View: gnu.emacs.bug
Article #87294Re: 19.27, mail-hist.el
From: Karl Fogel
Date: Mon, 10 Oct 1994 16:32
Date: Mon, 10 Oct 1994 16:32
133 lines
5253 bytes
5253 bytes
terra@diku.dk sez:
>mail-hist.el:
>
>(defsubst mail-hist-forward-header (count)
> "Move forward COUNT headers (backward if COUNT is negative).
>If last/first header is encountered first, stop there and returns
>nil.
>
>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))))
>
>`mail-header-separator' should be regexp-quote'd. This appears at
>least five times.
>
>Morten Welinder
>terra@diku.dk
Done, thanks for pointing this out. RMS, here is the log
entry & patch for mail-hist.el:
Mon Oct 10 15:31:01 1994 Karl Fogel (kfogel@phylo)
* mail-hist.el: Regexp-quote all instances of `mail-header-separator'.
*** mail-hist.el~ 1.3 1994/07/16 03:26:04
--- mail-hist.el 1.4 1994/10/10 15:31:01
***************
*** 3,9 ****
;; Author: Karl Fogel <kfogel@cs.oberlin.edu>
;; Created: March, 1994
! ;; Version: 1.3
;; Keywords: mail, history
;; This file is part of GNU Emacs.
--- 3,9 ----
;; Author: Karl Fogel <kfogel@cs.oberlin.edu>
;; Created: March, 1994
! ;; Version: 1.3.1
;; Keywords: mail, history
;; This file is part of GNU Emacs.
***************
*** 99,110 ****
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))
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)))
(name-start
(re-search-backward mail-hist-header-regexp nil t))
(name-end
--- 99,112 ----
Returns nil if not in a header, implying that point is in the body of
the message."
(if (save-excursion
! (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 "^" (regexp-quote mail-header-separator)) nil t)))
(name-start
(re-search-backward mail-hist-header-regexp nil t))
(name-end
***************
*** 123,129 ****
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))))
(and
boundary
(let ((unstopped t))
--- 125,132 ----
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 "^" (regexp-quote mail-header-separator)) nil t))))
(and
boundary
(let ((unstopped t))
***************
*** 168,174 ****
(mail-hist-beginning-of-header)
(let ((start (point)))
(or (mail-hist-forward-header 1)
! (re-search-forward (concat "^" mail-header-separator)))
(beginning-of-line)
(buffer-substring start (1- (point))))))
--- 171,178 ----
(mail-hist-beginning-of-header)
(let ((start (point)))
(or (mail-hist-forward-header 1)
! (re-search-forward
! (concat "^" (regexp-quote mail-header-separator))))
(beginning-of-line)
(buffer-substring start (1- (point))))))
***************
*** 212,218 ****
(let ((body-contents
(save-excursion
(goto-char (point-min))
! (re-search-forward (concat "^" mail-header-separator) nil)
(forward-line 1)
(buffer-substring (point) (point-max)))))
(mail-hist-add-header-contents-to-ring "body" body-contents)))))
--- 216,223 ----
(let ((body-contents
(save-excursion
(goto-char (point-min))
! (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)))))
Technical Details
Message-ID:
<199410101536.AA00313@phylo.life.uiuc.edu>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!phylo.life.uiuc.edu!kfogelShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,eb4c7b224a8c071d X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-10-10 17:14:10 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!phylo.life.uiuc.edu!kfogel From: kfogel@phylo.life.uiuc.edu (Karl Fogel) Newsgroups: gnu.emacs.bug Subject: Re: 19.27, mail-hist.el Date: 10 Oct 1994 12:32:03 -0400 Organization: GNUs Not Usenet Lines: 133 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <199410101536.AA00313@phylo.life.uiuc.edu>