diff lisp/gnus/gnus-sum.el @ 19594:abfa7b46c7bd

(gnus-structured-field-decoder): New variable. (gnus-unstructured-field-decoder): New variable. (gnus-get-newsgroup-headers, gnus-nov-parse-line): Use `gnus-structured-field-decoder' and `gnus-unstructured-field-decoder' for Subject field.
author Kenichi Handa <handa@m17n.org>
date Thu, 28 Aug 1997 04:51:02 +0000
parents 6f6cf9184e93
children 4355457d9749
line wrap: on
line diff
--- a/lisp/gnus/gnus-sum.el	Thu Aug 28 04:51:02 1997 +0000
+++ b/lisp/gnus/gnus-sum.el	Thu Aug 28 04:51:02 1997 +0000
@@ -619,6 +619,17 @@
   :group 'gnus-summary-visual
   :type 'hook)
 
+;; 1997/5/4 by MORIOKA Tomohiko <morioka@jaist.ac.jp>
+(defcustom gnus-structured-field-decoder 'identity
+  "Function to decode non-ASCII characters in structured field for summary."
+  :group 'gnus-various
+  :type 'function)
+
+(defcustom gnus-unstructured-field-decoder 'identity
+  "Function to decode non-ASCII characters in unstructured field for summary."
+  :group 'gnus-various
+  :type 'function)
+
 (defcustom gnus-parse-headers-hook
   (list 'gnus-decode-rfc1522)
   "*A hook called before parsing the headers."
@@ -4144,12 +4155,18 @@
 	    (progn
 	      (goto-char p)
 	      (if (search-forward "\nsubject: " nil t)
-		  (nnheader-header-value) "(none)"))
+		  ;; 1997/5/4 by MORIOKA Tomohiko <morioka@jaist.ac.jp>
+		  (funcall
+		   gnus-unstructured-field-decoder (nnheader-header-value))
+		"(none)"))
 	    ;; From.
 	    (progn
 	      (goto-char p)
 	      (if (search-forward "\nfrom: " nil t)
-		  (nnheader-header-value) "(nobody)"))
+		  ;; 1997/5/4 by MORIOKA Tomohiko <morioka@jaist.ac.jp>
+		  (funcall
+		   gnus-structured-field-decoder (nnheader-header-value))
+		"(nobody)"))
 	    ;; Date.
 	    (progn
 	      (goto-char p)
@@ -4284,8 +4301,11 @@
 	  (setq header
 		(vector
 		 number			; number
-		 (gnus-nov-field)	; subject
-		 (gnus-nov-field)	; from
+		 ;; 1997/5/4 by MORIOKA Tomohiko <morioka@jaist.ac.jp>
+		 (funcall
+		  gnus-unstructured-field-decoder (gnus-nov-field)) ; subject
+		 (funcall
+		  gnus-structured-field-decoder (gnus-nov-field))   ; from
 		 (gnus-nov-field)	; date
 		 (setq id (or (gnus-nov-field)
 			      (nnheader-generate-fake-message-id))) ; id