comparison lisp/gnus/nnfolder.el @ 34:d620409f5eb8 r19-15b100

Import from CVS: tag r19-15b100
author cvs
date Mon, 13 Aug 2007 08:53:20 +0200
parents e04119814345
children c53a95d3c46d
comparison
equal deleted inserted replaced
33:9ee3cade837d 34:d620409f5eb8
351 (goto-char (point-min)) 351 (goto-char (point-min))
352 (when (search-forward (nnfolder-article-string article) nil t) 352 (when (search-forward (nnfolder-article-string article) nil t)
353 (nnfolder-delete-mail)) 353 (nnfolder-delete-mail))
354 (when last 354 (when last
355 (nnfolder-save-buffer) 355 (nnfolder-save-buffer)
356 (nnfolder-adjust-min-active group)))) 356 (nnfolder-adjust-min-active group)
357 (nnmail-save-active nnfolder-group-alist nnfolder-active-file))))
357 result)) 358 result))
358 359
359 (deffoo nnfolder-request-accept-article (group &optional server last) 360 (deffoo nnfolder-request-accept-article (group &optional server last)
360 (nnfolder-possibly-change-group group server) 361 (nnfolder-possibly-change-group group server)
361 (nnmail-check-syntax) 362 (nnmail-check-syntax)
447 ;; Find the lowest active article in this group. 448 ;; Find the lowest active article in this group.
448 (let* ((active (cadr (assoc group nnfolder-group-alist))) 449 (let* ((active (cadr (assoc group nnfolder-group-alist)))
449 (marker (concat "\n" nnfolder-article-marker)) 450 (marker (concat "\n" nnfolder-article-marker))
450 (number "[0-9]+") 451 (number "[0-9]+")
451 (activemin (cdr active))) 452 (activemin (cdr active)))
452 (goto-char (point-min)) 453 (save-excursion
453 (while (and (search-forward marker nil t) 454 (set-buffer nnfolder-current-buffer)
454 (re-search-forward number nil t)) 455 (goto-char (point-min))
455 (setq activemin (min activemin 456 (while (and (search-forward marker nil t)
456 (string-to-number (buffer-substring 457 (re-search-forward number nil t))
457 (match-beginning 0) 458 (setq activemin (min activemin
458 (match-end 0)))))) 459 (string-to-number (buffer-substring
459 (setcar active activemin))) 460 (match-beginning 0)
461 (match-end 0))))))
462 (setcar active activemin))))
460 463
461 (defun nnfolder-article-string (article) 464 (defun nnfolder-article-string (article)
462 (if (numberp article) 465 (if (numberp article)
463 (concat "\n" nnfolder-article-marker (int-to-string article) " ") 466 (concat "\n" nnfolder-article-marker (int-to-string article) " ")
464 (concat "\nMessage-ID: " article))) 467 (concat "\nMessage-ID: " article)))
482 (defun nnfolder-possibly-change-group (group &optional server dont-check) 485 (defun nnfolder-possibly-change-group (group &optional server dont-check)
483 ;; Change servers. 486 ;; Change servers.
484 (when (and server 487 (when (and server
485 (not (nnfolder-server-opened server))) 488 (not (nnfolder-server-opened server)))
486 (nnfolder-open-server server)) 489 (nnfolder-open-server server))
490 (unless (gnus-buffer-live-p nnfolder-current-buffer)
491 (setq nnfolder-current-buffer nil
492 nnfolder-current-group nil))
487 ;; Change group. 493 ;; Change group.
488 (when (and group 494 (when (and group
489 (not (equal group nnfolder-current-group))) 495 (not (equal group nnfolder-current-group)))
490 (nnmail-activate 'nnfolder) 496 (nnmail-activate 'nnfolder)
491 (when (and (not (assoc group nnfolder-group-alist)) 497 (when (and (not (assoc group nnfolder-group-alist))
493 (nnfolder-group-pathname group)))) 499 (nnfolder-group-pathname group))))
494 ;; The group doesn't exist, so we create a new entry for it. 500 ;; The group doesn't exist, so we create a new entry for it.
495 (push (list group (cons 1 0)) nnfolder-group-alist) 501 (push (list group (cons 1 0)) nnfolder-group-alist)
496 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)) 502 (nnmail-save-active nnfolder-group-alist nnfolder-active-file))
497 503
498 (unless dont-check 504 (if dont-check
505 (setq nnfolder-current-group group)
499 (let (inf file) 506 (let (inf file)
500 ;; If we have to change groups, see if we don't already have the 507 ;; If we have to change groups, see if we don't already have the
501 ;; folder in memory. If we do, verify the modtime and destroy 508 ;; folder in memory. If we do, verify the modtime and destroy
502 ;; the folder if needed so we can rescan it. 509 ;; the folder if needed so we can rescan it.
503 (when (setq inf (assoc group nnfolder-buffer-alist)) 510 (when (setq inf (assoc group nnfolder-buffer-alist))