Index: gnus-group.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-group.el,v retrieving revision 6.73 diff -u -r6.73 gnus-group.el --- gnus-group.el 2002/04/23 01:18:09 6.73 +++ gnus-group.el 2002/05/06 19:42:31 @@ -112,6 +112,29 @@ :group 'gnus-group-levels :type 'boolean) +(defcustom gnus-group-hide-unread-timeout 86400 + "*Ignore a group's hide-unread parameter after this many seconds. +The `hide-unread' group parameter can cause a group to not be listed +in the group buffer if it doesn't have enough unread messages. In low +volume groups, it makes sense to show the group anyway if you haven't +read it in a while. + +First, you must add `gnus-group-set-timestamp' to your +`gnus-select-group-hook'. Otherwise, Gnus doesn't know how long it +has been since you last read a group. + +Second, set this variable to the number of seconds you want to wait +before hide-unread has no effect. + +Note, you can also set the `hide-unread-timeout' parameter on each +group individually -- this variable merely provides a default if +`hide-unread-timeout' is not set on a group." + :group 'gnus-group-listing + :type '(radio (const :tag "No timeout" nil) + (const :tag "One hour" 3600) + (const :tag "One day" 86400) + (integer :tag "Seconds"))) + (defcustom gnus-group-sort-function 'gnus-group-sort-by-alphabet "*Function used for sorting the group buffer. This function will be called with group info entries as the arguments @@ -1130,6 +1153,30 @@ (not test) test)))))) +(defun gnus-group-hide-unread-timeout (group) + "Find the hide-unread timeout for GROUP." + (let ((timeout (or (gnus-group-find-parameter group 'hide-unread-timeout) + gnus-group-hide-unread-timeout))) + (if (numberp timeout) + timeout + nil))) + +(defun gnus-group-unread-threshold (group) + "Find the unread threshold for GROUP. +Any groups with fewer than this many unread articles won't be listed +in the group buffer (at least, simply because they have unread +articles). This function will normally return 0 unless the +`hide-unread' parameter is set on GROUP." + (let ((hide-unread (gnus-group-find-parameter group 'hide-unread)) + timeout) + (if (numberp hide-unread) + (if (and (numberp (setq timeout (gnus-group-hide-unread-timeout + group))) + (< timeout (gnus-group-timestamp-delta group))) + 0 + hide-unread) + 0))) + (defun gnus-group-prepare-flat (level &optional predicate lowest regexp) "List all newsgroups with unread articles of level LEVEL or lower. If PREDICATE is a function, list groups that the function returns non-nil; @@ -1173,7 +1220,7 @@ (if (eq unread t) ; Unactivated? gnus-group-list-inactive-groups ; We list unactivated - (> unread 0)) + (> unread (gnus-group-unread-threshold group))) ; We list groups with unread articles (and gnus-list-groups-with-ticked-articles (cdr (assq 'tick (gnus-info-marks info)))) Index: gnus-topic.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-topic.el,v retrieving revision 6.26 diff -u -r6.26 gnus-topic.el --- gnus-topic.el 2002/05/06 16:52:06 6.26 +++ gnus-topic.el 2002/05/06 19:42:34 @@ -228,7 +228,7 @@ (if (or (eq unread t) (eq unread nil)) gnus-group-list-inactive-groups - (> unread 0)) + (> unread (gnus-group-unread-threshold group))) (and gnus-list-groups-with-ticked-articles (cdr (assq 'tick (gnus-info-marks info)))) ;; Has right readedness. Index: nnmaildir.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnmaildir.el,v retrieving revision 6.17 diff -u -r6.17 nnmaildir.el --- nnmaildir.el 2002/04/22 02:28:17 6.17 +++ nnmaildir.el 2002/05/06 19:42:38 @@ -134,6 +134,7 @@ (error nil :type string) ;; last error message, or nil (mtime nil :type list) ;; modtime of dir (gnm nil) ;; flag: split from mail-sources? + (courier nil) ;; flag: create maildirs w/ leading '.' (create-dir nil :type string)) ;; group creation directory (defmacro nnmaildir--nlist-last-num (nlist) @@ -541,6 +542,10 @@ (car x) (setf (nnmaildir--srv-gnm server) t) (require 'nnmail)) + (and (setq x (assq 'courier-compatible defs)) + (setq x (cdr x)) + (car x) + (setf (nnmaildir--srv-courier server) t)) (setq x (assq 'create-directory defs)) (when x (setq x (cadr x) @@ -897,7 +902,7 @@ (nnmaildir--prepare server nil) (catch 'return (let ((create-dir (nnmaildir--srv-create-dir nnmaildir--cur-server)) - srv-dir dir groups) + srv-dir dir groups maildir) (when (zerop (length gname)) (setf (nnmaildir--srv-error nnmaildir--cur-server) "Invalid (empty) group name") @@ -922,13 +927,21 @@ (setq dir srv-dir dir (file-truename dir) dir (concat dir create-dir))) - (setq dir (nnmaildir--subdir (file-name-as-directory dir) gname)) + (setq dir (file-name-as-directory dir)) + (setq maildir (concat dir + (if (nnmaildir--srv-courier nnmaildir--cur-server) + (concat "." gname) + gname))) + (when (equal (file-name-as-directory maildir) (nnmaildir--nndir dir)) + (setf (nnmaildir--srv-error nnmaildir--cur-server) + (concat "Group name may not be " gname)) + (throw 'return nil)) + (setq dir (file-name-as-directory maildir)) (nnmaildir--mkdir dir) (nnmaildir--mkdir (nnmaildir--tmp dir)) (nnmaildir--mkdir (nnmaildir--new dir)) (nnmaildir--mkdir (nnmaildir--cur dir)) - (setq create-dir (file-name-as-directory create-dir)) - (make-symbolic-link (concat create-dir gname) (concat srv-dir gname)) + (make-symbolic-link maildir (concat srv-dir gname)) (nnmaildir-request-scan 'find-new-groups)))) (defun nnmaildir-request-rename-group (gname new-name &optional server)