comparison lisp/gnus/nnfolder.el @ 42:8b8b7f3559a2 r19-15b104

Import from CVS: tag r19-15b104
author cvs
date Mon, 13 Aug 2007 08:54:51 +0200
parents 1a767b41a199
children 8d2a9b52c682
comparison
equal deleted inserted replaced
41:5d6df4963a99 42:8b8b7f3559a2
375 (forward-line -1) 375 (forward-line -1)
376 (while (re-search-backward (concat "^" nnfolder-article-marker) nil t) 376 (while (re-search-backward (concat "^" nnfolder-article-marker) nil t)
377 (delete-region (point) (progn (forward-line 1) (point)))) 377 (delete-region (point) (progn (forward-line 1) (point))))
378 (when nnmail-cache-accepted-message-ids 378 (when nnmail-cache-accepted-message-ids
379 (nnmail-cache-insert (nnmail-fetch-field "message-id"))) 379 (nnmail-cache-insert (nnmail-fetch-field "message-id")))
380 (setq result 380 (setq result (if (stringp group)
381 (car (nnfolder-save-mail 381 (list (cons group (nnfolder-active-number group)))
382 (if (stringp group) 382 (setq art-group
383 (list (cons group (nnfolder-active-number group))) 383 (nnmail-article-group 'nnfolder-active-number))))
384 (setq art-group 384 (if (null result)
385 (nnmail-article-group 'nnfolder-active-number))))))) 385 (setq result 'junk)
386 (setq result
387 (car (nnfolder-save-mail result)))))
386 (when last 388 (when last
387 (save-excursion 389 (save-excursion
388 (nnfolder-possibly-change-folder (or (caar art-group) group)) 390 (nnfolder-possibly-change-folder (or (caar art-group) group))
389 (nnfolder-save-buffer) 391 (nnfolder-save-buffer)
390 (when nnmail-cache-accepted-message-ids 392 (when nnmail-cache-accepted-message-ids
488 (defun nnfolder-possibly-change-group (group &optional server dont-check) 490 (defun nnfolder-possibly-change-group (group &optional server dont-check)
489 ;; Change servers. 491 ;; Change servers.
490 (when (and server 492 (when (and server
491 (not (nnfolder-server-opened server))) 493 (not (nnfolder-server-opened server)))
492 (nnfolder-open-server server)) 494 (nnfolder-open-server server))
493 (unless (gnus-buffer-live-p nnfolder-current-buffer) 495 (unless (buffer-live-p nnfolder-current-buffer)
494 (setq nnfolder-current-buffer nil 496 (setq nnfolder-current-buffer nil
495 nnfolder-current-group nil)) 497 nnfolder-current-group nil))
496 ;; Change group. 498 ;; Change group.
497 (when (and group 499 (when (and group
498 (not (equal group nnfolder-current-group))) 500 (not (equal group nnfolder-current-group)))
515 517
516 ;; If the buffer is not live, make sure it isn't in the alist. If it 518 ;; If the buffer is not live, make sure it isn't in the alist. If it
517 ;; is live, verify that nobody else has touched the file since last 519 ;; is live, verify that nobody else has touched the file since last
518 ;; time. 520 ;; time.
519 (when (and nnfolder-current-buffer 521 (when (and nnfolder-current-buffer
520 (not (gnus-buffer-live-p nnfolder-current-buffer))) 522 (not (buffer-live-p nnfolder-current-buffer)))
521 (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist) 523 (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist)
522 nnfolder-current-buffer nil)) 524 nnfolder-current-buffer nil))
523 525
524 (setq nnfolder-current-group group) 526 (setq nnfolder-current-group group)
525 527
607 (cdr active))) 609 (cdr active)))
608 610
609 (defun nnfolder-possibly-change-folder (group) 611 (defun nnfolder-possibly-change-folder (group)
610 (let ((inf (assoc group nnfolder-buffer-alist))) 612 (let ((inf (assoc group nnfolder-buffer-alist)))
611 (if (and inf 613 (if (and inf
612 (gnus-buffer-live-p (cadr inf))) 614 (buffer-live-p (cadr inf)))
613 (set-buffer (cadr inf)) 615 (set-buffer (cadr inf))
614 (when inf 616 (when inf
615 (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist))) 617 (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist)))
616 (when nnfolder-group-alist 618 (when nnfolder-group-alist
617 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)) 619 (nnmail-save-active nnfolder-group-alist nnfolder-active-file))
680 ;; unmarked messages from there. 682 ;; unmarked messages from there.
681 (when (not (or nnfolder-distrust-mbox 683 (when (not (or nnfolder-distrust-mbox
682 (< maxid 2))) 684 (< maxid 2)))
683 (goto-char (point-max)) 685 (goto-char (point-max))
684 (unless (re-search-backward marker nil t) 686 (unless (re-search-backward marker nil t)
687 (goto-char (point-min)))
688 (when (nnmail-search-unix-mail-delim)
685 (goto-char (point-min)))) 689 (goto-char (point-min))))
686 690
687 ;; Keep track of the active number on our own, and insert it back 691 ;; Keep track of the active number on our own, and insert it back
688 ;; into the active list when we're done. Also, prime the pump to 692 ;; into the active list when we're done. Also, prime the pump to
689 ;; cut down on the number of searches we do. 693 ;; cut down on the number of searches we do.