Importing Pterodactyl Gnus v0.91.
authoryamaoka <yamaoka>
Sun, 4 Jul 1999 23:51:58 +0000 (23:51 +0000)
committeryamaoka <yamaoka>
Sun, 4 Jul 1999 23:51:58 +0000 (23:51 +0000)
38 files changed:
GNUS-NEWS
lisp/ChangeLog
lisp/base64.el
lisp/gnus-agent.el
lisp/gnus-art.el
lisp/gnus-cache.el
lisp/gnus-msg.el
lisp/gnus-srvr.el
lisp/gnus-start.el
lisp/gnus-sum.el
lisp/gnus-util.el
lisp/gnus.el
lisp/lpath.el
lisp/mailcap.el
lisp/message.el
lisp/mm-decode.el
lisp/mm-encode.el
lisp/mm-util.el
lisp/mm-uu.el
lisp/mm-view.el
lisp/mml.el
lisp/nndoc.el
lisp/nnfolder.el
lisp/nnheader.el
lisp/nnkiboze.el
lisp/nnmail.el
lisp/nnmbox.el
lisp/nnml.el
lisp/nnsoup.el
lisp/nnspool.el
lisp/nnweb.el
lisp/qp.el
lisp/rfc2047.el
lisp/smiley.el
texi/ChangeLog
texi/emacs-mime.texi
texi/gnus.texi
texi/message.texi

index ee7fbc6..a725d82 100644 (file)
--- a/GNUS-NEWS
+++ b/GNUS-NEWS
@@ -1,9 +1,17 @@
 ** Gnus changes.
 
 ** Gnus changes.
 
+The Gnus NEWS entries are short, but they reflect sweeping changes in
+four areas: Article display treatment, MIME treatment,
+internationalization and mail-fetching.
+
 *** The mail-fetching functions have changed.  See the manual for the
 many details.  In particular, all procmail fetching variables are gone.
 
 *** The mail-fetching functions have changed.  See the manual for the
 many details.  In particular, all procmail fetching variables are gone.
 
-*** Gnus is now a MIME-capable reader.  See the manual for details. 
+*** Gnus is now a MIME-capable reader.  This affects many parts of
+Gnus, and adds a slew of new commands.  See the manual for details.
+
+*** Gnus has also been multilingualized.  This also affects too
+many parts of Gnus to summarize here, and adds many new variables.
 
 *** gnus-auto-select-first can now be a function to be
 called to position point.
 
 *** gnus-auto-select-first can now be a function to be
 called to position point.
@@ -12,5 +20,8 @@ called to position point.
 summary buffers and NOV files.
 
 *** `gnus-article-display-hook' has been removed.  Instead, a number
 summary buffers and NOV files.
 
 *** `gnus-article-display-hook' has been removed.  Instead, a number
-of variables starting with `gnus-treat-'.
+of variables starting with `gnus-treat-' have been added.
+
+*** The Gnus posting styles have been redone again and now works in a
+subtly different manner.
 
 
index b807b2d..9ce3a5b 100644 (file)
@@ -1,3 +1,183 @@
+Sun Jul  4 06:31:01 1999  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+
+       * gnus.el: Pterodactyl Gnus v0.91 is released.
+
+1999-07-04 04:35:28  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-agent.el (gnus-agent-save-active-1): New function.
+       (gnus-agent-save-active): use it.
+       (gnus-agent-save-groups): Ditto.
+
+       * gnus-cache.el (gnus-cache-write-active): Use it.
+
+       * gnus-agent.el (gnus-agent-write-active): Use it.
+
+       * gnus-util.el (gnus-write-active-file): New function.
+
+       * gnus-agent.el (gnus-agent-write-active): New function to keep
+       lower boundaries and canceled groups.
+       (gnus-agent-save-groups): Use it.
+       (gnus-agent-save-active): Use it.
+       (gnus-agent-save-group-info): Only write active files.
+       (gnus-agent-expire): Update active file.
+
+       * mm-decode.el (mm-inlinable-part-p): Removed.
+       (mm-user-display-methods): Default to nil.
+       (mm-user-display-methods): Removed.
+       (add-mime-display-method): Removed.
+       (mm-automatic-display): Renamed.
+       (mm-automatic-display-p): Use it.
+       (mm-inlined-types): New variable.
+       (mm-inlined-p): New function.
+
+       * message.el (message-reply): Bind message-this-is-mail.
+
+1999-07-03 13:16:31  Michael Klingbeil  <mklingbeil@knuut.de>
+
+       * smiley.el (smiley-buffer): Fix for NT.
+
+1999-07-03 11:26:47  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * mm-encode.el (mm-encode-buffer): Check whether we have 7bit.
+
+       * message.el (message-check-news-header-syntax): Protect against
+       nil froms.
+
+       * mm-util.el (mm-auto-mode-alist): New.
+
+       * mml.el (mml-generate-mime-1): Ditto.
+
+       * gnus.el: Use mm-insert-file-contents throughout instead of
+       nnheader. 
+
+       * mm-util.el (mm-insert-file-contents): New function.
+
+Sat Jul  3 07:35:35 1999  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+
+       * gnus.el: Pterodactyl Gnus v0.90 is released.
+
+1999-07-03 09:31:10  Sven Fischer  <herpes@kawo2.rwth-aachen.de>
+
+       * mailcap.el (mailcap-possible-viewers): Use string=.
+
+1999-07-01  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * mm-uu.el (mm-uu-forward-begin-line): New variable.
+       (mm-uu-forward-end-line): New variable.
+       (mm-uu-begin-line): Handle forwarded message.
+       (mm-uu-identifier-alist): Ditto.
+       (mm-uu-dissect): Ditto.
+
+1999-06-29  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * lpath.el: Two free variables.
+
+1999-07-02  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * nnheader.el (nnheader-file-coding-system): Use raw-text.
+       * gnus-agent.el (gnus-agent-file-coding-system): Ditto.
+       * gnus-cache.el (gnus-cache-coding-system): Ditto.
+
+       * nnfolder.el (nnfolder-file-coding-system): Use mm-text-coding-system.
+       (nnfolder-file-coding-system-for-write): New variable.
+       (nnfolder-active-file-coding-system): New variable.
+       (nnfolder-active-file-coding-system-for-write): New variable.
+       (nnfolder-save-active): New function.
+       (nnfolder-save-buffer): Use them.
+       (nnfolder-possibly-change-group): Ditto.
+       (nnfolder-request-list-newsgroups): Ditto.
+       (nnfolder-request-create-group): Ditto.
+       (nnfolder-request-expire-articles): Ditto.
+       (nnfolder-request-move-article): Ditto.
+       (nnfolder-request-accept-article): Ditto.
+       (nnfolder-request-delete-group): Ditto.
+       (nnfolder-request-rename-group): Ditto.
+       (nnfolder-possibly-change-folder): Ditto.
+       (nnfolder-read-folder): Ditto.
+       (nnfolder-request-list): Remove pathname-coding-system.
+       (nnfolder-possibly-change-group): Use nnmail-pathname-coding-system.
+
+       * nnmail.el (nnmail-file-coding-system): Use raw-text.
+       (nnmail-file-coding-system-1): Removed.
+       (nnmail-find-file): Use nnmail-pathname-coding-system.
+       (nnmail-write-region): Ditto.
+
+       * nnmbox.el (nnmbox-file-coding-system): New variable.
+       (nnmbox-file-coding-system-for-write): New variable.
+       (nnmbox-active-file-coding-system): New variable.
+       (nnmbox-active-file-coding-system-for-write): New variable.
+       (nnmbox-save-buffer): New function.
+       (nnmbox-save-active): New function.
+       (nnmbox-request-scan): Use them.
+       (nnmbox-request-expire-articles): Ditto.
+       (nnmbox-request-move-article): Ditto.
+       (nnmbox-request-accept-article): Ditto.
+       (nnmbox-request-replace-article): Ditto.
+       (nnmbox-request-delete-group): Ditto.
+       (nnmbox-request-rename-group): Ditto.
+       (nnmbox-request-create-group): Ditto.
+
+       * mm-util.el (mm-text-coding-system): raw-text or -dos.
+       (mm-running-ntemacs): Removed.
+
+       * nnml.el (nnml-file-coding-system): Use nnmail-file-coding-system.
+
+1999-07-02  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * nnfolder.el (nnfolder-read-folder): Use nnheader-file-coding-system.
+
+1999-07-01  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * qp.el (quoted-printable-encoding-characters): Support lower case.
+
+1999-07-01  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * rfc2047.el (rfc2047-encode): Fold before B-encoding.
+       (rfc2047-b-encode-region): Encode line by line.
+
+1999-07-03 09:20:16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * mm-util.el (mm-find-mime-charset-region): Fix.
+
+1999-06-30  KOSEKI Yoshinori  <kose@yk.NetLaputa.ne.jp>
+
+       * mm-util.el (mm-mime-mule-charset-alist): Fix iso-2022-jp(-2) bug.
+       (mm-find-mime-charset-region): Ditto.
+
+1999-07-03 09:15:35  Simon Josefsson  <jas@pdc.kth.se>
+
+       * gnus-sum.el (gnus-summary-move-article): Fix something or
+       other. 
+
+1999-06-29  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-sum.el (gnus-newsgroup-ephemeral-charset): New variable.
+       (gnus-newsgroup-ephemeral-ignored-charsets): New variable.
+       (gnus-summary-enter-digest-group): Use them.
+       (gnus-summary-setup-default-charset): Ditto.
+
+1999-06-15  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * base64.el (base64-run-command-on-region): Use unibyte buffer.
+
+1999-06-15  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-msg.el (gnus-configure-posting-styles): Fix bug when
+          gnus-newsgroup-name is nil.
+
+1999-06-15  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * rfc2047.el (rfc2047-encode): Chop the tail newline.
+
+1999-06-15  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-art.el (article-emphasize): Use correct
+       gnus-article-emphasis-alist.
+
+1999-06-15  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * mm-view.el (mm-inline-text): Fix text/html bug.
+
 Mon Jun 28 17:54:01 1999  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
        * gnus.el: Pterodactyl Gnus v0.89 is released.
 Mon Jun 28 17:54:01 1999  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
        * gnus.el: Pterodactyl Gnus v0.89 is released.
index 6766e6f..0eec5f4 100644 (file)
@@ -73,9 +73,13 @@ base64-encoder-program.")
       (setq p (cdr p)))
     v))
 
       (setq p (cdr p)))
     v))
 
+(defvar base64-binary-coding-system 'binary)
+
 (defun base64-run-command-on-region (start end output-buffer command
                                           &rest arg-list)
 (defun base64-run-command-on-region (start end output-buffer command
                                           &rest arg-list)
-  (let ((tempfile nil) status errstring default-process-coding-system)
+  (let ((tempfile nil) status errstring default-process-coding-system 
+       (coding-system-for-write base64-binary-coding-system)
+       (coding-system-for-read base64-binary-coding-system))
     (unwind-protect
        (progn
          (setq tempfile (make-temp-name "base64"))
     (unwind-protect
        (progn
          (setq tempfile (make-temp-name "base64"))
@@ -103,7 +107,8 @@ base64-encoder-program.")
     (if (or (null buffer) (eq buffer (current-buffer)))
        (insert-char char count)
       (with-current-buffer buffer
     (if (or (null buffer) (eq buffer (current-buffer)))
        (insert-char char count)
       (with-current-buffer buffer
-       (insert-char char count)))))
+       (insert-char char count))))
+  (setq base64-binary-coding-system 'no-conversion))
 
 (defun base64-decode-region (start end)
   (interactive "r")
 
 (defun base64-decode-region (start end)
   (interactive "r")
index efe869a..57f0f59 100644 (file)
@@ -92,7 +92,7 @@ If nil, only read articles will be expired."
 (defvar gnus-agent-spam-hashtb nil)
 (defvar gnus-agent-file-name nil)
 (defvar gnus-agent-send-mail-function nil)
 (defvar gnus-agent-spam-hashtb nil)
 (defvar gnus-agent-file-name nil)
 (defvar gnus-agent-send-mail-function nil)
-(defvar gnus-agent-file-coding-system 'binary)
+(defvar gnus-agent-file-coding-system 'raw-text)
 
 (defconst gnus-agent-scoreable-headers
   '("subject" "from" "date" "message-id" "references" "chars" "lines" "xref")
 
 (defconst gnus-agent-scoreable-headers
   '("subject" "from" "date" "message-id" "references" "chars" "lines" "xref")
@@ -135,7 +135,7 @@ If nil, only read articles will be expired."
   "Load FILE and do a `read' there."
   (with-temp-buffer
     (ignore-errors
   "Load FILE and do a `read' there."
   (with-temp-buffer
     (ignore-errors
-      (nnheader-insert-file-contents file)
+      (mm-insert-file-contents file)
       (goto-char (point-min))
       (read (current-buffer)))))
 
       (goto-char (point-min))
       (read (current-buffer)))))
 
@@ -546,46 +546,54 @@ the actual number of articles toggled is returned."
 ;;;
 
 (defun gnus-agent-save-active (method)
 ;;;
 
 (defun gnus-agent-save-active (method)
+  (gnus-agent-save-active-1 method 'gnus-active-to-gnus-format))
+
+(defun gnus-agent-save-active-1 (method function)
   (when (gnus-agent-method-p method)
     (let* ((gnus-command-method method)
   (when (gnus-agent-method-p method)
     (let* ((gnus-command-method method)
+          (new (gnus-make-hashtable (count-lines (point-min) (point-max))))
           (file (gnus-agent-lib-file "active")))
           (file (gnus-agent-lib-file "active")))
-      (gnus-make-directory (file-name-directory file))
-      (let ((coding-system-for-write gnus-agent-file-coding-system))
-       (write-region (point-min) (point-max) file nil 'silent))
-      (when (file-exists-p (gnus-agent-lib-file "groups"))
-       (delete-file (gnus-agent-lib-file "groups"))))))
-
-(defun gnus-agent-save-groups (method)
-  (let* ((gnus-command-method method)
-        (file (gnus-agent-lib-file "groups")))
+      (funcall function nil new)
+      (gnus-agent-write-active file new)
+      (erase-buffer)
+      (insert-file-contents-literally file))))
+
+(defun gnus-agent-write-active (file new)
+  (let ((orig (gnus-make-hashtable (count-lines (point-min) (point-max))))
+       (file (gnus-agent-lib-file "active"))
+       elem)
+    (when (file-exists-p file)
+      (with-temp-buffer
+       (insert-file-contents file)
+       (gnus-active-to-gnus-format nil orig))
+      (mapatoms
+       (lambda (sym)
+        (when (and sym (boundp sym))
+          (if (setq elem (symbol-value (intern (symbol-name sym) orig)))
+              (setcdr elem (cdr (symbol-value sym)))
+            (set (intern (symbol-name sym) orig) (symbol-value sym)))))
+       new))
     (gnus-make-directory (file-name-directory file))
     (let ((coding-system-for-write gnus-agent-file-coding-system))
     (gnus-make-directory (file-name-directory file))
     (let ((coding-system-for-write gnus-agent-file-coding-system))
-      (write-region (point-min) (point-max) file nil 'silent))
-    (when (file-exists-p (gnus-agent-lib-file "active"))
-      (delete-file (gnus-agent-lib-file "active")))))
+      (gnus-write-active-file file orig))))
+
+(defun gnus-agent-save-groups (method)
+  (gnus-agent-save-active-1 method 'gnus-groups-to-gnus-format))
 
 (defun gnus-agent-save-group-info (method group active)
   (when (gnus-agent-method-p method)
     (let* ((gnus-command-method method)
 
 (defun gnus-agent-save-group-info (method group active)
   (when (gnus-agent-method-p method)
     (let* ((gnus-command-method method)
-          (file (if nntp-server-list-active-group
-                    (gnus-agent-lib-file "active")
-                  (gnus-agent-lib-file "groups"))))
+          (file (gnus-agent-lib-file "active")))
       (gnus-make-directory (file-name-directory file))
       (with-temp-file file
        (when (file-exists-p file)
       (gnus-make-directory (file-name-directory file))
       (with-temp-file file
        (when (file-exists-p file)
-         (nnheader-insert-file-contents file))
+         (mm-insert-file-contents file))
        (goto-char (point-min))
        (goto-char (point-min))
-       (if nntp-server-list-active-group
-           (progn
-             (when (re-search-forward
-                    (concat "^" (regexp-quote group) " ") nil t)
-               (gnus-delete-line))
-             (insert group " " (number-to-string (cdr active)) " "
-                     (number-to-string (car active)) " y\n"))
-         (when (re-search-forward
-                (concat (regexp-quote group) "\\($\\| \\)") nil t)
-           (gnus-delete-line))
-         (insert-buffer-substring nntp-server-buffer))))))
+       (when (re-search-forward
+              (concat "^" (regexp-quote group) " ") nil t)
+         (gnus-delete-line))
+       (insert group " " (number-to-string (cdr active)) " "
+               (number-to-string (car active)) " y\n")))))
 
 (defun gnus-agent-group-path (group)
   "Translate GROUP into a path."
 
 (defun gnus-agent-group-path (group)
   "Translate GROUP into a path."
@@ -764,7 +772,7 @@ the actual number of articles toggled is returned."
        (when (= (point-max) (point-min))
          (push (cons group (current-buffer)) gnus-agent-buffer-alist)
          (ignore-errors
        (when (= (point-max) (point-min))
          (push (cons group (current-buffer)) gnus-agent-buffer-alist)
          (ignore-errors
-           (nnheader-insert-file-contents
+           (mm-insert-file-contents
             (gnus-agent-article-name ".overview" group))))
        (nnheader-find-nov-line (string-to-number (cdar crosses)))
        (insert (string-to-number (cdar crosses)))
             (gnus-agent-article-name ".overview" group))))
        (nnheader-find-nov-line (string-to-number (cdar crosses)))
        (insert (string-to-number (cdar crosses)))
@@ -844,7 +852,7 @@ the actual number of articles toggled is returned."
   (goto-char (point-min))
   (set-buffer nntp-server-buffer)
   (erase-buffer)
   (goto-char (point-min))
   (set-buffer nntp-server-buffer)
   (erase-buffer)
-  (nnheader-insert-file-contents file)
+  (mm-insert-file-contents file)
   (goto-char (point-max))
   (if (or (= (point-min) (point-max))
          (progn
   (goto-char (point-max))
   (if (or (= (point-min) (point-max))
          (progn
@@ -1353,8 +1361,13 @@ The following commands are available:
        (day (- (time-to-days (current-time)) gnus-agent-expire-days))
        gnus-command-method sym group articles
        history overview file histories elem art nov-file low info
        (day (- (time-to-days (current-time)) gnus-agent-expire-days))
        gnus-command-method sym group articles
        history overview file histories elem art nov-file low info
-       unreads marked article)
+       unreads marked article orig lowest highest)
     (save-excursion
     (save-excursion
+      (with-temp-buffer
+       (insert-file-contents file)
+       (gnus-active-to-gnus-format
+        nil (setq orig (gnus-make-hashtable
+                        (count-lines (point-min) (point-max))))))
       (setq overview (gnus-get-buffer-create " *expire overview*"))
       (while (setq gnus-command-method (pop methods))
        (let ((expiry-hashtb (gnus-make-hashtable 1023)))
       (setq overview (gnus-get-buffer-create " *expire overview*"))
       (while (setq gnus-command-method (pop methods))
        (let ((expiry-hashtb (gnus-make-hashtable 1023)))
@@ -1393,13 +1406,15 @@ The following commands are available:
                                 (gnus-uncompress-range
                                  (cdr (assq 'dormant
                                             (gnus-info-marks info)))))
                                 (gnus-uncompress-range
                                  (cdr (assq 'dormant
                                             (gnus-info-marks info)))))
-                  nov-file (gnus-agent-article-name ".overview" group))
+                  nov-file (gnus-agent-article-name ".overview" group)
+                  lowest nil
+                  highest nil)
             (gnus-agent-load-alist group)
             (gnus-message 5 "Expiring articles in %s" group)
             (set-buffer overview)
             (erase-buffer)
             (when (file-exists-p nov-file)
             (gnus-agent-load-alist group)
             (gnus-message 5 "Expiring articles in %s" group)
             (set-buffer overview)
             (erase-buffer)
             (when (file-exists-p nov-file)
-              (nnheader-insert-file-contents nov-file))
+              (mm-insert-file-contents nov-file))
             (goto-char (point-min))
             (setq article 0)
             (while (setq elem (pop articles))
             (goto-char (point-min))
             (setq article 0)
             (while (setq elem (pop articles))
@@ -1417,7 +1432,11 @@ The following commands are available:
                   (if (file-exists-p
                        (gnus-agent-article-name
                         (number-to-string art) group))
                   (if (file-exists-p
                        (gnus-agent-article-name
                         (number-to-string art) group))
-                      (forward-line 1)
+                      (progn
+                        (unless lowest
+                          (setq lowest art))
+                        (setq highest art)
+                        (forward-line 1))
                     ;; Remove old NOV lines that have no articles.
                     (gnus-delete-line)))
                 (if (or (eobp)
                     ;; Remove old NOV lines that have no articles.
                     (gnus-delete-line)))
                 (if (or (eobp)
@@ -1479,7 +1498,11 @@ The following commands are available:
               (gnus-dribble-enter
                (concat "(gnus-group-set-info '"
                        (gnus-prin1-to-string info)
               (gnus-dribble-enter
                (concat "(gnus-group-set-info '"
                        (gnus-prin1-to-string info)
-                       ")"))))
+                       ")")))
+            (when lowest
+              (if (gnus-gethash group orig)
+                  (setcar (gnus-gethash group orig) lowest)
+                (gnus-sethash group (cons lowest highest) orig))))
           expiry-hashtb)
          (set-buffer history)
          (setq histories (nreverse (sort histories '<)))
           expiry-hashtb)
          (set-buffer history)
          (setq histories (nreverse (sort histories '<)))
@@ -1487,7 +1510,9 @@ The following commands are available:
            (goto-char (pop histories))
            (gnus-delete-line))
          (gnus-agent-save-history)
            (goto-char (pop histories))
            (gnus-delete-line))
          (gnus-agent-save-history)
-         (gnus-agent-close-history))
+         (gnus-agent-close-history)
+         (gnus-write-active-file
+          (gnus-agent-lib-file "active") orig))
        (gnus-message 4 "Expiry...done"))))))
 
 ;;;###autoload
        (gnus-message 4 "Expiry...done"))))))
 
 ;;;###autoload
index eab0013..ceb0e48 100644 (file)
@@ -2004,7 +2004,9 @@ This format is defined by the `gnus-article-time-format' variable."
   (interactive (gnus-article-hidden-arg))
   (unless (gnus-article-check-hidden-text 'emphasis arg)
     (save-excursion
   (interactive (gnus-article-hidden-arg))
   (unless (gnus-article-check-hidden-text 'emphasis arg)
     (save-excursion
-      (let ((alist (or gnus-article-emphasis-alist gnus-emphasis-alist))
+      (let ((alist (or (with-current-buffer gnus-summary-buffer 
+                        gnus-article-emphasis-alist) 
+                      gnus-emphasis-alist))
            (buffer-read-only nil)
            (props (append '(article-type emphasis)
                           gnus-hidden-properties))
            (buffer-read-only nil)
            (props (append '(article-type emphasis)
                           gnus-hidden-properties))
@@ -3098,7 +3100,7 @@ If ALL-HEADERS is non-nil, no headers are hidden."
                                  "inline")
                           (mm-attachment-override-p type)))
                 (mm-automatic-display-p type)
                                  "inline")
                           (mm-attachment-override-p type)))
                 (mm-automatic-display-p type)
-                (or (mm-inlinable-part-p type)
+                (or (mm-inlined-p type)
                     (mm-automatic-external-display-p type)))
            (setq display t)
          (when (equal (car (split-string type "/"))
                     (mm-automatic-external-display-p type)))
            (setq display t)
          (when (equal (car (split-string type "/"))
index 2d54bc7..0f009f3 100644 (file)
@@ -77,7 +77,7 @@ it's not cached."
 (defvar gnus-cache-overview-coding-system 'raw-text
   "Coding system used on Gnus cache files.")
 
 (defvar gnus-cache-overview-coding-system 'raw-text
   "Coding system used on Gnus cache files.")
 
-(defvar gnus-cache-coding-system 'binary
+(defvar gnus-cache-coding-system 'raw-text
   "Coding system used on Gnus cache files.")
 
 \f
   "Coding system used on Gnus cache files.")
 
 \f
@@ -394,7 +394,7 @@ Returns the list of articles removed."
       (erase-buffer)
       (let ((file (gnus-cache-file-name group ".overview")))
        (when (file-exists-p file)
       (erase-buffer)
       (let ((file (gnus-cache-file-name group ".overview")))
        (when (file-exists-p file)
-         (nnheader-insert-file-contents file)))
+         (mm-insert-file-contents file)))
       ;; We have a fresh (empty/just loaded) buffer,
       ;; mark it as unmodified to save a redundant write later.
       (set-buffer-modified-p nil))))
       ;; We have a fresh (empty/just loaded) buffer,
       ;; mark it as unmodified to save a redundant write later.
       (set-buffer-modified-p nil))))
@@ -592,14 +592,7 @@ $ emacs -batch -l ~/.emacs -l gnus -f gnus-jog-cache"
   (when (or force
            (and gnus-cache-active-hashtb
                 gnus-cache-active-altered))
   (when (or force
            (and gnus-cache-active-hashtb
                 gnus-cache-active-altered))
-    (with-temp-file gnus-cache-active-file
-      (mapatoms
-       (lambda (sym)
-        (when (and sym (boundp sym))
-          (insert (format "%s %d %d y\n"
-                          (symbol-name sym) (cdr (symbol-value sym))
-                          (car (symbol-value sym))))))
-       gnus-cache-active-hashtb))
+    (gnus-write-active-file gnus-cache-active-file gnus-cache-active-hashtb)
     ;; Mark the active hashtb as unaltered.
     (setq gnus-cache-active-altered nil)))
 
     ;; Mark the active hashtb as unaltered.
     (setq gnus-cache-active-altered nil)))
 
index ad27d85..e418e67 100644 (file)
@@ -1104,7 +1104,7 @@ this is a reply."
        (when (cond
               ((stringp match)
                ;; Regexp string match on the group name.
        (when (cond
               ((stringp match)
                ;; Regexp string match on the group name.
-               (string-match match gnus-newsgroup-name))
+               (string-match match group))
               ((or (symbolp match)
                    (gnus-functionp match))
                (cond
               ((or (symbolp match)
                    (gnus-functionp match))
                (cond
@@ -1154,8 +1154,7 @@ this is a reply."
                        (insert-file-contents v)
                        (buffer-string))))
            (setq results (delq (assoc element results) results))
                        (insert-file-contents v)
                        (buffer-string))))
            (setq results (delq (assoc element results) results))
-           (push (cons element
-                       v) results))))
+           (push (cons element v) results))))
       ;; Now we have all the styles, so we insert them.
       (setq name (assq 'name results)
            address (assq 'address results))
       ;; Now we have all the styles, so we insert them.
       (setq name (assq 'name results)
            address (assq 'address results))
index 4c65009..0ae565a 100644 (file)
@@ -135,6 +135,9 @@ The following specs are understood:
     "D" gnus-server-deny-server
     "R" gnus-server-remove-denials
 
     "D" gnus-server-deny-server
     "R" gnus-server-remove-denials
 
+    "n" next-line
+    "p" previous-line
+    
     "g" gnus-server-regenerate-server
 
     "\C-c\C-i" gnus-info-find-node
     "g" gnus-server-regenerate-server
 
     "\C-c\C-i" gnus-info-find-node
index 37a9b0b..aa9b648 100644 (file)
@@ -804,8 +804,8 @@ prompt the user for the name of an NNTP server to use."
          ;; Load whichever file is newest -- the auto save file
          ;; or the "real" file.
          (if (file-newer-than-file-p auto dribble-file)
          ;; Load whichever file is newest -- the auto save file
          ;; or the "real" file.
          (if (file-newer-than-file-p auto dribble-file)
-             (nnheader-insert-file-contents auto)
-           (nnheader-insert-file-contents dribble-file))
+             (mm-insert-file-contents auto)
+           (mm-insert-file-contents dribble-file))
          (unless (zerop (buffer-size))
            (set-buffer-modified-p t))
          ;; Set the file modes to reflect the .newsrc file modes.
          (unless (zerop (buffer-size))
            (set-buffer-modified-p t))
          ;; Set the file modes to reflect the .newsrc file modes.
@@ -1828,39 +1828,41 @@ newsgroup."
                     (gnus-group-prefixed-name "" method))))
 
     ;; Let the Gnus agent save the active file.
                     (gnus-group-prefixed-name "" method))))
 
     ;; Let the Gnus agent save the active file.
-    (when (and gnus-agent real-active)
-      (gnus-agent-save-groups method))
+    (if (and gnus-agent real-active)
+       (progn
+         (gnus-agent-save-groups method)
+         (gnus-active-to-gnus-format method hashtb nil real-active))
 
 
-    (goto-char (point-min))
-    ;; We split this into to separate loops, one with the prefix
-    ;; and one without to speed the reading up somewhat.
-    (if prefix
-       (let (min max opoint group)
+      (goto-char (point-min))
+      ;; We split this into to separate loops, one with the prefix
+      ;; and one without to speed the reading up somewhat.
+      (if prefix
+         (let (min max opoint group)
+           (while (not (eobp))
+             (condition-case ()
+                 (progn
+                   (read cur) (read cur)
+                   (setq min (read cur)
+                         max (read cur)
+                         opoint (point))
+                   (skip-chars-forward " \t")
+                   (insert prefix)
+                   (goto-char opoint)
+                   (set (let ((obarray hashtb)) (read cur))
+                        (cons min max)))
+               (error (and group (symbolp group) (set group nil))))
+             (forward-line 1)))
+       (let (min max group)
          (while (not (eobp))
            (condition-case ()
          (while (not (eobp))
            (condition-case ()
-               (progn
+               (when (eq (char-after) ?2)
                  (read cur) (read cur)
                  (setq min (read cur)
                  (read cur) (read cur)
                  (setq min (read cur)
-                       max (read cur)
-                       opoint (point))
-                 (skip-chars-forward " \t")
-                 (insert prefix)
-                 (goto-char opoint)
-                 (set (let ((obarray hashtb)) (read cur))
+                       max (read cur))
+                 (set (setq group (let ((obarray hashtb)) (read cur)))
                       (cons min max)))
              (error (and group (symbolp group) (set group nil))))
                       (cons min max)))
              (error (and group (symbolp group) (set group nil))))
-           (forward-line 1)))
-      (let (min max group)
-       (while (not (eobp))
-         (condition-case ()
-             (when (eq (char-after) ?2)
-               (read cur) (read cur)
-               (setq min (read cur)
-                     max (read cur))
-               (set (setq group (let ((obarray hashtb)) (read cur)))
-                    (cons min max)))
-           (error (and group (symbolp group) (set group nil))))
-         (forward-line 1))))))
+           (forward-line 1)))))))
 
 (defun gnus-read-newsrc-file (&optional force)
   "Read startup file.
 
 (defun gnus-read-newsrc-file (&optional force)
   "Read startup file.
index 3320a50..b53eca2 100644 (file)
@@ -1028,6 +1028,8 @@ variable (string, integer, character, etc).")
 (defvar gnus-last-article nil)
 (defvar gnus-newsgroup-history nil)
 (defvar gnus-newsgroup-charset nil)
 (defvar gnus-last-article nil)
 (defvar gnus-newsgroup-history nil)
 (defvar gnus-newsgroup-charset nil)
+(defvar gnus-newsgroup-ephemeral-charset nil)
+(defvar gnus-newsgroup-ephemeral-ignored-charsets nil)
 
 (defconst gnus-summary-local-variables
   '(gnus-newsgroup-name
 
 (defconst gnus-summary-local-variables
   '(gnus-newsgroup-name
@@ -6752,11 +6754,14 @@ to guess what the document format is."
        (delete-matching-lines "^\\(Path\\):\\|^From ")
        (widen))
       (unwind-protect
        (delete-matching-lines "^\\(Path\\):\\|^From ")
        (widen))
       (unwind-protect
-          (if (gnus-group-read-ephemeral-group
-               name `(nndoc ,name (nndoc-address ,(get-buffer dig))
-                            (nndoc-article-type
-                             ,(if force 'digest 'guess))) t)
-              ;; Make all postings to this group go to the parent group.
+          (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset)
+                   (gnus-newsgroup-ephemeral-ignored-charsets
+                    gnus-newsgroup-ignored-charsets))
+               (gnus-group-read-ephemeral-group
+                name `(nndoc ,name (nndoc-address ,(get-buffer dig))
+                             (nndoc-article-type
+                              ,(if force 'digest 'guess))) t))
+             ;; Make all postings to this group go to the parent group.
               (nconc (gnus-info-params (gnus-get-info name))
                      params)
             ;; Couldn't select this doc group.
               (nconc (gnus-info-params (gnus-get-info name))
                      params)
             ;; Couldn't select this doc group.
@@ -7274,7 +7279,8 @@ and `request-accept' functions."
               (entry
                (gnus-gethash pto-group gnus-newsrc-hashtb))
               (info (nth 2 entry))
               (entry
                (gnus-gethash pto-group gnus-newsrc-hashtb))
               (info (nth 2 entry))
-              (to-group (gnus-info-group info)))
+               (to-group (gnus-info-group info))
+              to-marks)
          ;; Update the group that has been moved to.
          (when (and info
                     (memq action '(move copy)))
          ;; Update the group that has been moved to.
          (when (and info
                     (memq action '(move copy)))
@@ -7282,6 +7288,7 @@ and `request-accept' functions."
              (push to-group to-groups))
 
            (unless (memq article gnus-newsgroup-unreads)
              (push to-group to-groups))
 
            (unless (memq article gnus-newsgroup-unreads)
+             (push 'read to-marks)
              (gnus-info-set-read
               info (gnus-add-to-range (gnus-info-read info)
                                       (list (cdr art-group)))))
              (gnus-info-set-read
               info (gnus-add-to-range (gnus-info-read info)
                                       (list (cdr art-group)))))
@@ -7309,6 +7316,7 @@ and `request-accept' functions."
                (when (memq article (symbol-value
                                     (intern (format "gnus-newsgroup-%s"
                                                     (caar marks)))))
                (when (memq article (symbol-value
                                     (intern (format "gnus-newsgroup-%s"
                                                     (caar marks)))))
+                  (push (cdar marks) to-marks)
                  ;; If the other group is the same as this group,
                  ;; then we have to add the mark to the list.
                  (when (equal to-group gnus-newsgroup-name)
                  ;; If the other group is the same as this group,
                  ;; then we have to add the mark to the list.
                  (when (equal to-group gnus-newsgroup-name)
@@ -7322,6 +7330,10 @@ and `request-accept' functions."
                   to-group (cdar marks) (list to-article) info))
                (setq marks (cdr marks)))
 
                   to-group (cdar marks) (list to-article) info))
                (setq marks (cdr marks)))
 
+              (gnus-request-set-mark to-group (list (list (list to-article)
+                                                          'set
+                                                          to-marks)))
+
              (gnus-dribble-enter
               (concat "(gnus-group-set-info '"
                       (gnus-prin1-to-string (gnus-get-info to-group))
              (gnus-dribble-enter
               (concat "(gnus-group-set-info '"
                       (gnus-prin1-to-string (gnus-get-info to-group))
@@ -9277,21 +9289,23 @@ If REVERSE, save parts that do not match TYPE."
   (let* ((name (and gnus-newsgroup-name
                   (gnus-group-real-name gnus-newsgroup-name)))
         (ignored-charsets 
   (let* ((name (and gnus-newsgroup-name
                   (gnus-group-real-name gnus-newsgroup-name)))
         (ignored-charsets 
-         (append
-          (and gnus-newsgroup-name
-               (or (gnus-group-find-parameter gnus-newsgroup-name
-                                              'ignored-charsets t)
-                   (let ((alist gnus-group-ignored-charsets-alist)
-                         elem (charsets nil))
-                     (while (setq elem (pop alist))
-                       (when (and name
-                                  (string-match (car elem) name))
-                        (setq alist nil
-                              charsets (cdr elem))))
-                     charsets)))
-          gnus-newsgroup-ignored-charsets)))
+         (or gnus-newsgroup-ephemeral-ignored-charsets
+             (append
+              (and gnus-newsgroup-name
+                   (or (gnus-group-find-parameter gnus-newsgroup-name
+                                                  'ignored-charsets t)
+                       (let ((alist gnus-group-ignored-charsets-alist)
+                          elem (charsets nil))
+                         (while (setq elem (pop alist))
+                           (when (and name
+                                      (string-match (car elem) name))
+                             (setq alist nil
+                                   charsets (cdr elem))))
+                         charsets))))
+             gnus-newsgroup-ignored-charsets)))
     (setq gnus-newsgroup-charset
     (setq gnus-newsgroup-charset
-         (or (and gnus-newsgroup-name
+         (or gnus-newsgroup-ephemeral-charset
+             (and gnus-newsgroup-name
                   (or (gnus-group-find-parameter gnus-newsgroup-name
                                                  'charset)
                       (let ((alist gnus-group-charset-alist)
                   (or (gnus-group-find-parameter gnus-newsgroup-name
                                                  'charset)
                       (let ((alist gnus-group-charset-alist)
index 0c22d41..61975ef 100644 (file)
@@ -936,6 +936,16 @@ ARG is passed to the first function."
        (throw 'found nil)))
     t))
 
        (throw 'found nil)))
     t))
 
+(defun gnus-write-active-file (file hashtb)
+  (with-temp-file file
+    (mapatoms
+     (lambda (sym)
+       (when (and sym (boundp sym))
+        (insert (format "%s %d %d y\n"
+                        (symbol-name sym) (cdr (symbol-value sym))
+                        (car (symbol-value sym))))))
+     hashtb)))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
index 11230d4..1e3e7c5 100644 (file)
@@ -260,7 +260,7 @@ is restarted, and sometimes reloaded."
   :link '(custom-manual "(gnus)Exiting Gnus")
   :group 'gnus)
 
   :link '(custom-manual "(gnus)Exiting Gnus")
   :group 'gnus)
 
-(defconst gnus-version-number "0.89"
+(defconst gnus-version-number "0.91"
   "Version number for this version of Gnus.")
 
 (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number)
   "Version number for this version of Gnus.")
 
 (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number)
index 4b89027..920a29b 100644 (file)
@@ -61,6 +61,8 @@
                enable-multibyte-characters browse-url-browser-function
                adaptive-fill-first-line-regexp adaptive-fill-regexp
                url-current-mime-headers help-echo-owns-message
                enable-multibyte-characters browse-url-browser-function
                adaptive-fill-first-line-regexp adaptive-fill-regexp
                url-current-mime-headers help-echo-owns-message
+               w3-meta-content-type-charset-regexp
+               w3-meta-charset-content-type-regexp
                babel-translations babel-history))
   (maybe-fbind '(color-instance-rgb-components temp-directory
                 glyph-width annotation-glyph window-pixel-width glyph-height
                babel-translations babel-history))
   (maybe-fbind '(color-instance-rgb-components temp-directory
                 glyph-width annotation-glyph window-pixel-width glyph-height
@@ -81,7 +83,7 @@
                 mm-copy-tree url-view-url w3-prepare-buffer
                 mule-write-region-no-coding-system char-int
                 annotationp delete-annotation make-image-specifier
                 mm-copy-tree url-view-url w3-prepare-buffer
                 mule-write-region-no-coding-system char-int
                 annotationp delete-annotation make-image-specifier
-                make-annotation
+                make-annotation events-to-keys
                 w3-do-setup w3-region
                 w3-coding-system-for-mime-charset 
                 rmail-summary-exists rmail-select-summary rmail-update-summary
                 w3-do-setup w3-region
                 w3-coding-system-for-mime-charset 
                 rmail-summary-exists rmail-select-summary rmail-update-summary
index b576100..2ecff33 100644 (file)
@@ -486,7 +486,7 @@ If FORCE, re-parse even if already parsed."
       (cond
        ((equal (car (car major)) minor)
        (setq exact (cons (cdr (car major)) exact)))
       (cond
        ((equal (car (car major)) minor)
        (setq exact (cons (cdr (car major)) exact)))
-       ((and minor (string-match (car (car major)) minor))
+       ((and minor (string= (car (car major)) minor))
        (setq wildcard (cons (cdr (car major)) wildcard))))
       (setq major (cdr major)))
     (nconc (nreverse exact) (nreverse wildcard))))
        (setq wildcard (cons (cdr (car major)) wildcard))))
       (setq major (cdr major)))
     (nconc (nreverse exact) (nreverse wildcard))))
index ccd5df2..a359b71 100644 (file)
@@ -1036,7 +1036,7 @@ The cdr of ech entry is a function for applying the face to a region.")
             (file-readable-p file)
             (file-regular-p file))
     (with-temp-buffer
             (file-readable-p file)
             (file-regular-p file))
     (with-temp-buffer
-      (nnheader-insert-file-contents file)
+      (mm-insert-file-contents file)
       (goto-char (point-min))
       (looking-at message-unix-mail-delimiter))))
 
       (goto-char (point-min))
       (looking-at message-unix-mail-delimiter))))
 
@@ -2510,12 +2510,15 @@ to find out how to use this."
    (message-check 'from
      (let* ((case-fold-search t)
            (from (message-fetch-field "from"))
    (message-check 'from
      (let* ((case-fold-search t)
            (from (message-fetch-field "from"))
-           (ad (nth 1 (mail-extract-address-components from))))
+           ad)
        (cond
        ((not from)
         (message "There is no From line.  Posting is denied.")
         nil)
        (cond
        ((not from)
         (message "There is no From line.  Posting is denied.")
         nil)
-       ((or (not (string-match "@[^\\.]*\\." ad)) ;larsi@ifi
+       ((or (not (string-match
+                  "@[^\\.]*\\."
+                  (setq ad (nth 1 (mail-extract-address-components
+                                   from))))) ;larsi@ifi
             (string-match "\\.\\." ad) ;larsi@ifi..uio
             (string-match "@\\." ad)   ;larsi@.ifi.uio
             (string-match "\\.$" ad)   ;larsi@ifi.uio.
             (string-match "\\.\\." ad) ;larsi@ifi..uio
             (string-match "@\\." ad)   ;larsi@.ifi.uio
             (string-match "\\.$" ad)   ;larsi@ifi.uio.
@@ -3384,6 +3387,7 @@ OTHER-HEADERS is an alist of header/value pairs."
        from subject date reply-to to cc
        references message-id follow-to
        (inhibit-point-motion-hooks t)
        from subject date reply-to to cc
        references message-id follow-to
        (inhibit-point-motion-hooks t)
+       (message-this-is-mail t)
        mct never-mct gnus-warning)
     (save-restriction
       (message-narrow-to-head)
        mct never-mct gnus-warning)
     (save-restriction
       (message-narrow-to-head)
index 0538fb5..856a538 100644 (file)
     ("multipart/related" ignore t))
   "Alist of media types/test that say whether the media types can be displayed inline.")
 
     ("multipart/related" ignore t))
   "Alist of media types/test that say whether the media types can be displayed inline.")
 
-(defvar mm-user-display-methods
-  '(("image/.*" . inline)
-    ("text/.*" . inline)
-    ("message/delivery-status" . inline)
-    ("message/rfc822" . inline)))
-
-(defvar mm-user-automatic-display
+(defvar mm-inlined-types
+  '("image/.*" "text/.*" "message/delivery-status" "message/rfc822")
+  "List of media types that are to be displayed inline.")
+  
+(defvar mm-automatic-display
   '("text/plain" "text/enriched" "text/richtext" "text/html"
     "text/x-vcard" "image/.*" "message/delivery-status" "multipart/.*"
   '("text/plain" "text/enriched" "text/richtext" "text/html"
     "text/x-vcard" "image/.*" "message/delivery-status" "multipart/.*"
-    "message/rfc822"))
+    "message/rfc822")
+  "A list of MIME types to be displayed automatically.")
 
 (defvar mm-attachment-override-types
   '("text/plain" "text/x-vcard")
   "Types that should have \"attachment\" ignored if they can be displayed inline.")
 
 
 (defvar mm-attachment-override-types
   '("text/plain" "text/x-vcard")
   "Types that should have \"attachment\" ignored if they can be displayed inline.")
 
-(defvar mm-user-automatic-external-display nil
+(defvar mm-automatic-external-display nil
   "List of MIME type regexps that will be displayed externally automatically.")
 
 (defvar mm-discouraged-alternatives nil
   "List of MIME type regexps that will be displayed externally automatically.")
 
 (defvar mm-discouraged-alternatives nil
-  "List of MIME types that are discouraged when viewing multiapart/alternative.
+  "List of MIME types that are discouraged when viewing multipart/alternative.
 Viewing agents are supposed to view the last possible part of a message,
 as that is supposed to be the richest.  However, users may prefer other
 types instead, and this list says what types are most unwanted.  If,
 Viewing agents are supposed to view the last possible part of a message,
 as that is supposed to be the richest.  However, users may prefer other
 types instead, and this list says what types are most unwanted.  If,
@@ -226,10 +225,6 @@ to:
       (insert-buffer-substring obuf beg)
       (current-buffer))))
 
       (insert-buffer-substring obuf beg)
       (current-buffer))))
 
-(defun mm-inlinable-part-p (type)
-  "Say whether TYPE can be displayed inline."
-  (eq (mm-user-method type) 'inline))
-
 (defun mm-display-part (handle &optional no-default)
   "Display the MIME part represented by HANDLE.
 Returns nil if the part is removed; inline if displayed inline;
 (defun mm-display-part (handle &optional no-default)
   "Display the MIME part represented by HANDLE.
 Returns nil if the part is removed; inline if displayed inline;
@@ -239,26 +234,22 @@ external if displayed external."
     (if (mm-handle-displayed-p handle)
        (mm-remove-part handle)
       (let* ((type (car (mm-handle-type handle)))
     (if (mm-handle-displayed-p handle)
        (mm-remove-part handle)
       (let* ((type (car (mm-handle-type handle)))
-            (method (mailcap-mime-info type))
-            (user-method (mm-user-method type)))
-       (if (eq user-method 'inline)
+            (method (mailcap-mime-info type)))
+       (if (mm-inlined-p type)
            (progn
              (forward-line 1)
              (mm-display-inline handle)
              'inline)
            (progn
              (forward-line 1)
              (mm-display-inline handle)
              'inline)
-         (when (or user-method
-                   method
+         (when (or method
                    (not no-default))
                    (not no-default))
-           (if (and (not user-method)
-                    (not method)
+           (if (and (not method)
                     (equal "text" (car (split-string type))))
                (progn
                  (forward-line 1)
                  (mm-insert-inline handle (mm-get-part handle))
                  'inline)
              (mm-display-external
                     (equal "text" (car (split-string type))))
                (progn
                  (forward-line 1)
                  (mm-insert-inline handle (mm-get-part handle))
                  'inline)
              (mm-display-external
-              handle (or user-method method
-                         'mailcap-save-binary-file))
+              handle (or method 'mailcap-save-binary-file))
              'external)))))))
 
 (defun mm-display-external (handle method)
              'external)))))))
 
 (defun mm-display-external (handle method)
@@ -397,21 +388,20 @@ external if displayed external."
       (pop alist))
     test))
 
       (pop alist))
     test))
 
-(defun mm-user-method (type)
-  "Return the user-defined method for TYPE."
-  (let ((methods mm-user-display-methods)
+(defun mm-automatic-display-p (type)
+  "Say whether the user wants TYPE to be displayed automatically."
+  (let ((methods mm-automatic-display)
        method result)
     (while (setq method (pop methods))
        method result)
     (while (setq method (pop methods))
-      (when (string-match (car method) type)
-       (when (or (not (eq (cdr method) 'inline))
-                 (mm-inlinable-p type))
-         (setq result (cdr method)
-               methods nil))))
+      (when (and (string-match method type)
+                (mm-inlinable-p type))
+       (setq result t
+             methods nil)))
     result))
 
     result))
 
-(defun mm-automatic-display-p (type)
-  "Return the user-defined method for TYPE."
-  (let ((methods mm-user-automatic-display)
+(defun mm-inlined-p (type)
+  "Say whether the user wants TYPE to be displayed automatically."
+  (let ((methods mm-inlined-types)
        method result)
     (while (setq method (pop methods))
       (when (and (string-match method type)
        method result)
     (while (setq method (pop methods))
       (when (and (string-match method type)
@@ -432,7 +422,7 @@ external if displayed external."
 
 (defun mm-automatic-external-display-p (type)
   "Return the user-defined method for TYPE."
 
 (defun mm-automatic-external-display-p (type)
   "Return the user-defined method for TYPE."
-  (let ((methods mm-user-automatic-external-display)
+  (let ((methods mm-automatic-external-display)
        method result)
     (while (setq method (pop methods))
       (when (string-match method type)
        method result)
     (while (setq method (pop methods))
       (when (string-match method type)
@@ -440,11 +430,6 @@ external if displayed external."
              methods nil)))
     result))
 
              methods nil)))
     result))
 
-(defun add-mime-display-method (type method)
-  "Make parts of TYPE be displayed with METHOD.
-This overrides entries in the mailcap file."
-  (push (cons type method) mm-user-display-methods))
-
 (defun mm-destroy-part (handle)
   "Destroy the data structures connected to HANDLE."
   (when (listp handle)
 (defun mm-destroy-part (handle)
   "Destroy the data structures connected to HANDLE."
   (when (listp handle)
index 587abf8..fbc2d7c 100644 (file)
@@ -87,7 +87,12 @@ The encoding used is returned."
         (encoding
          (or (and (listp type)
                   (cadr (assq 'encoding type)))
         (encoding
          (or (and (listp type)
                   (cadr (assq 'encoding type)))
-             (mm-content-transfer-encoding mime-type))))
+             (mm-content-transfer-encoding mime-type)))
+        (bits (mm-body-7-or-8)))
+    ;; We force buffers that are 7bit to be unencoded, no matter
+    ;; what the preferred encoding is.
+    (when (eq bits '7bit)
+      (setq encoding bits))
     (mm-encode-content-transfer-encoding encoding mime-type)
     encoding))
 
     (mm-encode-content-transfer-encoding encoding mime-type)
     encoding))
 
index 966cb91..774e3b0 100644 (file)
 
 ;;; Code:
 
 
 ;;; Code:
 
-(defvar mm-running-xemacs (string-match "XEmacs" emacs-version))
+(defconst mm-running-xemacs (string-match "XEmacs" emacs-version))
 
 
-(defvar mm-running-ntemacs
-  (and (not mm-running-xemacs)
-       (string-match "nt\\|windows" system-configuration)))
-
-(defvar mm-binary-coding-system
+(defconst mm-binary-coding-system
   (if mm-running-xemacs
       'binary 'no-conversion)
   "100% binary coding system.")
 
   (if mm-running-xemacs
       'binary 'no-conversion)
   "100% binary coding system.")
 
-(defvar mm-text-coding-system
-  (cond
-   ((not (fboundp 'coding-system-p)) nil)
-   (mm-running-xemacs  ;; XEmacs
-    'no-conversion)
-   (mm-running-ntemacs ;; NTEmacs
-    (and (coding-system-p 'raw-text-dos) 'raw-text-dos))
-   ((coding-system-p 'raw-text) 'raw-text) ;; Emacs
-   (t nil))
-  "100% text coding system, for removing ^M.")
+(defconst mm-text-coding-system
+  (and (fboundp 'coding-system-list)
+   (if (memq system-type '(windows-nt ms-dos ms-windows))
+       'raw-text-dos 'raw-text))
+  "Text-safe coding system (For removing ^M).")
 
 (defvar mm-mime-mule-charset-alist
   '((us-ascii ascii)
 
 (defvar mm-mime-mule-charset-alist
   '((us-ascii ascii)
@@ -59,9 +50,7 @@
     (iso-8859-8 hebrew-iso8859-8)
     (iso-8859-9 latin-iso8859-9)
     (viscii vietnamese-viscii-lower)
     (iso-8859-8 hebrew-iso8859-8)
     (iso-8859-9 latin-iso8859-9)
     (viscii vietnamese-viscii-lower)
-    (iso-2022-jp-2 japanese-jisx0208)
-    (iso-2022-jp latin-jisx0201
-                japanese-jisx0208-1978)
+    (iso-2022-jp latin-jisx0201 japanese-jisx0208 japanese-jisx0208-1978)
     (euc-kr korean-ksc5601)
     (cn-gb-2312 chinese-gb2312)
     (cn-big5 chinese-big5-1 chinese-big5-2)
     (euc-kr korean-ksc5601)
     (cn-gb-2312 chinese-gb2312)
     (cn-big5 chinese-big5-1 chinese-big5-2)
@@ -215,6 +204,8 @@ used as the line break code type of the coding system."
         (mapcar 'mm-mime-charset
                 (delq 'ascii
                       (mm-find-charset-region b e)))))
         (mapcar 'mm-mime-charset
                 (delq 'ascii
                       (mm-find-charset-region b e)))))
+    (when (memq 'iso-2022-jp-2 charsets)
+      (setq charsets (delq 'iso-2022-jp charsets)))
     (delete-duplicates charsets)))
 
 (defsubst mm-multibyte-p ()
     (delete-duplicates charsets)))
 
 (defsubst mm-multibyte-p ()
@@ -299,6 +290,31 @@ See also `with-temp-file' and `with-output-to-string'."
         arg
       (apply 'concat (nconc (nreverse accum) (list (substring arg pos)))))))
 
         arg
       (apply 'concat (nconc (nreverse accum) (list (substring arg pos)))))))
 
+(defun mm-auto-mode-alist ()
+  "Return an `auto-mode-alist' with only the .gz (etc) thingies."
+  (let ((alist auto-mode-alist)
+       out)
+    (while alist
+      (when (listp (cdar alist))
+       (push (car alist) out))
+      (pop alist))
+    (nreverse out)))
+
+(defun mm-insert-file-contents (filename &optional visit beg end replace)
+  "Like `insert-file-contents', q.v., but only reads in the file.
+A buffer may be modified in several ways after reading into the buffer due
+to advanced Emacs features, such as file-name-handlers, format decoding,
+find-file-hooks, etc.
+  This function ensures that none of these modifications will take place."
+  (let ((format-alist nil)
+       (auto-mode-alist (mm-auto-mode-alist))
+       (default-major-mode 'fundamental-mode)
+       (enable-local-variables nil)
+        (after-insert-file-functions nil)
+       (enable-local-eval nil)
+       (find-file-hooks nil))
+    (insert-file-contents filename visit beg end replace)))
+
 (provide 'mm-util)
 
 ;;; mm-util.el ends here
 (provide 'mm-util)
 
 ;;; mm-util.el ends here
index e664119..010d3f7 100644 (file)
@@ -1,13 +1,11 @@
 ;;; mm-uu.el -- Return uu stuffs as mm handles
 ;;; mm-uu.el -- Return uu stuffs as mm handles
-;; Copyright (c) 1998 by Shenghuo Zhu <zsh@cs.rochester.edu>
+;; Copyright (c) 1998,99 by Shenghuo Zhu
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
-;; $Revision: 1.1.1.14 $
-;; Keywords: news postscript uudecode binhex shar
+;; Keywords: postscript uudecode binhex shar forward
+
+;; This file is part of pgnus.
 
 
-;; This file is not part of GNU Emacs, but the same permissions
-;; apply.
-;;
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either version 2, or (at your option)
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either version 2, or (at your option)
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
-;;
+
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
-;;
+
 
 ;;; Code:
 
 
 ;;; Code:
 
+(require 'mail-parse)
+(require 'message)
+(require 'nnheader)
+(require 'mm-decode)
+(require 'mailcap)
+
 (eval-and-compile
   (autoload 'binhex-decode-region "binhex")
   (autoload 'binhex-decode-region-external "binhex")
 (eval-and-compile
   (autoload 'binhex-decode-region "binhex")
   (autoload 'binhex-decode-region-external "binhex")
 (defconst mm-uu-shar-begin-line "^#! */bin/sh")
 (defconst mm-uu-shar-end-line "^exit 0")
 
 (defconst mm-uu-shar-begin-line "^#! */bin/sh")
 (defconst mm-uu-shar-end-line "^exit 0")
 
-(defvar mm-uu-begin-line
+;;; Thanks to Edward J. Sabol <sabol@alderaan.gsfc.nasa.gov> and 
+;;; Peter von der Ah\'e <pahe@daimi.au.dk>
+(defconst mm-uu-forward-begin-line "^-+ \\(Start of \\)?Forwarded message")
+(defconst mm-uu-forward-end-line "^-+ End of forwarded message")
+
+(defconst mm-uu-begin-line
   (concat mm-uu-postscript-begin-line "\\|"
          mm-uu-uu-begin-line "\\|"
          mm-uu-binhex-begin-line "\\|"
   (concat mm-uu-postscript-begin-line "\\|"
          mm-uu-uu-begin-line "\\|"
          mm-uu-binhex-begin-line "\\|"
-         mm-uu-shar-begin-line))
+         mm-uu-shar-begin-line "\\|"
+         mm-uu-forward-begin-line))
 
 
-(defvar mm-uu-identifier-alist
-  '((?% . postscript) (?b . uu) (?: . binhex) (?# . shar)))
+(defconst mm-uu-identifier-alist
+  '((?% . postscript) (?b . uu) (?: . binhex) (?# . shar)
+    (?- . forward)))
 
 (defvar mm-dissect-disposition "inline"
   "The default disposition of uu parts.
 
 (defvar mm-dissect-disposition "inline"
   "The default disposition of uu parts.
@@ -77,7 +88,9 @@ This can be either \"inline\" or \"attachment\".")
 (defun mm-uu-dissect ()
   "Dissect the current buffer and return a list of uu handles."
   (let (ct ctl cte charset text-start start-char end-char
 (defun mm-uu-dissect ()
   "Dissect the current buffer and return a list of uu handles."
   (let (ct ctl cte charset text-start start-char end-char
-          type file-name end-line result text-plain-type)
+          type file-name end-line result text-plain-type 
+          start-char-1 end-char-1
+          (case-fold-search t))
     (save-excursion
       (save-restriction
        (mail-narrow-to-head)
     (save-excursion
       (save-restriction
        (mail-narrow-to-head)
@@ -97,9 +110,9 @@ This can be either \"inline\" or \"attachment\".")
                                  (if charset
                                      (list (cons 'charset charset)))))
       (while (re-search-forward mm-uu-begin-line nil t)
                                  (if charset
                                      (list (cons 'charset charset)))))
       (while (re-search-forward mm-uu-begin-line nil t)
-       (beginning-of-line)
-       (setq start-char (point))
+       (setq start-char (match-beginning 0))
        (forward-line) ;; in case of failure
        (forward-line) ;; in case of failure
+       (setq start-char-1 (point))
        (setq type (cdr (assq (aref (match-string 0) 0)
                              mm-uu-identifier-alist)))
        (setq file-name
        (setq type (cdr (assq (aref (match-string 0) 0)
                              mm-uu-identifier-alist)))
        (setq file-name
@@ -112,6 +125,7 @@ This can be either \"inline\" or \"attachment\".")
                        (intern (concat "mm-uu-" (symbol-name type)
                                        "-end-line"))))
        (when (re-search-forward end-line nil t)
                        (intern (concat "mm-uu-" (symbol-name type)
                                        "-end-line"))))
        (when (re-search-forward end-line nil t)
+         (setq end-char-1 (match-beginning 0))
          (forward-line)
          (setq end-char (point))
          (when (or (not (eq type 'binhex))
          (forward-line)
          (setq end-char (point))
          (when (or (not (eq type 'binhex))
@@ -128,6 +142,9 @@ This can be either \"inline\" or \"attachment\".")
              ((eq type 'postscript)
               (mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
                     '("application/postscript")))
              ((eq type 'postscript)
               (mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
                     '("application/postscript")))
+             ((eq type 'forward)
+              (mm-make-handle (mm-uu-copy-to-buffer start-char-1 end-char-1)
+                    '("message/rfc822")))
              ((eq type 'uu)
               (mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
                     (list (or (and file-name
              ((eq type 'uu)
               (mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
                     (list (or (and file-name
@@ -172,7 +189,8 @@ This can be either \"inline\" or \"attachment\".")
       (mail-narrow-to-head)
       (goto-char (point-max)))
     (forward-line)
       (mail-narrow-to-head)
       (goto-char (point-max)))
     (forward-line)
-    (let (type end-line result)
+    (let (type end-line result
+              (case-fold-search t))
       (while (and (not result) (re-search-forward mm-uu-begin-line nil t))
        (forward-line)
        (setq type (cdr (assq (aref (match-string 0) 0)
       (while (and (not result) (re-search-forward mm-uu-begin-line nil t))
        (forward-line)
        (setq type (cdr (assq (aref (match-string 0) 0)
index d1993a4..5c7a56e 100644 (file)
@@ -89,7 +89,8 @@
                               (buffer-substring-no-properties 
                                (match-beginning 2) 
                                (match-end 2)))))
                               (buffer-substring-no-properties 
                                (match-beginning 2) 
                                (match-end 2)))))
-           (mm-decode-body charset)
+           (delete-region (point-min) (point-max))
+           (insert (mm-decode-string text charset))
            (save-window-excursion
              (save-restriction
                (let ((w3-strict-width width)
            (save-window-excursion
              (save-restriction
                (let ((w3-strict-width width)
index 16c7341..a77c615 100644 (file)
             ((cdr (assq 'buffer cont))
              (insert-buffer-substring (cdr (assq 'buffer cont))))
             ((setq filename (cdr (assq 'filename cont)))
             ((cdr (assq 'buffer cont))
              (insert-buffer-substring (cdr (assq 'buffer cont))))
             ((setq filename (cdr (assq 'filename cont)))
-             (insert-file-contents filename))
+             (mm-insert-file-contents filename))
             (t
              (save-restriction
                (narrow-to-region (point) (point))
             (t
              (save-restriction
                (narrow-to-region (point) (point))
           ((cdr (assq 'buffer cont))
            (insert-buffer-substring (cdr (assq 'buffer cont))))
           ((setq filename (cdr (assq 'filename cont)))
           ((cdr (assq 'buffer cont))
            (insert-buffer-substring (cdr (assq 'buffer cont))))
           ((setq filename (cdr (assq 'filename cont)))
-           (insert-file-contents filename))
+           (mm-insert-file-contents filename))
           (t
            (insert (cdr (assq 'contents cont)))))
          (setq encoding (mm-encode-buffer type)
           (t
            (insert (cdr (assq 'contents cont)))))
          (setq encoding (mm-encode-buffer type)
         ((cdr (assq 'buffer cont))
          (insert-buffer-substring (cdr (assq 'buffer cont))))
         ((setq filename (cdr (assq 'filename cont)))
         ((cdr (assq 'buffer cont))
          (insert-buffer-substring (cdr (assq 'buffer cont))))
         ((setq filename (cdr (assq 'filename cont)))
-         (insert-file-contents filename))
+         (mm-insert-file-contents filename))
         (t
          (insert (cdr (assq 'contents cont)))))
        (goto-char (point-min))
         (t
          (insert (cdr (assq 'contents cont)))))
        (goto-char (point-min))
index fc7a6ed..81b0fea 100644 (file)
@@ -31,6 +31,7 @@
 (require 'nnmail)
 (require 'nnoo)
 (require 'gnus-util)
 (require 'nnmail)
 (require 'nnoo)
 (require 'gnus-util)
+(require 'mm-util)
 (eval-when-compile (require 'cl))
 
 (nnoo-declare nndoc)
 (eval-when-compile (require 'cl))
 
 (nnoo-declare nndoc)
@@ -289,7 +290,7 @@ from the document.")
        (mm-enable-multibyte)
        (erase-buffer)
        (if (stringp nndoc-address)
        (mm-enable-multibyte)
        (erase-buffer)
        (if (stringp nndoc-address)
-           (nnheader-insert-file-contents nndoc-address)
+           (mm-insert-file-contents nndoc-address)
          (insert-buffer-substring nndoc-address))
        (run-hooks 'nndoc-open-document-hook))))
     ;; Initialize the nndoc structures according to this new document.
          (insert-buffer-substring nndoc-address))
        (run-hooks 'nndoc-open-document-hook))))
     ;; Initialize the nndoc structures according to this new document.
index 72770a9..3168ac5 100644 (file)
@@ -90,7 +90,13 @@ time saver for large mailboxes.")
 (defvoo nnfolder-buffer-alist nil)
 (defvoo nnfolder-scantime-alist nil)
 (defvoo nnfolder-active-timestamp nil)
 (defvoo nnfolder-buffer-alist nil)
 (defvoo nnfolder-scantime-alist nil)
 (defvoo nnfolder-active-timestamp nil)
-(defvoo nnfolder-file-coding-system nnmail-file-coding-system-1)
+(defvoo nnfolder-active-file-coding-system mm-text-coding-system)
+(defvoo nnfolder-active-file-coding-system-for-write 
+    nnmail-active-file-coding-system)
+(defvoo nnfolder-file-coding-system mm-text-coding-system)
+(defvoo nnfolder-file-coding-system-for-write nnheader-file-coding-system
+  "Coding system for save nnfolder file.
+If NIL, NNFOLDER-FILE-CODING-SYSTEM is used.")
 
 \f
 
 
 \f
 
@@ -267,15 +273,14 @@ time saver for large mailboxes.")
   (when group
     (unless (assoc group nnfolder-group-alist)
       (push (list group (cons 1 0)) nnfolder-group-alist)
   (when group
     (unless (assoc group nnfolder-group-alist)
       (push (list group (cons 1 0)) nnfolder-group-alist)
-      (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
+      (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
       (nnfolder-read-folder group)))
   t)
 
 (deffoo nnfolder-request-list (&optional server)
   (nnfolder-possibly-change-group nil server)
   (save-excursion
       (nnfolder-read-folder group)))
   t)
 
 (deffoo nnfolder-request-list (&optional server)
   (nnfolder-possibly-change-group nil server)
   (save-excursion
-    (let ((nnmail-file-coding-system nnmail-active-file-coding-system)
-         (pathname-coding-system 'binary))
+    (let ((nnmail-file-coding-system nnfolder-active-file-coding-system))
       (nnmail-find-file nnfolder-active-file)
       (setq nnfolder-group-alist (nnmail-get-active)))
     t))
       (nnmail-find-file nnfolder-active-file)
       (setq nnfolder-group-alist (nnmail-get-active)))
     t))
@@ -287,7 +292,8 @@ time saver for large mailboxes.")
 (deffoo nnfolder-request-list-newsgroups (&optional server)
   (nnfolder-possibly-change-group nil server)
   (save-excursion
 (deffoo nnfolder-request-list-newsgroups (&optional server)
   (nnfolder-possibly-change-group nil server)
   (save-excursion
-    (nnmail-find-file nnfolder-newsgroups-file)))
+    (let ((nnmail-file-coding-system nnfolder-file-coding-system))
+      (nnmail-find-file nnfolder-newsgroups-file))))
 
 (deffoo nnfolder-request-expire-articles
   (articles newsgroup &optional server force)
 
 (deffoo nnfolder-request-expire-articles
   (articles newsgroup &optional server force)
@@ -320,7 +326,7 @@ time saver for large mailboxes.")
        (nnheader-message 5 "Deleting articles...done"))
       (nnfolder-save-buffer)
       (nnfolder-adjust-min-active newsgroup)
        (nnheader-message 5 "Deleting articles...done"))
       (nnfolder-save-buffer)
       (nnfolder-adjust-min-active newsgroup)
-      (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
+      (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
       (nconc rest articles))))
 
 (deffoo nnfolder-request-move-article (article group server
       (nconc rest articles))))
 
 (deffoo nnfolder-request-move-article (article group server
@@ -352,7 +358,7 @@ time saver for large mailboxes.")
         (when last
           (nnfolder-save-buffer)
           (nnfolder-adjust-min-active group)
         (when last
           (nnfolder-save-buffer)
           (nnfolder-adjust-min-active group)
-          (nnmail-save-active nnfolder-group-alist nnfolder-active-file))))
+          (nnfolder-save-active nnfolder-group-alist nnfolder-active-file))))
       result)))
 
 (deffoo nnfolder-request-accept-article (group &optional server last)
       result)))
 
 (deffoo nnfolder-request-accept-article (group &optional server last)
@@ -390,7 +396,7 @@ time saver for large mailboxes.")
           (nnfolder-save-buffer)
           (when nnmail-cache-accepted-message-ids
             (nnmail-cache-close)))))
           (nnfolder-save-buffer)
           (when nnmail-cache-accepted-message-ids
             (nnmail-cache-close)))))
-      (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
+      (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
       (unless result
        (nnheader-report 'nnfolder "Couldn't store article"))
       result)))
       (unless result
        (nnheader-report 'nnfolder "Couldn't store article"))
       result)))
@@ -433,7 +439,7 @@ time saver for large mailboxes.")
        nnfolder-current-group nil
        nnfolder-current-buffer nil)
   ;; Save the active file.
        nnfolder-current-group nil
        nnfolder-current-buffer nil)
   ;; Save the active file.
-  (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
+  (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
   t)
 
 (deffoo nnfolder-request-rename-group (group new-name &optional server)
   t)
 
 (deffoo nnfolder-request-rename-group (group new-name &optional server)
@@ -452,7 +458,7 @@ time saver for large mailboxes.")
           (setq nnfolder-current-buffer nil
                 nnfolder-current-group nil)
           ;; Save the new group alist.
           (setq nnfolder-current-buffer nil
                 nnfolder-current-group nil)
           ;; Save the new group alist.
-          (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
+          (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
           ;; We kill the buffer instead of renaming it and stuff.
           (kill-buffer (current-buffer))
           t))))
           ;; We kill the buffer instead of renaming it and stuff.
           (kill-buffer (current-buffer))
           t))))
@@ -541,14 +547,14 @@ deleted.  Point is left where the deleted region was."
   ;; Change group.
   (when (and group
             (not (equal group nnfolder-current-group)))
   ;; Change group.
   (when (and group
             (not (equal group nnfolder-current-group)))
-    (let ((pathname-coding-system 'binary))
+    (let ((pathname-coding-system nnmail-pathname-coding-system))
       (nnmail-activate 'nnfolder)
       (when (and (not (assoc group nnfolder-group-alist))
                 (not (file-exists-p
                       (nnfolder-group-pathname group))))
        ;; The group doesn't exist, so we create a new entry for it.
        (push (list group (cons 1 0)) nnfolder-group-alist)
       (nnmail-activate 'nnfolder)
       (when (and (not (assoc group nnfolder-group-alist))
                 (not (file-exists-p
                       (nnfolder-group-pathname group))))
        ;; The group doesn't exist, so we create a new entry for it.
        (push (list group (cons 1 0)) nnfolder-group-alist)
-       (nnmail-save-active nnfolder-group-alist nnfolder-active-file))
+       (nnfolder-save-active nnfolder-group-alist nnfolder-active-file))
 
       (if dont-check
          (setq nnfolder-current-group group
 
       (if dont-check
          (setq nnfolder-current-group group
@@ -578,7 +584,10 @@ deleted.  Point is left where the deleted region was."
              ;; See whether we need to create the new file.
              (unless (file-exists-p file)
                (gnus-make-directory (file-name-directory file))
              ;; See whether we need to create the new file.
              (unless (file-exists-p file)
                (gnus-make-directory (file-name-directory file))
-               (nnmail-write-region 1 1 file t 'nomesg))
+               (let ((nnmail-file-coding-system 
+                      (or nnfolder-file-coding-system-for-write
+                          nnfolder-file-coding-system-for-write)))
+                 (nnmail-write-region 1 1 file t 'nomesg)))
              (when (setq nnfolder-current-buffer (nnfolder-read-folder group))
                (set-buffer nnfolder-current-buffer)
                (push (list group nnfolder-current-buffer)
              (when (setq nnfolder-current-buffer (nnfolder-read-folder group))
                (set-buffer nnfolder-current-buffer)
                (push (list group nnfolder-current-buffer)
@@ -666,7 +675,7 @@ deleted.  Point is left where the deleted region was."
       (when inf
        (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist)))
       (when nnfolder-group-alist
       (when inf
        (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist)))
       (when nnfolder-group-alist
-       (nnmail-save-active nnfolder-group-alist nnfolder-active-file))
+       (nnfolder-save-active nnfolder-group-alist nnfolder-active-file))
       (push (list group (nnfolder-read-folder group))
            nnfolder-buffer-alist))))
 
       (push (list group (nnfolder-read-folder group))
            nnfolder-buffer-alist))))
 
@@ -688,7 +697,7 @@ deleted.  Point is left where the deleted region was."
 (defun nnfolder-read-folder (group)
   (let* ((file (nnfolder-group-pathname group))
         (buffer (set-buffer
 (defun nnfolder-read-folder (group)
   (let* ((file (nnfolder-group-pathname group))
         (buffer (set-buffer
-                 (let ((nnmail-file-coding-system
+                 (let ((nnheader-file-coding-system 
                         nnfolder-file-coding-system))
                    (nnheader-find-file-noselect file)))))
     (if (equal (cadr (assoc group nnfolder-scantime-alist))
                         nnfolder-file-coding-system))
                    (nnheader-find-file-noselect file)))))
     (if (equal (cadr (assoc group nnfolder-scantime-alist))
@@ -772,7 +781,7 @@ deleted.  Point is left where the deleted region was."
 
          (set-marker end nil)
          ;; Make absolutely sure that the active list reflects reality!
 
          (set-marker end nil)
          ;; Make absolutely sure that the active list reflects reality!
-         (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
+         (nnfolder-save-active nnfolder-group-alist nnfolder-active-file)
          ;; Set the scantime for this group.
          (setq newscantime (visited-file-modtime))
          (if scantime
          ;; Set the scantime for this group.
          (setq newscantime (visited-file-modtime))
          (if scantime
@@ -823,7 +832,16 @@ This command does not work if you use short group names."
   (when (buffer-modified-p)
     (run-hooks 'nnfolder-save-buffer-hook)
     (gnus-make-directory (file-name-directory (buffer-file-name)))
   (when (buffer-modified-p)
     (run-hooks 'nnfolder-save-buffer-hook)
     (gnus-make-directory (file-name-directory (buffer-file-name)))
-    (save-buffer)))
+    (let ((coding-system-for-write 
+          (or nnfolder-file-coding-system-for-write
+              nnfolder-file-coding-system)))
+      (save-buffer))))
+
+(defun nnfolder-save-active (group-alist active-file)
+  (let ((nnmail-active-file-coding-system
+        (or nnfolder-active-file-coding-system-for-write
+            nnfolder-active-file-coding-system)))
+    (nnmail-save-active group-alist active-file)))
 
 (provide 'nnfolder)
 
 
 (provide 'nnfolder)
 
index ede54a2..696f7c9 100644 (file)
@@ -471,12 +471,12 @@ the line could be found."
   (when (file-exists-p file)
     (if (eq nnheader-max-head-length t)
        ;; Just read the entire file.
   (when (file-exists-p file)
     (if (eq nnheader-max-head-length t)
        ;; Just read the entire file.
-       (nnheader-insert-file-contents file)
+       (mm-insert-file-contents file)
       ;; Read 1K blocks until we find a separator.
       (let ((beg 0)
            format-alist)
        (while (and (eq nnheader-head-chop-length
       ;; Read 1K blocks until we find a separator.
       (let ((beg 0)
            format-alist)
        (while (and (eq nnheader-head-chop-length
-                       (nth 1 (nnheader-insert-file-contents
+                       (nth 1 (mm-insert-file-contents
                                file nil beg
                                (incf beg nnheader-head-chop-length))))
                    (prog1 (not (search-forward "\n\n" nil t))
                                file nil beg
                                (incf beg nnheader-head-chop-length))))
                    (prog1 (not (search-forward "\n\n" nil t))
@@ -762,10 +762,10 @@ If FILE, find the \".../etc/PACKAGE\" file instead."
       (when (string-match (car ange-ftp-path-format) path)
        (ange-ftp-re-read-dir path)))))
 
       (when (string-match (car ange-ftp-path-format) path)
        (ange-ftp-re-read-dir path)))))
 
-(defvar nnheader-file-coding-system 'binary
+(defvar nnheader-file-coding-system 'raw-text
   "Coding system used in file backends of Gnus.")
 
   "Coding system used in file backends of Gnus.")
 
-(defun nnheader-insert-file-contents (filename &optional visit beg end replace)
+(defun mm-insert-file-contents (filename &optional visit beg end replace)
   "Like `insert-file-contents', q.v., but only reads in the file.
 A buffer may be modified in several ways after reading into the buffer due
 to advanced Emacs features, such as file-name-handlers, format decoding,
   "Like `insert-file-contents', q.v., but only reads in the file.
 A buffer may be modified in several ways after reading into the buffer due
 to advanced Emacs features, such as file-name-handlers, format decoding,
index 3211d69..8818e50 100644 (file)
@@ -80,7 +80,7 @@
          (save-excursion
            (set-buffer nntp-server-buffer)
            (erase-buffer)
          (save-excursion
            (set-buffer nntp-server-buffer)
            (erase-buffer)
-           (nnheader-insert-file-contents nov)
+           (mm-insert-file-contents nov)
            (nnheader-nov-delete-outside-range
             (car articles) (car (last articles)))
            'nov))))))
            (nnheader-nov-delete-outside-range
             (car articles) (car (last articles)))
            'nov))))))
          (nnkiboze-request-scan group))
        (if (not (file-exists-p nov-file))
            (nnheader-report 'nnkiboze "Can't select group %s" group)
          (nnkiboze-request-scan group))
        (if (not (file-exists-p nov-file))
            (nnheader-report 'nnkiboze "Can't select group %s" group)
-         (nnheader-insert-file-contents nov-file)
+         (mm-insert-file-contents nov-file)
          (if (zerop (buffer-size))
              (nnheader-insert "211 0 0 0 %s\n" group)
            (goto-char (point-min))
          (if (zerop (buffer-size))
              (nnheader-insert "211 0 0 0 %s\n" group)
            (goto-char (point-min))
             nnkiboze-remove-read-articles)
     (with-temp-file (nnkiboze-nov-file-name)
       (let ((cur (current-buffer)))
             nnkiboze-remove-read-articles)
     (with-temp-file (nnkiboze-nov-file-name)
       (let ((cur (current-buffer)))
-       (nnheader-insert-file-contents (nnkiboze-nov-file-name))
+       (mm-insert-file-contents (nnkiboze-nov-file-name))
        (goto-char (point-min))
        (while (not (eobp))
          (if (not (gnus-article-read-p (read cur)))
        (goto-char (point-min))
        (while (not (eobp))
          (if (not (gnus-article-read-p (read cur)))
index 3bd4cfb..f196095 100644 (file)
@@ -420,18 +420,16 @@ parameter.  It should return nil, `warn' or `delete'."
 (defun nnmail-request-post (&optional server)
   (mail-send-and-exit nil))
 
 (defun nnmail-request-post (&optional server)
   (mail-send-and-exit nil))
 
-(defvar nnmail-file-coding-system 'binary
+(defvar nnmail-file-coding-system 'raw-text
   "Coding system used in nnmail.")
 
   "Coding system used in nnmail.")
 
-(defvar nnmail-file-coding-system-1
-  (if (string-match "nt\\|windows" system-configuration)
-      'raw-text-dos 'binary)
-  "Another coding system used in nnmail.")
-
 (defvar nnmail-incoming-coding-system
   mm-text-coding-system
   "Coding system used in reading inbox")
 
 (defvar nnmail-incoming-coding-system
   mm-text-coding-system
   "Coding system used in reading inbox")
 
+(defvar nnmail-pathname-coding-system 'binary
+  "*Coding system for pathname.")
+
 (defun nnmail-find-file (file)
   "Insert FILE in server buffer safely."
   (set-buffer nntp-server-buffer)
 (defun nnmail-find-file (file)
   "Insert FILE in server buffer safely."
   (set-buffer nntp-server-buffer)
@@ -441,14 +439,11 @@ parameter.  It should return nil, `warn' or `delete'."
     (condition-case ()
        (let ((coding-system-for-read nnmail-file-coding-system)
              (auto-mode-alist (nnheader-auto-mode-alist))
     (condition-case ()
        (let ((coding-system-for-read nnmail-file-coding-system)
              (auto-mode-alist (nnheader-auto-mode-alist))
-             (pathname-coding-system nnmail-file-coding-system))
+             (pathname-coding-system nnmail-pathname-coding-system))
          (insert-file-contents file)
          t)
       (file-error nil))))
 
          (insert-file-contents file)
          t)
       (file-error nil))))
 
-(defvar nnmail-pathname-coding-system 'binary
-  "*Coding system for pathname.")
-
 (defun nnmail-group-pathname (group dir &optional file)
   "Make pathname for GROUP."
   (concat
 (defun nnmail-group-pathname (group dir &optional file)
   "Make pathname for GROUP."
   (concat
@@ -483,7 +478,7 @@ nn*-request-list should have been called before calling this function."
              group-assoc)))
     group-assoc))
 
              group-assoc)))
     group-assoc))
 
-(defvar nnmail-active-file-coding-system 'binary
+(defvar nnmail-active-file-coding-system 'raw-text
   "*Coding system for active file.")
 
 (defun nnmail-save-active (group-assoc file-name)
   "*Coding system for active file.")
 
 (defun nnmail-save-active (group-assoc file-name)
@@ -840,7 +835,7 @@ FUNC will be called with the buffer narrowed to each mail."
       (set-buffer (get-buffer-create " *nnmail incoming*"))
       (erase-buffer)
       (let ((nnheader-file-coding-system nnmail-incoming-coding-system))
       (set-buffer (get-buffer-create " *nnmail incoming*"))
       (erase-buffer)
       (let ((nnheader-file-coding-system nnmail-incoming-coding-system))
-       (nnheader-insert-file-contents incoming))
+       (mm-insert-file-contents incoming))
       (prog1
          (if (zerop (buffer-size))
              0
       (prog1
          (if (zerop (buffer-size))
              0
@@ -1240,7 +1235,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
        (setq nnmail-cache-buffer
             (get-buffer-create " *nnmail message-id cache*")))
       (when (file-exists-p nnmail-message-id-cache-file)
        (setq nnmail-cache-buffer
             (get-buffer-create " *nnmail message-id cache*")))
       (when (file-exists-p nnmail-message-id-cache-file)
-       (nnheader-insert-file-contents nnmail-message-id-cache-file))
+       (mm-insert-file-contents nnmail-message-id-cache-file))
       (set-buffer-modified-p nil)
       (current-buffer))))
 
       (set-buffer-modified-p nil)
       (current-buffer))))
 
@@ -1461,7 +1456,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
 (defun nnmail-write-region (start end filename &optional append visit lockname)
   "Do a `write-region', and then set the file modes."
   (let ((coding-system-for-write nnmail-file-coding-system)
 (defun nnmail-write-region (start end filename &optional append visit lockname)
   "Do a `write-region', and then set the file modes."
   (let ((coding-system-for-write nnmail-file-coding-system)
-       (pathname-coding-system 'binary))
+       (pathname-coding-system nnmail-pathname-coding-system))
     (write-region start end filename append visit lockname)
     (set-file-modes filename nnmail-default-file-modes)))
 
     (write-region start end filename append visit lockname)
     (set-file-modes filename nnmail-default-file-modes)))
 
index 914adfd..38f36c2 100644 (file)
 (defvoo nnmbox-group-alist nil)
 (defvoo nnmbox-active-timestamp nil)
 
 (defvoo nnmbox-group-alist nil)
 (defvoo nnmbox-active-timestamp nil)
 
+(defvoo nnmbox-file-coding-system mm-text-coding-system)
+(defvoo nnmbox-file-coding-system-for-write nil)
+(defvoo nnmbox-active-file-coding-system mm-text-coding-system)
+(defvoo nnmbox-active-file-coding-system-for-write nil)
+
 \f
 
 ;;; Interface functions
 \f
 
 ;;; Interface functions
                       (1+ (- (cdr active) (car active)))
                       (car active) (cdr active) group)))))
 
                       (1+ (- (cdr active) (car active)))
                       (car active) (cdr active) group)))))
 
+(defun nnmbox-save-buffer ()
+  (let ((coding-system-for-write 
+        (or nnmbox-file-coding-system-for-write
+            nnmbox-file-coding-system)))
+        (save-buffer)))
+
+(defun nnmbox-save-active (group-alist active-file)
+  (let ((nnmail-active-file-coding-system
+        (or nnmbox-active-file-coding-system-for-write
+            nnmbox-active-file-coding-system)))
+    (nnmail-save-active group-alist active-file)))
+
 (deffoo nnmbox-request-scan (&optional group server)
   (nnmbox-possibly-change-newsgroup group server)
   (nnmbox-read-mbox)
 (deffoo nnmbox-request-scan (&optional group server)
   (nnmbox-possibly-change-newsgroup group server)
   (nnmbox-read-mbox)
    (lambda ()
      (save-excursion
        (set-buffer nnmbox-mbox-buffer)
    (lambda ()
      (save-excursion
        (set-buffer nnmbox-mbox-buffer)
-       (save-buffer)))
+       (nnmbox-save-buffer)))
    (file-name-directory nnmbox-mbox-file)
    group
    (lambda ()
    (file-name-directory nnmbox-mbox-file)
    group
    (lambda ()
         (set-buffer nnmbox-mbox-buffer)
         (goto-char (point-max))
         (insert-buffer-substring in-buf)))
         (set-buffer nnmbox-mbox-buffer)
         (goto-char (point-max))
         (insert-buffer-substring in-buf)))
-     (nnmail-save-active nnmbox-group-alist nnmbox-active-file))))
+     (nnmbox-save-active nnmbox-group-alist nnmbox-active-file))))
 
 (deffoo nnmbox-close-group (group &optional server)
   t)
 
 (deffoo nnmbox-close-group (group &optional server)
   t)
   (unless (assoc group nnmbox-group-alist)
     (push (list group (cons 1 0))
          nnmbox-group-alist)
   (unless (assoc group nnmbox-group-alist)
     (push (list group (cons 1 0))
          nnmbox-group-alist)
-    (nnmail-save-active nnmbox-group-alist nnmbox-active-file))
+    (nnmbox-save-active nnmbox-group-alist nnmbox-active-file))
   t)
 
 (deffoo nnmbox-request-list (&optional server)
   (save-excursion
   t)
 
 (deffoo nnmbox-request-list (&optional server)
   (save-excursion
-    (nnmail-find-file nnmbox-active-file)
+    (let ((nnmail-file-coding-system
+          nnmbox-active-file-coding-system))
+      (nnmail-find-file nnmbox-active-file))
     (setq nnmbox-group-alist (nnmail-get-active))
     t))
 
     (setq nnmbox-group-alist (nnmail-get-active))
     t))
 
                (nnmbox-delete-mail))
            (push (car articles) rest)))
        (setq articles (cdr articles)))
                (nnmbox-delete-mail))
            (push (car articles) rest)))
        (setq articles (cdr articles)))
-      (save-buffer)
+      (nnmbox-save-buffer)
       ;; Find the lowest active article in this group.
       (let ((active (nth 1 (assoc newsgroup nnmbox-group-alist))))
        (goto-char (point-min))
       ;; Find the lowest active article in this group.
       (let ((active (nth 1 (assoc newsgroup nnmbox-group-alist))))
        (goto-char (point-min))
                    (<= (car active) (cdr active)))
          (setcar active (1+ (car active)))
          (goto-char (point-min))))
                    (<= (car active) (cdr active)))
          (setcar active (1+ (car active)))
          (goto-char (point-min))))
-      (nnmail-save-active nnmbox-group-alist nnmbox-active-file)
+      (nnmbox-save-active nnmbox-group-alist nnmbox-active-file)
       (nconc rest articles))))
 
 (deffoo nnmbox-request-move-article
       (nconc rest articles))))
 
 (deffoo nnmbox-request-move-article
        (goto-char (point-min))
        (when (search-forward (nnmbox-article-string article) nil t)
         (nnmbox-delete-mail))
        (goto-char (point-min))
        (when (search-forward (nnmbox-article-string article) nil t)
         (nnmbox-delete-mail))
-       (and last (save-buffer))))
+       (and last (nnmbox-save-buffer))))
     result))
 
 (deffoo nnmbox-request-accept-article (group &optional server last)
     result))
 
 (deffoo nnmbox-request-accept-article (group &optional server last)
        (when last
         (when nnmail-cache-accepted-message-ids
           (nnmail-cache-close))
        (when last
         (when nnmail-cache-accepted-message-ids
           (nnmail-cache-close))
-        (nnmail-save-active nnmbox-group-alist nnmbox-active-file)
-        (save-buffer))))
+        (nnmbox-save-active nnmbox-group-alist nnmbox-active-file)
+        (nnmbox-save-buffer))))
     result))
 
 (deffoo nnmbox-request-replace-article (article group buffer)
     result))
 
 (deffoo nnmbox-request-replace-article (article group buffer)
        nil
       (nnmbox-delete-mail t t)
       (insert-buffer-substring buffer)
        nil
       (nnmbox-delete-mail t t)
       (insert-buffer-substring buffer)
-      (save-buffer)
+      (nnmbox-save-buffer)
       t)))
 
 (deffoo nnmbox-request-delete-group (group &optional force server)
       t)))
 
 (deffoo nnmbox-request-delete-group (group &optional force server)
          (setq found t)
          (nnmbox-delete-mail))
        (when found
          (setq found t)
          (nnmbox-delete-mail))
        (when found
-         (save-buffer)))))
+         (nnmbox-save-buffer)))))
   ;; Remove the group from all structures.
   (setq nnmbox-group-alist
        (delq (assoc group nnmbox-group-alist) nnmbox-group-alist)
        nnmbox-current-group nil)
   ;; Save the active file.
   ;; Remove the group from all structures.
   (setq nnmbox-group-alist
        (delq (assoc group nnmbox-group-alist) nnmbox-group-alist)
        nnmbox-current-group nil)
   ;; Save the active file.
-  (nnmail-save-active nnmbox-group-alist nnmbox-active-file)
+  (nnmbox-save-active nnmbox-group-alist nnmbox-active-file)
   t)
 
 (deffoo nnmbox-request-rename-group (group new-name &optional server)
   t)
 
 (deffoo nnmbox-request-rename-group (group new-name &optional server)
        (replace-match new-ident t t)
        (setq found t))
       (when found
        (replace-match new-ident t t)
        (setq found t))
       (when found
-       (save-buffer))))
+       (nnmbox-save-buffer))))
   (let ((entry (assoc group nnmbox-group-alist)))
     (when entry
       (setcar entry new-name))
     (setq nnmbox-current-group nil)
     ;; Save the new group alist.
   (let ((entry (assoc group nnmbox-group-alist)))
     (when entry
       (setcar entry new-name))
     (setq nnmbox-current-group nil)
     ;; Save the new group alist.
-    (nnmail-save-active nnmbox-group-alist nnmbox-active-file)
+    (nnmbox-save-active nnmbox-group-alist nnmbox-active-file)
     t))
 
 \f
     t))
 
 \f
            (not (buffer-name nnmbox-mbox-buffer)))
     (save-excursion
       (set-buffer (setq nnmbox-mbox-buffer
            (not (buffer-name nnmbox-mbox-buffer)))
     (save-excursion
       (set-buffer (setq nnmbox-mbox-buffer
-                       (nnheader-find-file-noselect
-                        nnmbox-mbox-file nil t)))
+                       (let ((nnheader-file-coding-system
+                              nnmbox-file-coding-system))
+                         (nnheader-find-file-noselect
+                          nnmbox-mbox-file nil t))))
       (mm-enable-multibyte)
       (buffer-disable-undo)))
   (when (not nnmbox-group-alist)
       (mm-enable-multibyte)
       (buffer-disable-undo)))
   (when (not nnmbox-group-alist)
 
 (defun nnmbox-create-mbox ()
   (when (not (file-exists-p nnmbox-mbox-file))
 
 (defun nnmbox-create-mbox ()
   (when (not (file-exists-p nnmbox-mbox-file))
-    (nnmail-write-region 1 1 nnmbox-mbox-file t 'nomesg)))
+    (let ((nnmail-file-coding-system
+          nnmbox-file-coding-system-for-write))
+      (nnmail-write-region 1 1 nnmbox-mbox-file t 'nomesg))))
 
 (defun nnmbox-read-mbox ()
   (nnmail-activate 'nnmbox)
 
 (defun nnmbox-read-mbox ()
   (nnmail-activate 'nnmbox)
            (alist nnmbox-group-alist)
            start end number)
        (set-buffer (setq nnmbox-mbox-buffer
            (alist nnmbox-group-alist)
            start end number)
        (set-buffer (setq nnmbox-mbox-buffer
-                         (nnheader-find-file-noselect
-                          nnmbox-mbox-file nil t)))
+                         (let ((nnheader-file-coding-system
+                                nnmbox-file-coding-system))
+                           (nnheader-find-file-noselect
+                            nnmbox-mbox-file nil t))))
        (mm-enable-multibyte)
        (buffer-disable-undo)
 
        (mm-enable-multibyte)
        (buffer-disable-undo)
 
index e47448c..5429682 100644 (file)
@@ -86,7 +86,7 @@ all.  This may very well take some time.")
 
 (defvar nnml-nov-buffer-file-name nil)
 
 
 (defvar nnml-nov-buffer-file-name nil)
 
-(defvoo nnml-file-coding-system nnmail-file-coding-system-1)
+(defvoo nnml-file-coding-system nnmail-file-coding-system)
 
 \f
 
 
 \f
 
@@ -463,7 +463,7 @@ all.  This may very well take some time.")
       (nnheader-report 'nnml "File %s does not exist" file))
      (t
       (with-temp-file file
       (nnheader-report 'nnml "File %s does not exist" file))
      (t
       (with-temp-file file
-       (nnheader-insert-file-contents file)
+       (mm-insert-file-contents file)
        (nnmail-replace-status name value))
       t))))
 
        (nnmail-replace-status name value))
       t))))
 
@@ -519,7 +519,7 @@ all.  This may very well take some time.")
                     nnml-nov-file-name))
        number found)
     (when (file-exists-p nov)
                     nnml-nov-file-name))
        number found)
     (when (file-exists-p nov)
-      (nnheader-insert-file-contents nov)
+      (mm-insert-file-contents nov)
       (while (and (not found)
                  (search-forward id nil t)) ; We find the ID.
        ;; And the id is in the fourth field.
       (while (and (not found)
                  (search-forward id nil t)) ; We find the ID.
        ;; And the id is in the fourth field.
@@ -541,7 +541,7 @@ all.  This may very well take some time.")
        (save-excursion
          (set-buffer nntp-server-buffer)
          (erase-buffer)
        (save-excursion
          (set-buffer nntp-server-buffer)
          (erase-buffer)
-         (nnheader-insert-file-contents nov)
+         (mm-insert-file-contents nov)
          (if (and fetch-old
                   (not (numberp fetch-old)))
              t                         ; Don't remove anything.
          (if (and fetch-old
                   (not (numberp fetch-old)))
              t                         ; Don't remove anything.
@@ -677,7 +677,7 @@ all.  This may very well take some time.")
                       nnml-nov-file-name))
          (erase-buffer)
          (when (file-exists-p nnml-nov-buffer-file-name)
                       nnml-nov-file-name))
          (erase-buffer)
          (when (file-exists-p nnml-nov-buffer-file-name)
-           (nnheader-insert-file-contents nnml-nov-buffer-file-name)))
+           (mm-insert-file-contents nnml-nov-buffer-file-name)))
        (push (cons group buffer) nnml-nov-buffer-alist)
        buffer)))
 
        (push (cons group buffer) nnml-nov-buffer-alist)
        buffer)))
 
@@ -767,7 +767,7 @@ all.  This may very well take some time.")
       (while files
        (unless (file-directory-p (setq file (concat dir (cdar files))))
          (erase-buffer)
       (while files
        (unless (file-directory-p (setq file (concat dir (cdar files))))
          (erase-buffer)
-         (nnheader-insert-file-contents file)
+         (mm-insert-file-contents file)
          (narrow-to-region
           (goto-char (point-min))
           (progn
          (narrow-to-region
           (goto-char (point-min))
           (progn
index 031c0ac..22c22da 100644 (file)
@@ -535,7 +535,7 @@ backend for the messages.")
            (set-buffer (get-buffer-create buffer-name))
            (buffer-disable-undo)
            (push (cons nnsoup-current-group (current-buffer)) nnsoup-buffers)
            (set-buffer (get-buffer-create buffer-name))
            (buffer-disable-undo)
            (push (cons nnsoup-current-group (current-buffer)) nnsoup-buffers)
-           (nnheader-insert-file-contents (concat nnsoup-directory file))
+           (mm-insert-file-contents (concat nnsoup-directory file))
            (current-buffer))))))
 
 (defun nnsoup-file (prefix &optional message)
            (current-buffer))))))
 
 (defun nnsoup-file (prefix &optional message)
@@ -752,7 +752,7 @@ backend for the messages.")
     (while files
       (nnheader-message 5 "Doing %s..." (car files))
       (erase-buffer)
     (while files
       (nnheader-message 5 "Doing %s..." (car files))
       (erase-buffer)
-      (nnheader-insert-file-contents (car files))
+      (mm-insert-file-contents (car files))
       (goto-char (point-min))
       (if (not (re-search-forward "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t *\\(Xref: \\)? *[^ ]* \\([^ ]+\\):[0-9]" nil t))
          (setq group "unknown")
       (goto-char (point-min))
       (if (not (re-search-forward "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t *\\(Xref: \\)? *[^ ]* \\([^ ]+\\):[0-9]" nil t))
          (setq group "unknown")
index 9ad2b4f..2f5ee8c 100644 (file)
@@ -366,7 +366,7 @@ there.")
          (erase-buffer)
          (if nnspool-sift-nov-with-sed
              (nnspool-sift-nov-with-sed articles nov)
          (erase-buffer)
          (if nnspool-sift-nov-with-sed
              (nnspool-sift-nov-with-sed articles nov)
-           (nnheader-insert-file-contents nov)
+           (mm-insert-file-contents nov)
            (if (and fetch-old
                     (not (numberp fetch-old)))
                t                       ; We want all the headers.
            (if (and fetch-old
                     (not (numberp fetch-old)))
                t                       ; We want all the headers.
@@ -439,7 +439,7 @@ there.")
   (erase-buffer)
   (condition-case ()
       (let ((nnheader-file-coding-system nnspool-file-coding-system))
   (erase-buffer)
   (condition-case ()
       (let ((nnheader-file-coding-system nnspool-file-coding-system))
-       (nnheader-insert-file-contents file)
+       (mm-insert-file-contents file)
        t)
     (file-error nil)))
 
        t)
     (file-error nil)))
 
index d46aefd..843e220 100644 (file)
@@ -35,6 +35,7 @@
 (require 'gnus-util)
 (require 'gnus)
 (require 'nnmail)
 (require 'gnus-util)
 (require 'gnus)
 (require 'nnmail)
+(require 'mm-util)
 (eval-when-compile
   (ignore-errors
     (require 'w3)
 (eval-when-compile
   (ignore-errors
     (require 'w3)
@@ -227,7 +228,7 @@ and `altavista'.")
   "Read the overview of GROUP and build the map."
   (when (file-exists-p (nnweb-overview-file group))
     (with-temp-buffer
   "Read the overview of GROUP and build the map."
   (when (file-exists-p (nnweb-overview-file group))
     (with-temp-buffer
-      (nnheader-insert-file-contents (nnweb-overview-file group))
+      (mm-insert-file-contents (nnweb-overview-file group))
       (goto-char (point-min))
       (let (header)
        (while (not (eobp))
       (goto-char (point-min))
       (let (header)
        (while (not (eobp))
index e50a5a4..50fd046 100644 (file)
@@ -24,7 +24,7 @@
 ;;; Code:
 
 (defvar quoted-printable-encoding-characters
 ;;; Code:
 
 (defvar quoted-printable-encoding-characters
-  (mapcar 'identity "0123456789ABCDEF"))
+  (mapcar 'identity "0123456789ABCDEFabcdef"))
 
 (defun quoted-printable-decode-region (from to)
   "Decode quoted-printable in the region between FROM and TO."
 
 (defun quoted-printable-decode-region (from to)
   "Decode quoted-printable in the region between FROM and TO."
index a389d36..6e7512c 100644 (file)
@@ -195,7 +195,14 @@ Should be called narrowed to the head of the message."
         (first t))
     (save-restriction
       (narrow-to-region b e)
         (first t))
     (save-restriction
       (narrow-to-region b e)
-      (mm-encode-coding-region b e mime-charset)
+      (when (eq encoding 'B)
+       ;; break into lines before encoding
+       (goto-char (point-min))
+       (while (not (eobp))
+         (goto-char (min (point-max) (+ 15 (point))))
+         (unless (eobp)
+           (insert "\n"))))
+      (mm-encode-coding-region (point-min) (point-max) mime-charset)
       (funcall (cdr (assq encoding rfc2047-encoding-function-alist))
               (point-min) (point-max))
       (goto-char (point-min))
       (funcall (cdr (assq encoding rfc2047-encoding-function-alist))
               (point-min) (point-max))
       (goto-char (point-min))
@@ -231,12 +238,13 @@ Should be called narrowed to the head of the message."
 
 (defun rfc2047-b-encode-region (b e)
   "Encode the header contained in REGION with the B encoding."
 
 (defun rfc2047-b-encode-region (b e)
   "Encode the header contained in REGION with the B encoding."
-  (base64-encode-region b e t)
-  (goto-char (point-min))
-  (while (not (eobp))
-    (goto-char (min (point-max) (+ 64 (point))))
-    (unless (eobp)
-      (insert "\n"))))
+  (save-restriction
+    (narrow-to-region (goto-char b) e)
+    (while (not (eobp))
+      (base64-encode-region (point) (progn (end-of-line) (point)) t)
+      (if (and (bolp) (eolp))
+         (delete-backward-char 1))
+      (forward-line))))
 
 (defun rfc2047-q-encode-region (b e)
   "Encode the header contained in REGION with the Q encoding."
 
 (defun rfc2047-q-encode-region (b e)
   "Encode the header contained in REGION with the Q encoding."
index 184cc64..a05d47f 100644 (file)
@@ -180,6 +180,8 @@ above them."
           (glyph (make-glyph
                   (list
                    (cons 'x (expand-file-name pixmap smiley-data-directory))
           (glyph (make-glyph
                   (list
                    (cons 'x (expand-file-name pixmap smiley-data-directory))
+                   (cons 'mswindows
+                         (expand-file-name pixmap smiley-data-directory))
                    (cons 'tty smiley)))))
       (setq smiley-glyph-cache (cons (cons pixmap glyph) smiley-glyph-cache))
       (set-glyph-face glyph 'default)
                    (cons 'tty smiley)))))
       (setq smiley-glyph-cache (cons (cons pixmap glyph) smiley-glyph-cache))
       (set-glyph-face glyph 'default)
@@ -228,7 +230,7 @@ above them."
 ;;;###autoload
 (defun smiley-buffer (&optional buffer st nd)
   (interactive)
 ;;;###autoload
 (defun smiley-buffer (&optional buffer st nd)
   (interactive)
-  (when (featurep 'x)
+  (when (featurep '(or x mswindows))
     (save-excursion
       (when buffer
        (set-buffer buffer))
     (save-excursion
       (when buffer
        (set-buffer buffer))
index 2d6386b..83731fa 100644 (file)
@@ -1,3 +1,8 @@
+1999-07-04 04:33:50  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus.texi (Posting Styles): Fix.
+       (Mail in a Newsreader): New.
+
 1999-06-13 02:29:22  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus.texi (MIME Commands): Addition.
 1999-06-13 02:29:22  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus.texi (MIME Commands): Addition.
index e40194a..5e805fa 100644 (file)
@@ -742,9 +742,10 @@ other programs to do things based on the list of @dfn{handles} that are
 returned as a result of this analysis.
 
 @menu
 returned as a result of this analysis.
 
 @menu
-* Dissection::  Analyzing a @sc{mime} message.
-* Handles::     Handle manipulations.
-* Display::     Displaying handles.
+* Dissection::     Analyzing a @sc{mime} message.
+* Handles::        Handle manipulations.
+* Display::        Displaying handles.
+* Customization::  Variables that affect display.
 @end menu
 
 
 @end menu
 
 
@@ -843,6 +844,58 @@ Prompt for a mailcap method to use to view the part.
 @end table
 
 
 @end table
 
 
+@node Customization
+@section Customization
+
+@table @code
+
+@item mm-inline-media-tests
+This is an alist where the key is a @sc{mime} type, the second element
+is a function to display the part @dfn{inline} (i.e., inside Emacs), and 
+the third element is a form to be @code{eval}ed to say whether the part
+can be displayed inline.
+
+This variable specifies whether a part @emph{can} be displayed inline,
+and, if so, how to do it.  It does not say whether parts are
+@emph{actually} displayed inline.
+
+@item mm-inlines-types
+This, on the other hand, says what types are to be displayed inline, if
+they satisfy the conditions set by the variable above.  It's a list of
+@sc{mime} media types.
+
+@item mm-automatic-display
+This is a list of types that are to be displayed ``automatically'', but
+only if the above variable allows it.  That is, only inlinable parts are 
+usually displayed automatically, but in the end, this is up to the
+display agent that's using the @sc{mime} library.
+
+@item mm-attachment-override-types
+Some @sc{mime} agents create parts that have a content-disposition of
+@samp{attachment}.  This variable allows overriding that disposition and 
+displaying the part inline.
+
+@item mm-discouraged-alternatives
+List of @sc{mime} types that are discouraged when viewing
+@samp{multipart/alternative}.  Viewing agents are supposed to view the
+last possible part of a message, as that is supposed to be the richest.
+However, users may prefer other types instead, and this list says what
+types are most unwanted.  If, for instance, @samp{text/html} parts are
+very unwanted, and @samp{text/richtech} parts are somewhat unwanted,
+then the value of this variable should be set to:
+
+@lisp
+("text/html" "text/richtext")
+@end lisp
+
+@item mm-all-images-fit
+If non-@code{nil}, all images will be deemed to fit into the buffer,
+even when they don't.
+
+@end table
+
+
+
 @node Composing
 @chapter Composing
 @cindex Composing
 @node Composing
 @chapter Composing
 @cindex Composing
index a09423a..b1ad151 100644 (file)
@@ -1,7 +1,7 @@
 @c \input texinfo                  @c -*-texinfo-*-
 
 @setfilename gnus
 @c \input texinfo                  @c -*-texinfo-*-
 
 @setfilename gnus
-@settitle Pterodactyl Gnus 0.89 Manual
+@settitle Pterodactyl Gnus 0.91 Manual
 @synindex fn cp
 @synindex vr cp
 @synindex pg cp
 @synindex fn cp
 @synindex vr cp
 @synindex pg cp
@@ -319,7 +319,7 @@ into another language, under the above conditions for modified versions.
 @tex
 
 @titlepage
 @tex
 
 @titlepage
-@title Pterodactyl Gnus 0.89 Manual
+@title Pterodactyl Gnus 0.91 Manual
 
 @author by Lars Magne Ingebrigtsen
 @page
 
 @author by Lars Magne Ingebrigtsen
 @page
@@ -355,7 +355,7 @@ can be gotten by any nefarious means you can think of---@sc{nntp}, local
 spool or your mbox file.  All at the same time, if you want to push your
 luck.
 
 spool or your mbox file.  All at the same time, if you want to push your
 luck.
 
-This manual corresponds to Pterodactyl Gnus 0.89.
+This manual corresponds to Pterodactyl Gnus 0.91.
 
 @end ifinfo
 
 
 @end ifinfo
 
@@ -8947,11 +8947,10 @@ list (it will be @code{eval}ed and the return value will be used).
 
 If you wish to check whether the message you are about to compose is
 meant to be a news article or a mail message, you can check the values
 
 If you wish to check whether the message you are about to compose is
 meant to be a news article or a mail message, you can check the values
-of the two dynamically bound variables @code{message-this-is-news} and
-@code{message-this-is-mail}.
+of the @code{message-news-p} and @code{message-mail-p} functions.
 
 
-@vindex message-this-is-mail
-@vindex message-this-is-news
+@findex message-mail-p
+@findex message-news-p
 
 So here's a new example:
 
 
 So here's a new example:
 
@@ -8966,9 +8965,9 @@ So here's a new example:
          (signature my-funny-signature-randomizer))
         ((equal (system-name) "gnarly")
          (signature my-quote-randomizer))
          (signature my-funny-signature-randomizer))
         ((equal (system-name) "gnarly")
          (signature my-quote-randomizer))
-        (message-this-is-news
+        ((message-news-p)
          (signature my-news-signature))
          (signature my-news-signature))
-        (posting-from-work-p
+        ((posting-from-work-p)
          (signature-file "~/.work-signature")
          (address "user@@bar.foo")
          (body "You are fired.\n\nSincerely, your boss.")
          (signature-file "~/.work-signature")
          (address "user@@bar.foo")
          (body "You are fired.\n\nSincerely, your boss.")
@@ -9906,6 +9905,7 @@ Reading mail with a newsreader---isn't that just plain WeIrD? But of
 course.
 
 @menu
 course.
 
 @menu
+* Mail in a Newsreader::         Important introductory notes.  
 * Getting Started Reading Mail:: A simple cookbook example.
 * Splitting Mail::               How to create mail groups.
 * Mail Sources::                 How to tell Gnus where to get mail from.
 * Getting Started Reading Mail:: A simple cookbook example.
 * Splitting Mail::               How to create mail groups.
 * Mail Sources::                 How to tell Gnus where to get mail from.
@@ -9920,6 +9920,61 @@ course.
 @end menu
 
 
 @end menu
 
 
+@node Mail in a Newsreader
+@subsection Mail in a Newsreader
+
+If you are used to traditional mail readers, but have decided to switch 
+to reading mail with Gnus, you may find yourself experiencing something
+of a culture shock.
+
+Gnus does not behave like traditional mail readers.  If you want to make 
+it behave that way, you can, but it's an uphill battle.
+
+Gnus, by default, handles all its group using the same approach.  This
+approach is very newsreaderly---you enter a group, see the new/unread
+messages, and when you read the messages, they get marked as read, and
+you don't see them any more.  (Unless you explicitly ask for them.)
+
+In particular, you do not do anything explicitly to delete messages.
+
+Does this mean that all the messages that have been marked as read are
+deleted?  How awful!
+
+But, no, it means that old messages are @dfn{expired} according to some
+scheme or other.  For news messages, the expire process is controlled by 
+the news administrator; for mail, the expire process is controlled by
+you.  The expire process for mail is covered in depth in @pxref{Expiring
+Mail}.
+
+What many Gnus users find, after using it a while for both news and
+mail, is that the transport becomes more and more irrelevant.  What
+becomes important is the size of the receiving audience.
+
+Many people subscribe to several mailing lists.  These are transported
+via SMTP, and are therefore mail.  Some people have local news groups
+which have only a handful of readers.  These are transported via NNTP,
+and are therefore news.
+
+The important distinction turns out to be not the transport mechanism,
+but whether the messages are @dfn{personal} or @dfn{public}.  Many users
+then subtly alter the behavior of Gnus according to these two
+categories.
+
+Some users never get comfortable using the Gnus (ahem) paradigm and wish
+that Gnus should grow up and be a male, er, mail reader.  It is possible
+to whip Gnus into a more mailreaderly being, but, as said before, it's
+not easy.  People who prefer proper mail readers should try @sc{vm}
+instead, which is an excellent, and proper, mail reader.
+
+I don't mean to scare anybody off, but I want to make it clear that you
+may be required to learn a new way of thinking about messages.  After
+you've been subjected to The Gnus Way, you will come to love it.  I can
+guarantee it.  (At least the guy who sold me the Emacs Subliminal
+Brain-Washing Functions that I've put into Gnus did guarantee it.  You
+Will Be Assimilated.  You Love Gnus.  You Love The Gnus Mail Way.
+You Do.)
+
+
 @node Getting Started Reading Mail
 @subsection Getting Started Reading Mail
 
 @node Getting Started Reading Mail
 @subsection Getting Started Reading Mail
 
@@ -17985,8 +18040,6 @@ are in the cache.
 @item
  AUTHINFO GENERIC
 @item
 @item
  AUTHINFO GENERIC
 @item
- support qmail maildir spools
-@item
  `run-with-idle-timer' in gnus-demon.
 @item
  stop using invisible text properties and start using overlays instead
  `run-with-idle-timer' in gnus-demon.
 @item
  stop using invisible text properties and start using overlays instead
@@ -19014,6 +19067,9 @@ Under the subject "foo1", you wrote on 01.01.1999:
 @end example
 
 @item
 @end example
 
 @item
+Allow "orphan" scores in the Agent scoring.
+
+@item
 Solve the halting problem.
 
 @c TODO
 Solve the halting problem.
 
 @c TODO
index e4d577c..388f2df 100644 (file)
@@ -1,7 +1,7 @@
 \input texinfo                  @c -*-texinfo-*-
 
 @setfilename message
 \input texinfo                  @c -*-texinfo-*-
 
 @setfilename message
-@settitle Pterodactyl Message 0.89 Manual
+@settitle Pterodactyl Message 0.91 Manual
 @synindex fn cp
 @synindex vr cp
 @synindex pg cp
 @synindex fn cp
 @synindex vr cp
 @synindex pg cp
@@ -42,7 +42,7 @@ into another language, under the above conditions for modified versions.
 @tex
 
 @titlepage
 @tex
 
 @titlepage
-@title Pterodactyl Message 0.89 Manual
+@title Pterodactyl Message 0.91 Manual
 
 @author by Lars Magne Ingebrigtsen
 @page
 
 @author by Lars Magne Ingebrigtsen
 @page
@@ -83,7 +83,7 @@ Message mode buffers.
 * Key Index::         List of Message mode keys.
 @end menu
 
 * Key Index::         List of Message mode keys.
 @end menu
 
-This manual corresponds to Pterodactyl Message 0.89.  Message is
+This manual corresponds to Pterodactyl Message 0.91.  Message is
 distributed with the Gnus distribution bearing the same version number
 as this manual.
 
 distributed with the Gnus distribution bearing the same version number
 as this manual.