From c9cab7ecf8ec840bf90a2cce537b90097abc3690 Mon Sep 17 00:00:00 2001 From: shuhei-k Date: Sat, 30 May 1998 14:56:02 +0000 Subject: [PATCH] (gnus-get-newsgroup-headers): Save original value of "From:" and "Subject:" fields to `raw-text' property. (gnus-nov-field): Ditto. --- lisp/gnus-sum.el | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index e665fcb..829740a 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -4241,7 +4241,8 @@ The resulting hash table is returned, or nil if no Xrefs were found." (subst-char-in-region (point-min) (point-max) ?\t ? t) (gnus-run-hooks 'gnus-parse-headers-hook) (let ((case-fold-search t) - in-reply-to header p lines) + in-reply-to header p lines + rawtext decoded) (goto-char (point-min)) ;; Search to the beginning of the next header. Error messages ;; do not begin with 2 or 3. @@ -4270,15 +4271,27 @@ The resulting hash table is returned, or nil if no Xrefs were found." (progn (goto-char p) (if (search-forward "\nsubject: " nil t) - (funcall - gnus-unstructured-field-decoder (nnheader-header-value)) + (progn + (setq rawtext (nnheader-header-value) + decoded (funcall + gnus-unstructured-field-decoder rawtext)) + (if (string-equal rawtext decoded) + rawtext + (put-text-property 0 (length decoded) 'raw-text rawtext decoded) + decoded)) "(none)")) ;; From. (progn (goto-char p) (if (search-forward "\nfrom: " nil t) - (funcall - gnus-structured-field-decoder (nnheader-header-value)) + (progn + (setq rawtext (nnheader-header-value) + decoded (funcall + gnus-structured-field-decoder rawtext)) + (if (string-equal rawtext decoded) + rawtext + (put-text-property 0 (length decoded) 'raw-text rawtext decoded) + decoded)) "(nobody)")) ;; Date. (progn @@ -4416,7 +4429,8 @@ The resulting hash table is returned, or nil if no Xrefs were found." (defun gnus-nov-parse-line (number dependencies &optional force-new) (let ((eol (gnus-point-at-eol)) (buffer (current-buffer)) - header ref id id-dep ref-dep) + header ref id id-dep ref-dep + rawtext decoded) ;; overview: [num subject from date id refs chars lines misc] (unwind-protect @@ -4428,10 +4442,22 @@ The resulting hash table is returned, or nil if no Xrefs were found." (setq header (vector number ; number - (funcall - gnus-unstructured-field-decoder (gnus-nov-field)) ; subject - (funcall - gnus-structured-field-decoder (gnus-nov-field)) ; from + (progn + (setq rawtext (gnus-nov-field) ; subject + decoded (funcall + gnus-unstructured-field-decoder rawtext)) + (if (string-equal rawtext decoded) + rawtext + (put-text-property 0 (length decoded) 'raw-text rawtext decoded) + decoded)) + (progn + (setq rawtext (gnus-nov-field) ; from + decoded (funcall + gnus-structured-field-decoder rawtext)) + (if (string-equal rawtext decoded) + rawtext + (put-text-property 0 (length decoded) 'raw-text rawtext decoded) + decoded)) (gnus-nov-field) ; date (setq id (or (gnus-nov-field) (nnheader-generate-fake-message-id))) ; id -- 1.7.10.4