From 9f566a20e17311254eb64a61f40b8d98ff13a966 Mon Sep 17 00:00:00 2001 From: Andrew Cohen Date: Tue, 23 Nov 2010 08:10:39 -0500 Subject: [PATCH] nnheader.el (nnheader-parse-head): Bug fix. Properly position point. --- lisp/ChangeLog | 8 ++++++++ lisp/nnheader.el | 4 +--- lisp/nnspool.el | 15 ++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 94a27612f..c0c00429f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2010-11-23 Andrew Cohen + + * nnheader.el (nnheader-parse-head): Bug fix. Properly position + point when parsing headers. + + * nnspool.el (nnspool-insert-nov-head): Bug fix. Make sure point + is positioned properly when parsing headers. + 2010-11-23 Julien Danjou * shr.el (shr-parse-style): Replace \n with space in style parsing. diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 4bf458868..08dc96d94 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -366,15 +366,13 @@ on your system, you could say something like: (setq num 0 beg (point-min) end (point-max)) - (goto-char (point-min)) ;; Search to the beginning of the next header. Error ;; messages do not begin with 2 or 3. (when (re-search-forward "^[23][0-9]+ " nil t) - (end-of-line) (setq num (read cur) beg (point) end (if (search-forward "\n.\n" nil t) - (- (point) 2) + (goto-char (- (point) 2)) (point))))) (with-temp-buffer (insert-buffer-substring cur beg end) diff --git a/lisp/nnspool.el b/lisp/nnspool.el index 35987277b..1916c1ac9 100644 --- a/lisp/nnspool.el +++ b/lisp/nnspool.el @@ -399,15 +399,16 @@ there.") "Read the head of ARTICLE, convert to NOV headers, and insert." (save-excursion (let ((cur (current-buffer)) - buf) + buf) (setq buf (nnheader-set-temp-buffer " *nnspool head*")) (when (nnheader-insert-head - (nnspool-article-pathname nnspool-current-group article)) - (nnheader-insert-article-line article) - (let ((headers (nnheader-parse-head))) - (set-buffer cur) - (goto-char (point-max)) - (nnheader-insert-nov headers))) + (nnspool-article-pathname nnspool-current-group article)) + (nnheader-insert-article-line article) + (goto-char (point-min)) + (let ((headers (nnheader-parse-head))) + (set-buffer cur) + (goto-char (point-max)) + (nnheader-insert-nov headers))) (kill-buffer buf)))) (defun nnspool-sift-nov-with-sed (articles file) -- 2.34.1