Commit 11a5db4a authored by Julien Danjou's avatar Julien Danjou Committed by Katsumi Yamaoka

gnus-group.el: Make gnus-group-default-list-level possibly a function.

parent ce8794df
......@@ -2415,6 +2415,9 @@ one with the best level.
All groups with a level less than or equal to
@code{gnus-group-default-list-level} will be listed in the group buffer
by default.
This variable can also be a function. In that case, that function will
be called and the result will be used as value.
@vindex gnus-group-list-inactive-groups
If @code{gnus-group-list-inactive-groups} is non-@code{nil}, non-active
2010-10-26 Julien Danjou <julien@danjou.info>
* gnus-group.el (gnus-group-default-list-level): Add this function to
compute the default list level.
(gnus-group-default-list-level): Add possibility to use a function.
2010-10-27 Katsumi Yamaoka <yamaoka@jpl.org>
* mm-decode.el (mm-shr): Add undisplayer to MIME handle.
......
......@@ -119,10 +119,11 @@ If nil, only list groups that have unread articles."
:type 'boolean)
(defcustom gnus-group-default-list-level gnus-level-subscribed
"*Default listing level.
"Default listing level.
Ignored if `gnus-group-use-permanent-levels' is non-nil."
:group 'gnus-group-listing
:type 'integer)
:type '(choice (integer :tag "Level")
(function :tag "Function returning level")))
(defcustom gnus-group-list-inactive-groups t
"*If non-nil, inactive groups will be listed."
......@@ -1169,6 +1170,12 @@ The following commands are available:
(mouse-set-point e)
(gnus-group-read-group nil))
(defun gnus-group-default-list-level ()
"Return the real value for `gnus-group-default-list-level'."
(if (functionp gnus-group-default-list-level)
(funcall gnus-group-default-list-level)
gnus-group-default-list-level))
;; Look at LEVEL and find out what the level is really supposed to be.
;; If LEVEL is non-nil, LEVEL will be returned, if not, what happens
;; will depend on whether `gnus-group-use-permanent-levels' is used.
......@@ -1178,13 +1185,13 @@ The following commands are available:
(or (setq gnus-group-use-permanent-levels
(or level (if (numberp gnus-group-use-permanent-levels)
gnus-group-use-permanent-levels
(or gnus-group-default-list-level
(or (gnus-group-default-list-level)
gnus-level-subscribed))))
gnus-group-default-list-level gnus-level-subscribed))
(gnus-group-default-list-level) gnus-level-subscribed))
(number-or-nil
level)
(t
(or level gnus-group-default-list-level gnus-level-subscribed))))
(or level (gnus-group-default-list-level) gnus-level-subscribed))))
(defun gnus-group-setup-buffer ()
(set-buffer (gnus-get-buffer-create gnus-group-buffer))
......@@ -1230,7 +1237,7 @@ Also see the `gnus-group-use-permanent-levels' variable."
(prefix-numeric-value current-prefix-arg)
(or
(gnus-group-default-level nil t)
gnus-group-default-list-level
(gnus-group-default-list-level)
gnus-level-subscribed))))
(unless level
(setq level (car gnus-group-list-mode)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment