Mercurial > emacs
comparison lisp/gnus/nnvirtual.el @ 82951:0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Thu, 22 Jul 2004 16:45:51 +0000 |
parents | 695cf19ef79e |
children | 18a818a2ee7c cce1c0ee76ee |
comparison
equal
deleted
inserted
replaced
56503:8bbd2323fbf2 | 82951:0fde48feb604 |
---|---|
1 ;;; nnvirtual.el --- virtual newsgroups access for Gnus | 1 ;;; nnvirtual.el --- virtual newsgroups access for Gnus |
2 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002 | 2 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 |
3 ;; Free Software Foundation, Inc. | 3 ;; Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: David Moore <dmoore@ucsd.edu> | 5 ;; Author: David Moore <dmoore@ucsd.edu> |
6 ;; Lars Magne Ingebrigtsen <larsi@gnus.org> | 6 ;; Lars Magne Ingebrigtsen <larsi@gnus.org> |
7 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> | 7 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> |
8 ;; Keywords: news | 8 ;; Keywords: news |
9 | 9 |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 | 11 |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
43 (eval-when-compile (require 'cl)) | 43 (eval-when-compile (require 'cl)) |
44 | 44 |
45 (nnoo-declare nnvirtual) | 45 (nnoo-declare nnvirtual) |
46 | 46 |
47 (defvoo nnvirtual-always-rescan t | 47 (defvoo nnvirtual-always-rescan t |
48 "*If non-nil, always scan groups for unread articles when entering a group. | 48 "If non-nil, always scan groups for unread articles when entering a group. |
49 If this variable is nil and you read articles in a component group | 49 If this variable is nil and you read articles in a component group |
50 after the virtual group has been activated, the read articles from the | 50 after the virtual group has been activated, the read articles from the |
51 component group will show up when you enter the virtual group.") | 51 component group will show up when you enter the virtual group.") |
52 | 52 |
53 (defvoo nnvirtual-component-regexp nil | 53 (defvoo nnvirtual-component-regexp nil |
54 "*Regexp to match component groups.") | 54 "Regexp to match component groups.") |
55 | 55 |
56 (defvoo nnvirtual-component-groups nil | 56 (defvoo nnvirtual-component-groups nil |
57 "Component group in this nnvirtual group.") | 57 "Component group in this nnvirtual group.") |
58 | 58 |
59 | 59 |
372 (setq unexpired (nconc unexpired | 372 (setq unexpired (nconc unexpired |
373 (mapcar | 373 (mapcar |
374 #'(lambda (article) | 374 #'(lambda (article) |
375 (nnvirtual-reverse-map-article | 375 (nnvirtual-reverse-map-article |
376 group article)) | 376 group article)) |
377 (gnus-group-expire-articles-1 group))))) | 377 (gnus-uncompress-range |
378 (sort unexpired '<))) | 378 (gnus-group-expire-articles-1 group)))))) |
379 (sort (delq nil unexpired) '<))) | |
379 | 380 |
380 | 381 |
381 ;;; Internal functions. | 382 ;;; Internal functions. |
382 | 383 |
383 (defun nnvirtual-convert-headers () | 384 (defun nnvirtual-convert-headers () |
423 (goto-char (point-min)) | 424 (goto-char (point-min)) |
424 (when (re-search-forward | 425 (when (re-search-forward |
425 (concat (regexp-quote (gnus-group-real-name group)) ":[0-9]+") | 426 (concat (regexp-quote (gnus-group-real-name group)) ":[0-9]+") |
426 nil t) | 427 nil t) |
427 (replace-match "" t t)) | 428 (replace-match "" t t)) |
428 (unless (= (point) (point-max)) | 429 (unless (eobp) |
429 (insert " ") | 430 (insert " ") |
430 (when (not (string= "" prefix)) | 431 (when (not (string= "" prefix)) |
431 (while (re-search-forward "[^ ]+:[0-9]+" nil t) | 432 (while (re-search-forward "[^ ]+:[0-9]+" nil t) |
432 (save-excursion | 433 (save-excursion |
433 (goto-char (match-beginning 0)) | 434 (goto-char (match-beginning 0)) |
518 (car lists) | 519 (car lists) |
519 (sort (apply 'nconc lists) '<))) | 520 (sort (apply 'nconc lists) '<))) |
520 | 521 |
521 | 522 |
522 ;;; We map between virtual articles and real articles in a manner | 523 ;;; We map between virtual articles and real articles in a manner |
523 ;;; which keeps the size of the virtual active list the same as | 524 ;;; which keeps the size of the virtual active list the same as the |
524 ;;; the sum of the component active lists. | 525 ;;; sum of the component active lists. |
525 ;;; To achieve fair mixing of the groups, the last article in | 526 |
526 ;;; each of N component groups will be in the last N articles | 527 ;;; To achieve fair mixing of the groups, the last article in each of |
527 ;;; in the virtual group. | 528 ;;; N component groups will be in the last N articles in the virtual |
528 | 529 ;;; group. |
529 ;;; If you have 3 components A, B and C, with articles 1-8, 1-5, and 6-7 | 530 |
530 ;;; respectively, then the virtual article numbers look like: | 531 ;;; If you have 3 components A, B and C, with articles 1-8, 1-5, and |
532 ;;; 6-7 respectively, then the virtual article numbers look like: | |
531 ;;; | 533 ;;; |
532 ;;; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 534 ;;; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
533 ;;; A1 A2 A3 A4 B1 A5 B2 A6 B3 A7 B4 C6 A8 B5 C7 | 535 ;;; A1 A2 A3 A4 B1 A5 B2 A6 B3 A7 B4 C6 A8 B5 C7 |
534 | 536 |
535 ;;; To compute these mappings we generate a couple tables and then | 537 ;;; To compute these mappings we generate a couple tables and then |