Merge gnus-6_5-tomo.
authormorioka <morioka>
Mon, 22 Jun 1998 17:35:27 +0000 (17:35 +0000)
committermorioka <morioka>
Mon, 22 Jun 1998 17:35:27 +0000 (17:35 +0000)
ChangeLog
lisp/gnus-art.el
lisp/gnus-sum.el
lisp/gnus.el
texi/gnus-ja.texi
texi/gnus.texi

index ee9b1be..209dfd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * lisp/gnus-art.el (gnus-article-display-mime-message): Use
+       `mime-display-message' instead of `mime-view-buffer'.
+       (gnus-article-display-traditional-message): Set
+       `gnus-article-buffer'.
+       (gnus-article-display-message-with-encoded-word): Modify for
+       `gnus-article-display-traditional-message'.
+       (gnus-article-prepare): Use `mime-parse-buffer' and
+       `mime-entity-fetch-field'; don't set gnus-article-buffer.
+
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * lisp/gnus-sum.el (gnus-summary-move-article): Use
+       `gnus-request-original-article' instead of
+       `gnus-request-article-this-buffer'.
+
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * texi/gnus-ja.texi, texi/gnus.texi (Using MIME): Modify
+       description about new display mechanism.
+
+1998-06-19  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
+
+       * lisp/gnus.el (gnus-version-number): Update to 6.6.0.
+       (gnus-version): Modify for this branch.
+
+       * lisp/gnus-art.el (gnus-article-display-method-for-mime): New
+       variable; abolish `gnus-show-mime-method'.
+       (gnus-article-display-method-for-encoded-word): New variable;
+       abolish `gnus-decode-encoded-word-method'.
+       (gnus-article-display-method-for-traditional): New variable.
+       (gnus-article-display-mime-message): New function; abolish
+       `gnus-article-preview-mime-message'.
+       (gnus-article-display-traditional-message): New function.
+       (gnus-article-display-message-with-encoded-word): New function;
+       abolish `gnus-article-decode-encoded-word'.
+       (gnus-article-prepare): Change display mechanism; use
+       `gnus-request-original-article' instead of
+       `gnus-request-article-this-buffer'.
+       (gnus-request-original-article): New function.
+
 1998-06-22  MORIOKA Tomohiko  <morioka@jaist.ac.jp>
 
        * lisp/gnus.el (gnus-version-number): Update to 6.6.0.
index 0508d68..d7070ef 100644 (file)
@@ -368,14 +368,23 @@ be used as possible file names."
   :group 'gnus-article-mime
   :type 'boolean)
 
-(defcustom gnus-show-mime-method 'gnus-article-preview-mime-message
-  "Function to process a MIME message.
+(defcustom gnus-article-display-method-for-mime
+  'gnus-article-display-mime-message
+  "Function to display a MIME message.
 The function is called from the article buffer."
   :group 'gnus-article-mime
   :type 'function)
 
-(defcustom gnus-decode-encoded-word-method 'gnus-article-decode-encoded-word
-  "*Function to decode MIME encoded words.
+(defcustom gnus-article-display-method-for-encoded-word
+  'gnus-article-display-message-with-encoded-word
+  "*Function to display a message with MIME encoded-words.
+The function is called from the article buffer."
+  :group 'gnus-article-mime
+  :type 'function)
+
+(defcustom gnus-article-display-method-for-traditional
+  'gnus-article-display-traditional-message
+  "*Function to display a traditional message.
 The function is called from the article buffer."
   :group 'gnus-article-mime
   :type 'function)
@@ -1948,7 +1957,8 @@ commands:
 ;;; @@ article filters
 ;;;
 
-(defun gnus-article-preview-mime-message ()
+(defun gnus-article-display-mime-message ()
+  "Article display method for MIME message."
   (make-local-variable 'mime-button-mother-dispatcher)
   (setq mime-button-mother-dispatcher
        (function gnus-article-push-button))
@@ -1958,21 +1968,33 @@ commands:
            default-mime-charset))
        )
     (save-excursion
-      (mime-view-buffer gnus-original-article-buffer gnus-article-buffer
-                       nil gnus-article-mode-map)
+      (mime-display-message mime-message-structure
+                           gnus-article-buffer nil gnus-article-mode-map)
+                           
       ))
   (run-hooks 'gnus-mime-article-prepare-hook)
   )
 
-(defun gnus-article-decode-encoded-word ()
-  "Header filter for gnus-article-mode."
+(defun gnus-article-display-traditional-message ()
+  "Article display method for traditional message."
+  (set-buffer gnus-article-buffer)
+  (let (buffer-read-only)
+    (erase-buffer)
+    (insert-buffer-substring gnus-original-article-buffer)
+    ))
+
+(defun gnus-article-display-message-with-encoded-word ()
+  "Article display method for message with encoded-words."
   (let ((charset (save-excursion
                   (set-buffer gnus-summary-buffer)
                   default-mime-charset)))
-    (eword-decode-header charset)
-    (goto-char (point-min))
-    (if (search-forward "\n\n" nil t)
-       (decode-mime-charset-region (match-end 0) (point-max) charset))
+    (gnus-article-display-traditional-message)
+    (let (buffer-read-only)
+      (eword-decode-header charset)
+      (goto-char (point-min))
+      (if (search-forward "\n\n" nil t)
+         (decode-mime-charset-region (match-end 0) (point-max) charset))
+      )
     (mime-maybe-hide-echo-buffer)
     )
   (gnus-run-hooks 'gnus-mime-article-prepare-hook)
@@ -2000,14 +2022,14 @@ If ALL-HEADERS is non-nil, no headers are hidden."
           result)
       (save-excursion
        (gnus-article-setup-buffer)
-       (set-buffer gnus-article-buffer)
+       (set-buffer gnus-original-article-buffer)
        ;; Deactivate active regions.
        (when (and (boundp 'transient-mark-mode)
                   transient-mark-mode)
          (setq mark-active nil))
-       (if (not (setq result (let ((buffer-read-only nil))
-                               (gnus-request-article-this-buffer
-                                article group))))
+       (if (not (setq result
+                      (let ((buffer-read-only nil))
+                        (gnus-request-original-article article group))))
            ;; There is no such article.
            (save-excursion
              (when (and (numberp article)
@@ -2070,17 +2092,22 @@ If ALL-HEADERS is non-nil, no headers are hidden."
                      (or all-headers gnus-show-all-headers))))
            (when (or (numberp article)
                      (stringp article))
-             ;; Hooks for getting information from the article.
-             ;; This hook must be called before being narrowed.
-             (let (buffer-read-only)
+             (let ((method
+                    (if gnus-show-mime
+                        (progn
+                          (mime-parse-buffer)
+                          (if (or (not gnus-strict-mime)
+                                  (mime-entity-fetch-field
+                                   mime-message-structure "MIME-Version"))
+                              gnus-article-display-method-for-mime
+                            gnus-article-display-method-for-encoded-word))
+                      gnus-article-display-method-for-traditional)))
+               ;; Hooks for getting information from the article.
+               ;; This hook must be called before being narrowed.
                (gnus-run-hooks 'internal-hook)
                (gnus-run-hooks 'gnus-article-prepare-hook)
-               ;; Decode MIME message.
-               (when gnus-show-mime
-                 (if (or (not gnus-strict-mime)
-                         (gnus-fetch-field "Mime-Version"))
-                     (funcall gnus-show-mime-method)
-                   (funcall gnus-decode-encoded-word-method)))
+               ;; Display message.
+               (funcall method)
                ;; Perform the article display hooks.
                (gnus-run-hooks 'gnus-article-display-hook))
              ;; Do page break.
@@ -2513,6 +2540,124 @@ If given a prefix, show the hidden text instead."
                            (point))
          (set-buffer buf))))))
 
+(defun gnus-request-original-article (article group)
+  "Get an article and insert it into original article buffer."
+  (let (do-update-line)
+    (prog1
+       (save-excursion
+         (erase-buffer)
+         (gnus-kill-all-overlays)
+         (setq group (or group gnus-newsgroup-name))
+
+         ;; Open server if it has closed.
+         (gnus-check-server (gnus-find-method-for-group group))
+
+         ;; Using `gnus-request-article' directly will insert the article into
+         ;; `nntp-server-buffer' - so we'll save some time by not having to
+         ;; copy it from the server buffer into the article buffer.
+
+         ;; We only request an article by message-id when we do not have the
+         ;; headers for it, so we'll have to get those.
+         (when (stringp article)
+           (let ((gnus-override-method gnus-refer-article-method))
+             (gnus-read-header article)))
+
+         ;; If the article number is negative, that means that this article
+         ;; doesn't belong in this newsgroup (possibly), so we find its
+         ;; message-id and request it by id instead of number.
+         (when (and (numberp article)
+                    gnus-summary-buffer
+                    (get-buffer gnus-summary-buffer)
+                    (gnus-buffer-exists-p gnus-summary-buffer))
+           (save-excursion
+             (set-buffer gnus-summary-buffer)
+             (let ((header (gnus-summary-article-header article)))
+               (when (< article 0)
+                 (cond
+                  ((memq article gnus-newsgroup-sparse)
+                   ;; This is a sparse gap article.
+                   (setq do-update-line article)
+                   (setq article (mail-header-id header))
+                   (let ((gnus-override-method gnus-refer-article-method))
+                     (gnus-read-header article))
+                   (setq gnus-newsgroup-sparse
+                         (delq article gnus-newsgroup-sparse)))
+                  ((vectorp header)
+                   ;; It's a real article.
+                   (setq article (mail-header-id header)))
+                  (t
+                   ;; It is an extracted pseudo-article.
+                   (setq article 'pseudo)
+                   (gnus-request-pseudo-article header))))
+
+               (let ((method (gnus-find-method-for-group
+                              gnus-newsgroup-name)))
+                 (when (and (eq (car method) 'nneething)
+                            (vectorp header))
+                   (let ((dir (concat (file-name-as-directory (nth 1 method))
+                                      (mail-header-subject header))))
+                     (when (file-directory-p dir)
+                       (setq article 'nneething)
+                       (gnus-group-enter-directory dir))))))))
+
+         (cond
+          ;; Refuse to select canceled articles.
+          ((and (numberp article)
+                gnus-summary-buffer
+                (get-buffer gnus-summary-buffer)
+                (gnus-buffer-exists-p gnus-summary-buffer)
+                (eq (cdr (save-excursion
+                           (set-buffer gnus-summary-buffer)
+                           (assq article gnus-newsgroup-reads)))
+                    gnus-canceled-mark))
+           nil)
+          ;; Check the backlog.
+          ((and gnus-keep-backlog
+                (gnus-backlog-request-article group article (current-buffer)))
+           'article)
+          ;; Check asynchronous pre-fetch.
+          ((gnus-async-request-fetched-article group article (current-buffer))
+           (gnus-async-prefetch-next group article gnus-summary-buffer)
+           (when (and (numberp article) gnus-keep-backlog)
+             (gnus-backlog-enter-article group article (current-buffer)))
+           'article)
+          ;; Check the cache.
+          ((and gnus-use-cache
+                (numberp article)
+                (gnus-cache-request-article article group))
+           'article)
+          ;; Get the article and put into the article buffer.
+          ((or (stringp article) (numberp article))
+           (let ((gnus-override-method
+                  (and (stringp article) gnus-refer-article-method))
+                 (buffer-read-only nil))
+             (erase-buffer)
+             (gnus-kill-all-overlays)
+             (when (gnus-request-article article group (current-buffer))
+               (when (numberp article)
+                 (gnus-async-prefetch-next group article gnus-summary-buffer)
+                 (when gnus-keep-backlog
+                   (gnus-backlog-enter-article
+                    group article (current-buffer))))
+               'article)))
+          ;; It was a pseudo.
+          (t article)))
+
+      ;; Associate this article with the current summary buffer.
+      (setq gnus-article-current-summary gnus-summary-buffer)
+
+      ;; Update sparse articles.
+      (when (and do-update-line
+                (or (numberp article)
+                    (stringp article)))
+       (let ((buf (current-buffer)))
+         (set-buffer gnus-summary-buffer)
+         (gnus-summary-update-article do-update-line)
+         (gnus-summary-goto-subject do-update-line nil t)
+         (set-window-point (get-buffer-window (current-buffer) t)
+                           (point))
+         (set-buffer buf))))))
+
 ;;;
 ;;; Article editing
 ;;;
index e0aba4e..b086438 100644 (file)
@@ -6907,7 +6907,7 @@ and `request-accept' functions."
        ((eq action 'copy)
         (save-excursion
           (set-buffer copy-buf)
-          (when (gnus-request-article-this-buffer article gnus-newsgroup-name)
+          (when (gnus-request-original-article article gnus-newsgroup-name)
             (gnus-request-accept-article
              to-newsgroup select-method (not articles)))))
        ;; Crosspost the article.
@@ -6928,7 +6928,7 @@ and `request-accept' functions."
           (save-excursion
             (set-buffer copy-buf)
             ;; First put the article in the destination group.
-            (gnus-request-article-this-buffer article gnus-newsgroup-name)
+            (gnus-request-original-article article gnus-newsgroup-name)
             (when (consp (setq art-group
                                (gnus-request-accept-article
                                 to-newsgroup select-method (not articles))))
@@ -7021,7 +7021,7 @@ and `request-accept' functions."
          (when (eq action 'crosspost)
            (save-excursion
              (set-buffer copy-buf)
-             (gnus-request-article-this-buffer article gnus-newsgroup-name)
+             (gnus-request-original-article article gnus-newsgroup-name)
              (nnheader-replace-header "Xref" new-xref)
              (gnus-request-replace-article
               article gnus-newsgroup-name (current-buffer)))))
index a41ad38..64d361e 100644 (file)
@@ -254,7 +254,7 @@ is restarted, and sometimes reloaded."
   "Version number for this version of gnus.")
 
 (defconst gnus-version
-  (format "Semi-gnus %s (based on Gnus 5.6.11; for SEMI 1.8)"
+  (format "Chao-gnus %s (based on Gnus 5.6.11; for SEMI 1.8)"
           gnus-version-number)
   "Version string for this version of gnus.")
 
index 811c94e..d06b99c 100644 (file)
@@ -7718,14 +7718,14 @@ Gnus \e$B$O%X%C%@!<$NJB$YBX$(\e(B(sort)\e$B$b9T$$$^$9!J$3$l$O%G%#%U%)%k%H$G9T$o$l$^
 \e$B3J9%$N5-;v$GKd$a9~$`$3$H$5$(2DG=$K$7$^$9!#\e(B
 
 @vindex gnus-show-mime
-@vindex gnus-show-mime-method
+@vindex gnus-article-display-method-for-mime
 @vindex gnus-strict-mime
-@findex metamail-buffer
-Gnus \e$B$O\e(B @code{gnus-show-mime-method} \e$B$K5-;v$r2!$7IU$1$k$3$H$G\e(B @sc{mime} \e$B$r\e(B
-\e$B07$$$^$9!#$3$l$O%G%#%U%)%k%H$G$O\e(B @code{gnus-show-mime-method} \e$B$G$9!#$3$N4X\e(B
-\e$B?t$O\e(B SEMI MIME-View \e$B%W%m%0%i%`$r8F$S=P$7$F<B:]$N=hM}$r9T$$$^$9!#\e(BSEMI
-MIME-View \e$B$K4X$9$k>\$7$$>pJs$O!"%^%K%e%"%k$r;2>H$7$F$/$@$5$$!J$^$@$J$$$1$I\e(B
-(;_;)\e$B!K!#\e(B
+@findex gnus-article-display-mime-message
+Gnus \e$B$O\e(B @code{gnus-article-display-method-for-mime} \e$B$K5-;v$r2!$7IU$1$k$3\e(B
+\e$B$H$G\e(B @sc{mime} \e$B$r07$$$^$9!#$3$N=i4|CM$O\e(B
+@code{gnus-article-display-mime-message} \e$B$G$9!#$3$N4X?t$O\e(B SEMI MIME-View 
+\e$B%W%m%0%i%`$r8F$S=P$7$F<B:]$N=hM}$r9T$$$^$9!#\e(BSEMI MIME-View \e$B$K4X$9$k>\$7\e(B
+\e$B$$>pJs$O!"%^%K%e%"%k$r;2>H$7$F$/$@$5$$!J$^$@$J$$$1$I\e(B(;_;)\e$B!K!#\e(B
 
 @sc{mime} \e$B$r>o$K;HMQ$7$?$1$l$P!"\e(B@code{gnus-show-mime} \e$B$r\e(B 
 @code{t} \e$B$K@_Dj$7$F$/$@$5$$!#$7$+$7!"\e(B@code{gnus-strict-mime} \e$B$,\e(B 
index 1c66d0d..42638fb 100644 (file)
@@ -7817,14 +7817,15 @@ of the characters, and it also makes it possible to embed pictures and
 other naughty stuff in innocent-looking articles.
 
 @vindex gnus-show-mime
-@vindex gnus-show-mime-method
+@vindex gnus-article-display-method-for-mime
 @vindex gnus-strict-mime
-@findex metamail-buffer
+@findex gnus-article-display-mime-message
 Gnus handles @sc{mime} by pushing the articles through
-@code{gnus-show-mime-method}, which is @code{gnus-show-mime-method} by
-default.  This function calls the SEMI MIME-View program to actually do
-the work.  For more information on SEMI MIME-View, see its manual page
-(however it is not existed yet, sorry).
+@code{gnus-article-display-method-for-mime}, which is
+@code{gnus-article-display-mime-message} by default.  This function
+calls the SEMI MIME-View program to actually do the work.  For more
+information on SEMI MIME-View, see its manual page (however it is not
+existed yet, sorry).
 
 Set @code{gnus-show-mime} to @code{t} if you want to use
 @sc{mime} all the time.  However, if @code{gnus-strict-mime} is