* gnus-sum.el (gnus-summary-catchup-and-goto-next-group): Select
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 1 Dec 1999 14:39:36 +0000 (14:39 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 1 Dec 1999 14:39:36 +0000 (14:39 +0000)
next group in a more normal fasion.

* mml.el (mml-boundary-function): New variable.
(mml-compute-boundary): Use it.

* nnmh.el (nnmh-active-number): Skip past files that have buffers
that exist for them.

* gnus-async.el (gnus-async-prefetch-next): Cancel timers.
(gnus-async-timer): New variable.

lisp/ChangeLog
lisp/gnus-async.el
lisp/gnus-sum.el
lisp/mml.el
lisp/nnmh.el

index 4d0632f..4ee6509 100644 (file)
@@ -1,3 +1,17 @@
+1999-12-01 14:28:49  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-sum.el (gnus-summary-catchup-and-goto-next-group): Select
+       next group in a more normal fasion.
+
+       * mml.el (mml-boundary-function): New variable.
+       (mml-compute-boundary): Use it.
+
+       * nnmh.el (nnmh-active-number): Skip past files that have buffers
+       that exist for them.
+
+       * gnus-async.el (gnus-async-prefetch-next): Cancel timers.
+       (gnus-async-timer): New variable.
+
 1999-11-30 02:07:18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * nnultimate.el (nnultimate-request-list): Be more lenient with
index 6cfc152..d9cf5fe 100644 (file)
@@ -80,6 +80,7 @@ It should return non-nil if the article is to be prefetched."
 (defvar gnus-async-hashtb nil)
 (defvar gnus-async-current-prefetch-group nil)
 (defvar gnus-async-current-prefetch-article nil)
+(defvar gnus-async-timer nil)
 
 (defvar gnus-async-prefetch-headers-buffer " *Async Prefetch Headers*")
 (defvar gnus-async-header-prefetched nil)
@@ -146,8 +147,13 @@ It should return non-nil if the article is to be prefetched."
              ;; do this, which leads to slightly slower article
              ;; buffer display.
              (gnus-async-prefetch-article group next summary)
-           (run-with-idle-timer
-            0.1 nil 'gnus-async-prefetch-article group next summary)))))))
+           (when gnus-async-timer
+             (ignore-errors
+               (cancel-timer 'gnus-async-timer)))
+           (setq gnus-async-timer
+                 (run-with-idle-timer
+                  0.1 nil 'gnus-async-prefetch-article
+                  group next summary))))))))
 
 (defun gnus-async-prefetch-article (group article summary &optional next)
   "Possibly prefetch several articles starting with ARTICLE."
index c62bbb3..ae200b1 100644 (file)
@@ -8416,7 +8416,6 @@ If prefix argument ALL is non-nil, all articles are marked as read."
   (interactive "P")
   (gnus-summary-catchup-and-exit t quietly))
 
-;; Suggested by "Arne Eofsson" <arne@hodgkin.mbi.ucla.edu>.
 (defun gnus-summary-catchup-and-goto-next-group (&optional all)
   "Mark all articles in this group as read and select the next group.
 If given a prefix, mark all articles, unread as well as ticked, as
@@ -8424,7 +8423,7 @@ read."
   (interactive "P")
   (save-excursion
     (gnus-summary-catchup all))
-  (gnus-summary-next-group t nil nil))
+  (gnus-summary-next-group))
 
 ;; Thread-based commands.
 
index 2edd362..e84e955 100644 (file)
@@ -57,6 +57,13 @@ contents of this part.")
     (modify-syntax-entry ?\' " " table)
     table))
 
+(defvar mml-boundary-function 'mml-make-boundary
+  "A function called to suggest a boundary.
+The function may be called several times, and should try to make a new
+suggestion each time.  The function is called with one parameter,
+which is a number that says how many times the function has been
+called for this message.")
+
 (defun mml-parse ()
   "Parse the current buffer as an MML document."
   (goto-char (point-min))
@@ -304,7 +311,8 @@ contents of this part.")
 
 (defun mml-compute-boundary (cont)
   "Return a unique boundary that does not exist in CONT."
-  (let ((mml-boundary (mml-make-boundary)))
+  (let ((mml-boundary (funcall mml-boundary-function
+                              (incf mml-multipart-number))))
     ;; This function tries again and again until it has found
     ;; a unique boundary.
     (while (not (catch 'not-unique
@@ -327,16 +335,17 @@ contents of this part.")
        (goto-char (point-min))
        (when (re-search-forward (concat "^--" (regexp-quote mml-boundary))
                                 nil t)
-         (setq mml-boundary (mml-make-boundary))
+         (setq mml-boundary (funcall mml-boundary-function
+                                     (incf mml-multipart-number)))
          (throw 'not-unique nil))))
      ((eq (car cont) 'multipart)
       (mapcar 'mml-compute-boundary-1 (cddr cont))))
     t))
 
-(defun mml-make-boundary ()
-  (concat (make-string (% (incf mml-multipart-number) 60) ?=)
-         (if (> mml-multipart-number 17)
-             (format "%x" mml-multipart-number)
+(defun mml-make-boundary (number)
+  (concat (make-string (% number 60) ?=)
+         (if (> number 17)
+             (format "%x" number)
            "")
          mml-base-boundary))
 
index cfe41ab..0224709 100644 (file)
   "Compute the next article number in GROUP."
   (let ((active (cadr (assoc group nnmh-group-alist)))
        (dir (nnmail-group-pathname group nnmh-directory))
-       (pathname-coding-system 'binary))
+       (pathname-coding-system 'binary)
+       file)
     (unless active
       ;; The group wasn't known to nnmh, so we just create an active
       ;; entry for it.
        (when files
          (setcdr active (car files)))))
     (setcdr active (1+ (cdr active)))
-    (while (file-exists-p
-           (concat (nnmail-group-pathname group nnmh-directory)
-                   (int-to-string (cdr active))))
+    (while (or
+           ;; See whether the file exists...
+           (file-exists-p
+            (setq file (concat (nnmail-group-pathname group nnmh-directory)
+                               (int-to-string (cdr active)))))
+           ;; ... or there is a buffer that will make that file exist
+           ;; in the future.
+           (get-file-buffer file))
+      ;; Skip past that file.
       (setcdr active (1+ (cdr active))))
     (cdr active)))