*** pub/pgnus/lisp/gnus-art.el	Tue Sep  8 04:28:43 1998
--- pgnus/lisp/gnus-art.el	Tue Sep  8 21:41:35 1998
***************
*** 545,550 ****
--- 545,554 ----
  			       (item :tag "skip" nil)
  			       (face :value default)))))
  
+ (defcustom gnus-article-decode-hook
+   '(gnus-article-decode-charset gnus-article-decode-rfc1522)
+   "*Hook run to decode charsets in articles.")
+ 
  ;;; Internal variables
  
  (defvar article-lapsed-timer nil)
***************
*** 2538,2543 ****
--- 2542,2550 ----
  	    (insert-buffer-substring gnus-article-buffer))
  	  (setq gnus-original-article (cons group article))))
  
+       ;; Decode charsets.
+       (run-hooks 'gnus-article-decode-hook)
+       
        ;; Update sparse articles.
        (when (and do-update-line
  		 (or (numberp article)
*** pub/pgnus/lisp/gnus-int.el	Sat Aug 29 19:53:57 1998
--- pgnus/lisp/gnus-int.el	Tue Sep  8 21:41:35 1998
***************
*** 433,438 ****
--- 433,442 ----
    (goto-char (point-max))
    (unless (bolp)
      (insert "\n"))
+   (save-restriction
+     (message-narrow-to-headers)
+     (rfc2047-encode-message-header))
+   (message-encode-message-body)
    (let ((func (car (or gnus-command-method
  		       (gnus-find-method-for-group group)))))
      (funcall (intern (format "%s-request-accept-article" func))
***************
*** 441,446 ****
--- 445,454 ----
  	     last)))
  
  (defun gnus-request-replace-article (article group buffer)
+   (save-restriction
+     (message-narrow-to-headers)
+     (rfc2047-encode-message-header))
+   (message-encode-message-body)
    (let ((func (car (gnus-group-name-to-method group))))
      (funcall (intern (format "%s-request-replace-article" func))
  	     article (gnus-group-real-name group) buffer)))
*** pub/pgnus/lisp/gnus-start.el	Sun Aug 30 00:59:59 1998
--- pgnus/lisp/gnus-start.el	Tue Sep  8 21:41:35 1998
***************
*** 2531,2537 ****
  			  (fboundp 'gnus-mule-get-coding-system)
  			  (gnus-mule-get-coding-system (symbol-name group)))))
  		(when coding
! 		  (setq str (nnheader-decode-coding-string str (car coding))))
  		(set group str)))
  	    (forward-line 1))))
        (gnus-message 5 "Reading descriptions file...done")
--- 2531,2537 ----
  			  (fboundp 'gnus-mule-get-coding-system)
  			  (gnus-mule-get-coding-system (symbol-name group)))))
  		(when coding
! 		  (setq str (mm-decode-coding-string str (car coding))))
  		(set group str)))
  	    (forward-line 1))))
        (gnus-message 5 "Reading descriptions file...done")
*** pub/pgnus/lisp/gnus-util.el	Sun Sep  6 21:34:45 1998
--- pgnus/lisp/gnus-util.el	Tue Sep  8 21:41:35 1998
***************
*** 291,297 ****
  
  (defun gnus-dd-mmm (messy-date)
    "Return a string like DD-MMM from a big messy string."
!   (format-time-string "%2d-%b" (date-to-time messy-date)))
  
  (defmacro gnus-date-get-time (date)
    "Convert DATE string to Emacs time.
--- 291,297 ----
  
  (defun gnus-dd-mmm (messy-date)
    "Return a string like DD-MMM from a big messy string."
!   (format-time-string "%2d-%b" (safe-date-to-time messy-date)))
  
  (defmacro gnus-date-get-time (date)
    "Convert DATE string to Emacs time.
*** pub/pgnus/lisp/gnus.el	Tue Sep  8 07:07:55 1998
--- pgnus/lisp/gnus.el	Tue Sep  8 21:41:36 1998
***************
*** 250,256 ****
    :link '(custom-manual "(gnus)Exiting Gnus")
    :group 'gnus)
  
! (defconst gnus-version-number "0.19"
    "Version number for this version of Gnus.")
  
  (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number)
--- 250,256 ----
    :link '(custom-manual "(gnus)Exiting Gnus")
    :group 'gnus)
  
! (defconst gnus-version-number "0.20"
    "Version number for this version of Gnus.")
  
  (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number)
***************
*** 1346,1361 ****
  (defcustom gnus-article-display-hook
    (if (and (string-match "XEmacs" emacs-version)
  	   (featurep 'xface))
!       '(gnus-article-decode-charset
! 	gnus-article-decode-rfc1522
! 	gnus-article-hide-headers-if-wanted
  	gnus-article-hide-boring-headers
  	gnus-article-treat-overstrike
  	gnus-article-maybe-highlight
  	gnus-article-display-x-face)
!     '(gnus-article-decode-charset
!       gnus-article-decode-rfc1522
!       gnus-article-hide-headers-if-wanted
        gnus-article-hide-boring-headers
        gnus-article-treat-overstrike
        gnus-article-maybe-highlight))
--- 1346,1357 ----
  (defcustom gnus-article-display-hook
    (if (and (string-match "XEmacs" emacs-version)
  	   (featurep 'xface))
!       '(gnus-article-hide-headers-if-wanted
  	gnus-article-hide-boring-headers
  	gnus-article-treat-overstrike
  	gnus-article-maybe-highlight
  	gnus-article-display-x-face)
!     '(gnus-article-hide-headers-if-wanted
        gnus-article-hide-boring-headers
        gnus-article-treat-overstrike
        gnus-article-maybe-highlight))
*** pub/pgnus/lisp/lpath.el	Tue Sep  8 07:07:55 1998
--- pgnus/lisp/lpath.el	Tue Sep  8 21:41:36 1998
***************
*** 64,70 ****
  		 gnus-mule-get-coding-system decode-coding-string
  		 mail-aliases-setup
  		 mm-copy-tree url-view-url w3-prepare-buffer
! 		 mule-write-region-no-coding-system char-int)))
  
  (setq load-path (cons "." load-path))
  (require 'custom)
--- 64,71 ----
  		 gnus-mule-get-coding-system decode-coding-string
  		 mail-aliases-setup
  		 mm-copy-tree url-view-url w3-prepare-buffer
! 		 mule-write-region-no-coding-system char-int
! 		 base64-decode)))
  
  (setq load-path (cons "." load-path))
  (require 'custom)
*** pub/pgnus/lisp/nnfolder.el	Mon Aug 31 12:43:21 1998
--- pgnus/lisp/nnfolder.el	Tue Sep  8 21:41:36 1998
***************
*** 801,807 ****
  (defun nnfolder-group-pathname (group)
    "Make pathname for GROUP."
    (setq group
! 	(nnheader-encode-coding-string group nnmail-pathname-coding-system))
    (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory))))
      ;; If this file exists, we use it directly.
      (if (or nnmail-use-long-file-names
--- 801,807 ----
  (defun nnfolder-group-pathname (group)
    "Make pathname for GROUP."
    (setq group
! 	(mm-encode-coding-string group nnmail-pathname-coding-system))
    (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory))))
      ;; If this file exists, we use it directly.
      (if (or nnmail-use-long-file-names
*** pub/pgnus/lisp/nnheader.el	Mon Aug 31 22:15:47 1998
--- pgnus/lisp/nnheader.el	Tue Sep  8 21:41:36 1998
***************
*** 40,45 ****
--- 40,46 ----
  (eval-when-compile (require 'cl))
  
  (require 'mail-utils)
+ (require 'mm-util)
  
  (defvar nnheader-max-head-length 4096
    "*Max length of the head of articles.")
***************
*** 641,647 ****
    (or (not (numberp gnus-verbose-backends))
        (<= level gnus-verbose-backends)))
  
! (defvar nnheader-pathname-coding-system 'iso-8859-1
    "*Coding system for pathname.")
  
  (defun nnheader-group-pathname (group dir &optional file)
--- 642,648 ----
    (or (not (numberp gnus-verbose-backends))
        (<= level gnus-verbose-backends)))
  
! (defvar nnheader-pathname-coding-system 'binary
    "*Coding system for pathname.")
  
  (defun nnheader-group-pathname (group dir &optional file)
***************
*** 653,659 ****
  	 (concat dir group "/")
         ;; If not, we translate dots into slashes.
         (concat dir
! 	       (nnheader-encode-coding-string
  		(nnheader-replace-chars-in-string group ?. ?/)
  		nnheader-pathname-coding-system)
  	       "/")))
--- 654,660 ----
  	 (concat dir group "/")
         ;; If not, we translate dots into slashes.
         (concat dir
! 	       (mm-encode-coding-string
  		(nnheader-replace-chars-in-string group ?. ?/)
  		nnheader-pathname-coding-system)
  	       "/")))
***************
*** 808,821 ****
  (fset 'nnheader-run-at-time 'run-at-time)
  (fset 'nnheader-cancel-timer 'cancel-timer)
  (fset 'nnheader-cancel-function-timers 'cancel-function-timers)
- 
- (if (fboundp 'encode-coding-string)
-     (fset 'nnheader-encode-coding-string 'encode-coding-string)
-   (fset 'nnheader-encode-coding-string (lambda (s a) s)))
- 
- (if (fboundp 'decode-coding-string)
-     (fset 'nnheader-decode-coding-string 'decode-coding-string)
-   (fset 'nnheader-decode-coding-string (lambda (s a) s)))
  
  (when (string-match "XEmacs\\|Lucid" emacs-version)
    (require 'nnheaderxm))
--- 809,814 ----
*** pub/pgnus/lisp/nnmail.el	Sun Sep  6 21:34:47 1998
--- pgnus/lisp/nnmail.el	Tue Sep  8 21:41:36 1998
***************
*** 512,518 ****
  	 (concat dir group "/")
         ;; If not, we translate dots into slashes.
         (concat dir
! 	       (nnheader-encode-coding-string
  		(nnheader-replace-chars-in-string group ?. ?/)
  		nnmail-pathname-coding-system)
  	       "/")))
--- 512,518 ----
  	 (concat dir group "/")
         ;; If not, we translate dots into slashes.
         (concat dir
! 	       (mm-encode-coding-string
  		(nnheader-replace-chars-in-string group ?. ?/)
  		nnmail-pathname-coding-system)
  	       "/")))
***************
*** 1158,1164 ****
        (insert (format "Xref: %s" (system-name)))
        (while group-alist
  	(insert (format " %s:%d"
! 			(nnheader-encode-coding-string
  			 (caar group-alist)
  			 nnmail-pathname-coding-system)
  			(cdar group-alist)))
--- 1158,1164 ----
        (insert (format "Xref: %s" (system-name)))
        (while group-alist
  	(insert (format " %s:%d"
! 			(mm-encode-coding-string
  			 (caar group-alist)
  			 nnmail-pathname-coding-system)
  			(cdar group-alist)))
*** pub/pgnus/lisp/nnmh.el	Sun Aug 30 01:00:00 1998
--- pgnus/lisp/nnmh.el	Tue Sep  8 21:41:36 1998
***************
*** 229,236 ****
  				(expand-file-name nnmh-toplev))))
  	       dir)
  	      (nnheader-replace-chars-in-string
! 	       (nnheader-decode-coding-string (substring dir (match-end 0))
! 					      nnmail-pathname-coding-system)
  	       ?/ ?.))
  	    (apply 'max files)
  	    (apply 'min files)))))))
--- 229,236 ----
  				(expand-file-name nnmh-toplev))))
  	       dir)
  	      (nnheader-replace-chars-in-string
! 	       (mm-decode-coding-string (substring dir (match-end 0))
! 					nnmail-pathname-coding-system)
  	       ?/ ?.))
  	    (apply 'max files)
  	    (apply 'min files)))))))
*** pub/pgnus/lisp/rfc2047.el	Tue Sep  8 07:07:56 1998
--- pgnus/lisp/rfc2047.el	Tue Sep  8 21:41:37 1998
***************
*** 25,32 ****
  ;;; Code:
  
  (eval-and-compile
!   (if (not (fboundp 'base64-encode-string))
!       (require 'base64)))
  (require 'qp)
  (require 'mm-util)
  
--- 25,33 ----
  ;;; Code:
  
  (eval-and-compile
!   (eval
!    '(if (not (fboundp 'base64-encode-string))
! 	(require 'base64))))
  (require 'qp)
  (require 'mm-util)
  
***************
*** 254,267 ****
  		   (prog1
  		       (match-string 0)
  		     (delete-region (match-beginning 0) (match-end 0)))))
! 	  (mm-decode-coding-region b e rfc2047-default-charset)
  	  (setq b (point)))
! 	(mm-decode-coding-region b (point-max) rfc2047-default-charset)))))
  
  ;;;###autoload
  (defun rfc2047-decode-string (string)
   "Decode the quoted-printable-encoded STRING and return the results."
!  (with-temp-buffer
     (mm-enable-multibyte)
     (insert string)
     (inline
--- 255,270 ----
  		   (prog1
  		       (match-string 0)
  		     (delete-region (match-beginning 0) (match-end 0)))))
! 	  (when enable-multibyte-characters
! 	    (mm-decode-coding-region b e rfc2047-default-charset))
  	  (setq b (point)))
! 	(when enable-multibyte-characters
! 	  (mm-decode-coding-region b (point-max) rfc2047-default-charset))))))
  
  ;;;###autoload
  (defun rfc2047-decode-string (string)
   "Decode the quoted-printable-encoded STRING and return the results."
!   (with-temp-buffer
     (mm-enable-multibyte)
     (insert string)
     (inline
*** pub/pgnus/lisp/time-date.el	Tue Sep  8 04:28:46 1998
--- pgnus/lisp/time-date.el	Tue Sep  8 21:41:37 1998
***************
*** 116,121 ****
--- 116,128 ----
         (- (/ (1- year) 100))		;	- century years
         (/ (1- year) 400))))		;	+ Gregorian leap years
  
+ (defun safe-date-to-time (date)
+   "Parse DATE and return a time structure.
+ If DATE is malformed, a zero time will be returned."
+   (condition-case ()
+       (date-to-time date)
+     (error '(0 0))))
+ 
  (provide 'time-date)
  
  ;;; time-date.el ends here
*** pub/pgnus/lisp/ChangeLog	Tue Sep  8 07:07:55 1998
--- pgnus/lisp/ChangeLog	Tue Sep  8 21:41:34 1998
***************
*** 1,3 ****
--- 1,27 ----
+ Tue Sep  8 21:43:03 1998  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+ 
+ 	* gnus.el: Pterodactyl Gnus v0.20 is released.
+ 
+ 1998-09-08 11:40:45  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+ 
+ 	* rfc2047.el (rfc2047-decode-region): Only decode when in
+ 	multibyte. 
+ 
+ 	* nnheader.el (nnheader-pathname-coding-system): Changed to binary.
+ 
+ 	* gnus-int.el (gnus-request-replace-article): Encode.
+ 	(gnus-request-accept-article): Encode.
+ 
+ 	* gnus-art.el (gnus-request-article-this-buffer): Decode charsets
+ 	here. 
+ 
+ 	* gnus.el (gnus-article-display-hook): Take the charset functions
+ 	out.  
+ 
+ 	* time-date.el (safe-date-to-time): New function.
+ 
+ 	* gnus-util.el (gnus-dd-mmm): Protect against bogus dates.
+ 
  Tue Sep  8 07:09:28 1998  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
  
  	* gnus.el: Pterodactyl Gnus v0.19 is released.
*** pub/pgnus/texi/gnus.texi	Tue Sep  8 07:07:56 1998
--- pgnus/texi/gnus.texi	Tue Sep  8 21:41:38 1998
***************
*** 1,7 ****
  \input texinfo                  @c -*-texinfo-*-
  
  @setfilename gnus
! @settitle Pterodactyl Gnus 0.19 Manual
  @synindex fn cp
  @synindex vr cp
  @synindex pg cp
--- 1,7 ----
  \input texinfo                  @c -*-texinfo-*-
  
  @setfilename gnus
! @settitle Pterodactyl Gnus 0.20 Manual
  @synindex fn cp
  @synindex vr cp
  @synindex pg cp
***************
*** 318,324 ****
  @tex
  
  @titlepage
! @title Pterodactyl Gnus 0.19 Manual
  
  @author by Lars Magne Ingebrigtsen
  @page
--- 318,324 ----
  @tex
  
  @titlepage
! @title Pterodactyl Gnus 0.20 Manual
  
  @author by Lars Magne Ingebrigtsen
  @page
***************
*** 354,360 ****
  spool or your mbox file.  All at the same time, if you want to push your
  luck.
  
! This manual corresponds to Pterodactyl Gnus 0.19.
  
  @end ifinfo
  
--- 354,360 ----
  spool or your mbox file.  All at the same time, if you want to push your
  luck.
  
! This manual corresponds to Pterodactyl Gnus 0.20.
  
  @end ifinfo
  
*** pub/pgnus/texi/message.texi	Tue Sep  8 07:07:57 1998
--- pgnus/texi/message.texi	Tue Sep  8 21:41:38 1998
***************
*** 1,7 ****
  \input texinfo                  @c -*-texinfo-*-
  
  @setfilename message
! @settitle Pterodactyl Message 0.19 Manual
  @synindex fn cp
  @synindex vr cp
  @synindex pg cp
--- 1,7 ----
  \input texinfo                  @c -*-texinfo-*-
  
  @setfilename message
! @settitle Pterodactyl Message 0.20 Manual
  @synindex fn cp
  @synindex vr cp
  @synindex pg cp
***************
*** 42,48 ****
  @tex
  
  @titlepage
! @title Pterodactyl Message 0.19 Manual
  
  @author by Lars Magne Ingebrigtsen
  @page
--- 42,48 ----
  @tex
  
  @titlepage
! @title Pterodactyl Message 0.20 Manual
  
  @author by Lars Magne Ingebrigtsen
  @page
***************
*** 83,89 ****
  * Key Index::         List of Message mode keys.
  @end menu
  
! This manual corresponds to Pterodactyl Message 0.19.  Message is
  distributed with the Gnus distribution bearing the same version number
  as this manual has.
  
--- 83,89 ----
  * Key Index::         List of Message mode keys.
  @end menu
  
! This manual corresponds to Pterodactyl Message 0.20.  Message is
  distributed with the Gnus distribution bearing the same version number
  as this manual has.
  
