diff options
| -rw-r--r-- | lisp/gnus/gnus-group.el | 98 |
1 files changed, 43 insertions, 55 deletions
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 144496bdd2a..0956dc46d05 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el | |||
| @@ -1320,7 +1320,7 @@ if it is a string, only list groups matching REGEXP." | |||
| 1320 | gnus-group-listed-groups) | 1320 | gnus-group-listed-groups) |
| 1321 | ;; List living groups, according to order in `gnus-group-list'. | 1321 | ;; List living groups, according to order in `gnus-group-list'. |
| 1322 | (dolist (g (cdr gnus-group-list)) | 1322 | (dolist (g (cdr gnus-group-list)) |
| 1323 | (setq info (nth 1 (gethash g gnus-newsrc-hashtb)) | 1323 | (setq info (gnus-get-info g) |
| 1324 | group (gnus-info-group info) | 1324 | group (gnus-info-group info) |
| 1325 | params (gnus-info-params info) | 1325 | params (gnus-info-params info) |
| 1326 | unread (gnus-group-unread group)) | 1326 | unread (gnus-group-unread group)) |
| @@ -1389,39 +1389,35 @@ if it is a string, only list groups matching REGEXP." | |||
| 1389 | ;; List zombies and killed lists somewhat faster, which was | 1389 | ;; List zombies and killed lists somewhat faster, which was |
| 1390 | ;; suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. It does | 1390 | ;; suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. It does |
| 1391 | ;; this by ignoring the group format specification altogether. | 1391 | ;; this by ignoring the group format specification altogether. |
| 1392 | (let (group) | 1392 | (if (nthcdr gnus-group-listing-limit groups) |
| 1393 | (if (> (length groups) gnus-group-listing-limit) | 1393 | (dolist (group groups) |
| 1394 | (while groups | ||
| 1395 | (setq group (pop groups)) | ||
| 1396 | (when (gnus-group-prepare-logic | ||
| 1397 | group | ||
| 1398 | (or (not regexp) | ||
| 1399 | (and (stringp regexp) (string-match regexp group)) | ||
| 1400 | (and (functionp regexp) (funcall regexp group)))) | ||
| 1401 | (add-text-properties | ||
| 1402 | (point) (prog1 (1+ (point)) | ||
| 1403 | (insert " " mark " *: " | ||
| 1404 | (gnus-group-decoded-name group) | ||
| 1405 | "\n")) | ||
| 1406 | (list 'gnus-group (gethash group gnus-active-hashtb) | ||
| 1407 | 'gnus-unread t | ||
| 1408 | 'gnus-level level)))) | ||
| 1409 | (while groups | ||
| 1410 | (setq group (pop groups)) | ||
| 1411 | (when (gnus-group-prepare-logic | 1394 | (when (gnus-group-prepare-logic |
| 1412 | group | 1395 | group |
| 1413 | (or (not regexp) | 1396 | (cond ((not regexp)) |
| 1414 | (and (stringp regexp) (string-match regexp group)) | 1397 | ((stringp regexp) (string-match-p regexp group)) |
| 1415 | (and (functionp regexp) (funcall regexp group)))) | 1398 | ((functionp regexp) (funcall regexp group)))) |
| 1416 | (gnus-group-insert-group-line | 1399 | (add-text-properties |
| 1417 | group level nil | 1400 | (point) (prog1 (1+ (point)) |
| 1418 | (let ((active (gnus-active group))) | 1401 | (insert " " mark " *: " |
| 1419 | (if active | 1402 | (gnus-group-decoded-name group) |
| 1420 | (if (zerop (cdr active)) | 1403 | "\n")) |
| 1421 | 0 | 1404 | (list 'gnus-group group |
| 1422 | (- (1+ (cdr active)) (car active))) | 1405 | 'gnus-unread t |
| 1423 | nil)) | 1406 | 'gnus-level level)))) |
| 1424 | (gnus-method-simplify (gnus-find-method-for-group group)))))))) | 1407 | (dolist (group groups) |
| 1408 | (when (gnus-group-prepare-logic | ||
| 1409 | group | ||
| 1410 | (cond ((not regexp)) | ||
| 1411 | ((stringp regexp) (string-match-p regexp group)) | ||
| 1412 | ((functionp regexp) (funcall regexp group)))) | ||
| 1413 | (gnus-group-insert-group-line | ||
| 1414 | group level nil | ||
| 1415 | (let ((active (gnus-active group))) | ||
| 1416 | (and active | ||
| 1417 | (if (zerop (cdr active)) | ||
| 1418 | 0 | ||
| 1419 | (- (cdr active) (car active) -1)))) | ||
| 1420 | (gnus-method-simplify (gnus-find-method-for-group group))))))) | ||
| 1425 | 1421 | ||
| 1426 | (defun gnus-group-update-group-line () | 1422 | (defun gnus-group-update-group-line () |
| 1427 | "Update the current line in the group buffer." | 1423 | "Update the current line in the group buffer." |
| @@ -1527,7 +1523,7 @@ if it is a string, only list groups matching REGEXP." | |||
| 1527 | (int-to-string (max 0 (- gnus-tmp-number-total number))) | 1523 | (int-to-string (max 0 (- gnus-tmp-number-total number))) |
| 1528 | "*")) | 1524 | "*")) |
| 1529 | (gnus-tmp-subscribed | 1525 | (gnus-tmp-subscribed |
| 1530 | (cond ((<= gnus-tmp-level gnus-level-subscribed) ? ) | 1526 | (cond ((<= gnus-tmp-level gnus-level-subscribed) ?\s) |
| 1531 | ((<= gnus-tmp-level gnus-level-unsubscribed) ?U) | 1527 | ((<= gnus-tmp-level gnus-level-unsubscribed) ?U) |
| 1532 | ((= gnus-tmp-level gnus-level-zombie) ?Z) | 1528 | ((= gnus-tmp-level gnus-level-zombie) ?Z) |
| 1533 | (t ?K))) | 1529 | (t ?K))) |
| @@ -1546,7 +1542,7 @@ if it is a string, only list groups matching REGEXP." | |||
| 1546 | (gnus-tmp-moderated | 1542 | (gnus-tmp-moderated |
| 1547 | (if (and gnus-moderated-hashtb | 1543 | (if (and gnus-moderated-hashtb |
| 1548 | (gethash gnus-tmp-group gnus-moderated-hashtb)) | 1544 | (gethash gnus-tmp-group gnus-moderated-hashtb)) |
| 1549 | ?m ? )) | 1545 | ?m ?\s)) |
| 1550 | (gnus-tmp-moderated-string | 1546 | (gnus-tmp-moderated-string |
| 1551 | (if (eq gnus-tmp-moderated ?m) "(m)" "")) | 1547 | (if (eq gnus-tmp-moderated ?m) "(m)" "")) |
| 1552 | (gnus-tmp-group-icon (gnus-group-get-icon gnus-tmp-group)) | 1548 | (gnus-tmp-group-icon (gnus-group-get-icon gnus-tmp-group)) |
| @@ -1560,15 +1556,15 @@ if it is a string, only list groups matching REGEXP." | |||
| 1560 | (if (and (numberp number) | 1556 | (if (and (numberp number) |
| 1561 | (zerop number) | 1557 | (zerop number) |
| 1562 | (cdr (assq 'tick gnus-tmp-marked))) | 1558 | (cdr (assq 'tick gnus-tmp-marked))) |
| 1563 | ?* ? )) | 1559 | ?* ?\s)) |
| 1564 | (gnus-tmp-summary-live | 1560 | (gnus-tmp-summary-live |
| 1565 | (if (and (not gnus-group-is-exiting-p) | 1561 | (if (and (not gnus-group-is-exiting-p) |
| 1566 | (gnus-buffer-live-p (gnus-summary-buffer-name | 1562 | (gnus-buffer-live-p (gnus-summary-buffer-name |
| 1567 | gnus-tmp-group))) | 1563 | gnus-tmp-group))) |
| 1568 | ?* ? )) | 1564 | ?* ?\s)) |
| 1569 | (gnus-tmp-process-marked | 1565 | (gnus-tmp-process-marked |
| 1570 | (if (member gnus-tmp-group gnus-group-marked) | 1566 | (if (member gnus-tmp-group gnus-group-marked) |
| 1571 | gnus-process-mark ? )) | 1567 | gnus-process-mark ?\s)) |
| 1572 | (buffer-read-only nil) | 1568 | (buffer-read-only nil) |
| 1573 | beg end | 1569 | beg end |
| 1574 | gnus-tmp-header) ; passed as parameter to user-funcs. | 1570 | gnus-tmp-header) ; passed as parameter to user-funcs. |
| @@ -1768,10 +1764,8 @@ already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated." | |||
| 1768 | (defun gnus-group-group-name () | 1764 | (defun gnus-group-group-name () |
| 1769 | "Get the name of the newsgroup on the current line." | 1765 | "Get the name of the newsgroup on the current line." |
| 1770 | (let ((group (get-text-property (point-at-bol) 'gnus-group))) | 1766 | (let ((group (get-text-property (point-at-bol) 'gnus-group))) |
| 1771 | (when group | 1767 | (cond ((stringp group) group) |
| 1772 | (if (stringp group) | 1768 | (group (symbol-name group))))) |
| 1773 | group | ||
| 1774 | (symbol-name group))))) | ||
| 1775 | 1769 | ||
| 1776 | (defun gnus-group-group-level () | 1770 | (defun gnus-group-group-level () |
| 1777 | "Get the level of the newsgroup on the current line." | 1771 | "Get the level of the newsgroup on the current line." |
| @@ -1791,7 +1785,7 @@ already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated." | |||
| 1791 | (defun gnus-group-new-mail (group) | 1785 | (defun gnus-group-new-mail (group) |
| 1792 | (if (nnmail-new-mail-p (gnus-group-real-name group)) | 1786 | (if (nnmail-new-mail-p (gnus-group-real-name group)) |
| 1793 | gnus-new-mail-mark | 1787 | gnus-new-mail-mark |
| 1794 | ? )) | 1788 | ?\s)) |
| 1795 | 1789 | ||
| 1796 | (defun gnus-group-level (group) | 1790 | (defun gnus-group-level (group) |
| 1797 | "Return the estimated level of GROUP." | 1791 | "Return the estimated level of GROUP." |
| @@ -1881,7 +1875,7 @@ If FIRST-TOO, the current line is also eligible as a target." | |||
| 1881 | (if unmark | 1875 | (if unmark |
| 1882 | (progn | 1876 | (progn |
| 1883 | (setq gnus-group-marked (delete group gnus-group-marked)) | 1877 | (setq gnus-group-marked (delete group gnus-group-marked)) |
| 1884 | (insert-char ? 1 t)) | 1878 | (insert-char ?\s 1 t)) |
| 1885 | (setq gnus-group-marked | 1879 | (setq gnus-group-marked |
| 1886 | (cons group (delete group gnus-group-marked))) | 1880 | (cons group (delete group gnus-group-marked))) |
| 1887 | (insert-char gnus-process-mark 1 t))) | 1881 | (insert-char gnus-process-mark 1 t))) |
| @@ -2561,10 +2555,10 @@ If TEST-MARKED, the line must be marked." | |||
| 2561 | (when group | 2555 | (when group |
| 2562 | (let ((start (point)) | 2556 | (let ((start (point)) |
| 2563 | (active (and (or | 2557 | (active (and (or |
| 2564 | ;; some kind of group may be only there. | 2558 | ;; Some kind of group may be only there. |
| 2565 | (gethash group gnus-active-hashtb) | 2559 | (gnus-active group) |
| 2566 | ;; all groups (but with exception) are there. | 2560 | ;; All groups (but with exception) are there. |
| 2567 | (gethash group gnus-newsrc-hashtb)) | 2561 | (gnus-group-entry group)) |
| 2568 | group))) | 2562 | group))) |
| 2569 | (beginning-of-line) | 2563 | (beginning-of-line) |
| 2570 | (cond | 2564 | (cond |
| @@ -4013,15 +4007,9 @@ entail asking the server for the groups." | |||
| 4013 | (gnus-agent gnus-plugged)); If we're actually plugged, store the active file in the agent. | 4007 | (gnus-agent gnus-plugged)); If we're actually plugged, store the active file in the agent. |
| 4014 | (gnus-read-active-file))) | 4008 | (gnus-read-active-file))) |
| 4015 | ;; Find all groups and sort them. | 4009 | ;; Find all groups and sort them. |
| 4016 | (let ((groups | 4010 | (let ((buffer-read-only nil)) |
| 4017 | (sort | ||
| 4018 | (hash-table-keys gnus-active-hashtb) | ||
| 4019 | 'string<)) | ||
| 4020 | (buffer-read-only nil) | ||
| 4021 | group) | ||
| 4022 | (erase-buffer) | 4011 | (erase-buffer) |
| 4023 | (while groups | 4012 | (dolist (group (sort (hash-table-keys gnus-active-hashtb) #'string<)) |
| 4024 | (setq group (pop groups)) | ||
| 4025 | (add-text-properties | 4013 | (add-text-properties |
| 4026 | (point) (prog1 (1+ (point)) | 4014 | (point) (prog1 (1+ (point)) |
| 4027 | (insert " *: " | 4015 | (insert " *: " |