[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/gnus-select2 141f7aa 1/2: Update header parsing in nnheader.el
From: |
Andrew G Cohen |
Subject: |
feature/gnus-select2 141f7aa 1/2: Update header parsing in nnheader.el |
Date: |
Sat, 2 Nov 2019 22:58:18 -0400 (EDT) |
branch: feature/gnus-select2
commit 141f7aa5543b075ea77830c5c7e988f3e4538df3
Author: Andrew G Cohen <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Update header parsing in nnheader.el
* lisp/gnus/nnheader.el (nnheader-parse-naked-head,
nnheader-parse-nov): Update the parsing functions to align with the
parsing in gnus-get-newsgroup-headers. This fixes some utf issues.
---
lisp/gnus/nnheader.el | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 28c4ceb..54d40d5 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -209,19 +209,23 @@ on your system, you could say something like:
;; about twice as fast, even though it looks messier. You
;; can't have everything, I guess. Speed and elegance don't
;; always go hand in hand.
- (vector
+ (make-full-mail-header
;; Number.
(or number 0)
;; Subject.
(progn
(goto-char p)
(if (search-forward "\nsubject:" nil t)
- (nnheader-header-value) "(none)"))
+ (funcall gnus-decode-encoded-word-function
+ (nnheader-header-value))
+ "(none)"))
;; From.
(progn
(goto-char p)
(if (search-forward "\nfrom:" nil t)
- (nnheader-header-value) "(nobody)"))
+ (funcall gnus-decode-encoded-address-function
+ (nnheader-header-value))
+ "(nobody)"))
;; Date.
(progn
(goto-char p)
@@ -349,11 +353,20 @@ on your system, you could say something like:
(defun nnheader-parse-nov ()
(let ((eol (point-at-eol))
- (number (nnheader-nov-read-integer)))
- (vector
+ (number (nnheader-nov-read-integer))
+ x)
+ (make-full-mail-header
number ; number
- (nnheader-nov-field) ; subject
- (nnheader-nov-field) ; from
+ (condition-case () ; subject
+ (gnus-remove-odd-characters
+ (funcall gnus-decode-encoded-word-function
+ (setq x (nnheader-nov-field))))
+ (error x))
+ (condition-case () ; from
+ (gnus-remove-odd-characters
+ (funcall gnus-decode-encoded-address-function
+ (setq x (nnheader-nov-field))))
+ (error x))
(nnheader-nov-field) ; date
(nnheader-nov-read-message-id number) ; id
(nnheader-nov-field) ; refs