From: yamaoka Date: Fri, 5 Feb 1999 08:12:41 +0000 (+0000) Subject: * gnus.el (gnus-version-number): Update to 6.10.4. X-Git-Tag: semi-gnus-6_10_4~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a573643dd4c60e71a05c14de2a4e341980f15cd4;p=elisp%2Fgnus.git- * gnus.el (gnus-version-number): Update to 6.10.4. * gnus-sum.el (gnus-nov-parse-line): Use `nnheader-nov-field', `nnheader-nov-read-integer' and `nnheader-nov-read-message-id' instead of `gnus-nov-field', `gnus-nov-read-integer' or `nnheader-generate-fake-message-id'; use `eobp' instead of `(= (following-char) ?\n)' for checking whether a misc field exists or not. (gnus-nov-field): Abolished. (gnus-nov-skip-field): Abolished. (gnus-nov-read-integer): Abolished. * nnheader.el (nnheader-parse-nov): Use `nnheader-nov-read-message-id' instead of `nnheader-nov-field' or `nnheader-generate-fake-message-id'. (nnheader-nov-read-message-id): New macro. (nnheader-nov-read-integer): New implementation. (nnheader-nov-field): New implementation. (nnheader-nov-next-field): New macro. --- diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index a1c8f10..8a1486d 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -3022,24 +3022,6 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." (setq heads nil))))) gnus-newsgroup-dependencies))) -;; The following macros and functions were written by Felix Lee -;; . - -(defmacro gnus-nov-read-integer () - '(prog1 - (if (eq (char-after) ?\t) - 0 - (let ((num (ignore-errors (read buffer)))) - (if (numberp num) num 0))) - (unless (eobp) - (search-forward "\t" eol 'move)))) - -(defmacro gnus-nov-skip-field () - '(search-forward "\t" eol 'move)) - -(defmacro gnus-nov-field () - '(buffer-substring (point) (if (gnus-nov-skip-field) (1- (point)) eol))) - ;; This function has to be called with point after the article number ;; on the beginning of the line. (defsubst gnus-nov-parse-line (number dependencies &optional force-new) @@ -3056,17 +3038,16 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." (setq header (make-full-mail-header - number ; number - (gnus-nov-field) ; subject - (gnus-nov-field) ; from - (gnus-nov-field) ; date - (or (gnus-nov-field) - (nnheader-generate-fake-message-id)) ; id - (gnus-nov-field) ; refs - (gnus-nov-read-integer) ; chars - (gnus-nov-read-integer) ; lines - (unless (= (following-char) ?\n) - (gnus-nov-field))))) ; misc + number ; number + (nnheader-nov-field) ; subject + (nnheader-nov-field) ; from + (nnheader-nov-field) ; date + (nnheader-nov-read-message-id) ; id + (nnheader-nov-field) ; refs + (nnheader-nov-read-integer) ; chars + (nnheader-nov-read-integer) ; lines + (unless (eobp) + (nnheader-nov-field))))) ; misc (widen)) diff --git a/lisp/gnus.el b/lisp/gnus.el index 3b12369..5eb111e 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -253,7 +253,7 @@ is restarted, and sometimes reloaded." (defconst gnus-product-name "Semi-gnus" "Product name of this version of gnus.") -(defconst gnus-version-number "6.10.3" +(defconst gnus-version-number "6.10.4" "Version number for this version of gnus.") (defconst gnus-version diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 744333b..e138ede 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -257,20 +257,27 @@ on your system, you could say something like: (goto-char (point-min)) (delete-char 1))))) -(defmacro nnheader-nov-skip-field () - '(search-forward "\t" eol 'move)) +(defmacro nnheader-nov-next-field () + ;; Go to the beginning of the next field and returns a point of + ;; the end of the current field. + '(if (search-forward "\t" eol t) + (1- (point)) + eol)) (defmacro nnheader-nov-field () - '(buffer-substring (point) (if (nnheader-nov-skip-field) (1- (point)) eol))) + '(buffer-substring (point) (nnheader-nov-next-field))) (defmacro nnheader-nov-read-integer () - '(prog1 - (if (eq (char-after) ?\t) - 0 - (let ((num (ignore-errors (read (current-buffer))))) - (if (numberp num) num 0))) - (unless (eobp) - (search-forward "\t" eol 'move)))) + '(let ((field (buffer-substring (point) (nnheader-nov-next-field)))) + (if (string-match "^[0-9]+$" field) + (string-to-number field) + 0))) + +(defmacro nnheader-nov-read-message-id () + '(let ((id (buffer-substring (point) (nnheader-nov-next-field)))) + (if (string-match "^<[^>]+>$" id) + id + (nnheader-generate-fake-message-id)))) (defun nnheader-parse-nov () (let ((eol (gnus-point-at-eol))) @@ -279,8 +286,7 @@ on your system, you could say something like: (nnheader-nov-field) ; subject (nnheader-nov-field) ; from (nnheader-nov-field) ; date - (or (nnheader-nov-field) - (nnheader-generate-fake-message-id)) ; id + (nnheader-nov-read-message-id) ; id (nnheader-nov-field) ; refs (nnheader-nov-read-integer) ; chars (nnheader-nov-read-integer) ; lines