Patch by Ed L. Cashin to make gnus-move-split-methods move to
[gnus] / lisp / gnus-sum.el
index 3fcae79..1896c85 100644 (file)
@@ -37,6 +37,7 @@
 (require 'gnus-util)
 (require 'mm-decode)
 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t)
+(autoload 'gnus-cache-write-active "gnus-cache")
 
 (defcustom gnus-kill-summary-on-exit t
   "*If non-nil, kill the summary buffer when you exit from it.
@@ -5845,6 +5846,9 @@ Given a prefix, will force an `article' buffer configuration."
 
 (defun gnus-summary-display-article (article &optional all-header)
   "Display ARTICLE in article buffer."
+  (when (gnus-buffer-live-p gnus-article-buffer)
+    (with-current-buffer gnus-article-buffer
+      (mm-enable-multibyte-mule4)))
   (gnus-set-global-variables)
   (if (null article)
       nil
@@ -5894,9 +5898,6 @@ be displayed."
              force)
          ;; The requested article is different from the current article.
          (progn
-           (when (gnus-buffer-live-p gnus-article-buffer)
-             (with-current-buffer gnus-article-buffer
-               (mm-enable-multibyte-mule4)))
            (gnus-summary-display-article article all-headers)
            (when (gnus-buffer-live-p gnus-article-buffer)
               (with-current-buffer gnus-article-buffer
@@ -6241,9 +6242,6 @@ is a number, it is the line the article is to be displayed on."
             gnus-newsgroup-limit))
     current-prefix-arg
     t))
-  (when (gnus-buffer-live-p gnus-article-buffer)
-    (with-current-buffer gnus-article-buffer
-      (mm-enable-multibyte-mule4)))
   (prog1
       (if (and (stringp article)
               (string-match "@" article))
@@ -9128,7 +9126,7 @@ save those articles instead."
        (set-buffer gnus-original-article-buffer)
        (save-restriction
          (nnheader-narrow-to-headers)
-         (while methods
+         (while (and methods (not split-name))
            (goto-char (point-min))
            (setq method (pop methods))
            (setq match (car method))
@@ -9147,7 +9145,7 @@ save those articles instead."
                    (save-restriction
                      (widen)
                      (setq result (eval match)))))
-             (setq split-name (append (cdr method) split-name))
+             (setq split-name (cdr method))
              (cond ((stringp result)
                     (push (expand-file-name
                            result gnus-article-save-directory)