mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 08:43:40 -07:00
Make `gnus-group-use-permanent-levels' work better
* lisp/gnus/gnus-group.el (gnus-group-default-level): Removed implicit setting of gnus-group-use-permanent-levels. (gnus-group-list-groups): Set gnus-group-use-permanent-levels explicitly. (gnus-group-get-new-news): Set gnus-group-use-permanent-levels explicitly (bug#50417). (gnus-group-get-new-news): When the user has given a numeric prefix, use that as the list level.
This commit is contained in:
parent
bd4a2fc385
commit
7f9ca3b2f4
1 changed files with 17 additions and 11 deletions
|
|
@ -1176,11 +1176,11 @@ The following commands are available:
|
|||
(defun gnus-group-default-level (&optional level number-or-nil)
|
||||
(cond
|
||||
(gnus-group-use-permanent-levels
|
||||
(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)
|
||||
gnus-level-subscribed))))
|
||||
(or level
|
||||
(if (numberp gnus-group-use-permanent-levels)
|
||||
gnus-group-use-permanent-levels
|
||||
(or (gnus-group-default-list-level)
|
||||
gnus-level-subscribed))
|
||||
(gnus-group-default-list-level) gnus-level-subscribed))
|
||||
(number-or-nil
|
||||
level)
|
||||
|
|
@ -1228,20 +1228,23 @@ The following commands are available:
|
|||
(let ((charset (gnus-group-name-charset nil string)))
|
||||
(gnus-group-name-decode string charset)))
|
||||
|
||||
(defun gnus-group-list-groups (&optional level unread lowest)
|
||||
(defun gnus-group-list-groups (&optional level unread lowest update-level)
|
||||
"List newsgroups with level LEVEL or lower that have unread articles.
|
||||
Default is all subscribed groups.
|
||||
If argument UNREAD is non-nil, groups with no unread articles are also
|
||||
listed.
|
||||
|
||||
Also see the `gnus-group-use-permanent-levels' variable."
|
||||
Also see the `gnus-group-use-permanent-levels' variable. If this
|
||||
variable is non-nil, and UPDATE-LEVEL is non-nil (which is the
|
||||
case interactively), the level will be updated by this command."
|
||||
(interactive
|
||||
(list (if current-prefix-arg
|
||||
(prefix-numeric-value current-prefix-arg)
|
||||
(or
|
||||
(gnus-group-default-level nil t)
|
||||
(gnus-group-default-list-level)
|
||||
gnus-level-subscribed)))
|
||||
gnus-level-subscribed))
|
||||
nil nil t)
|
||||
gnus-group-mode)
|
||||
(unless level
|
||||
(setq level (car gnus-group-list-mode)
|
||||
|
|
@ -1288,7 +1291,9 @@ Also see the `gnus-group-use-permanent-levels' variable."
|
|||
(goto-char (point-max))
|
||||
(forward-line -1)))))))
|
||||
;; Adjust cursor point.
|
||||
(gnus-group-position-point)))
|
||||
(gnus-group-position-point)
|
||||
(when (and update-level gnus-group-use-permanent-levels)
|
||||
(setq gnus-group-use-permanent-levels level))))
|
||||
|
||||
(defun gnus-group-list-level (level &optional all)
|
||||
"List groups on LEVEL.
|
||||
|
|
@ -4205,8 +4210,9 @@ otherwise all levels below ARG will be scanned too."
|
|||
|
||||
(gnus-check-reasonable-setup)
|
||||
(gnus-run-hooks 'gnus-after-getting-new-news-hook)
|
||||
(gnus-group-list-groups (and (numberp arg)
|
||||
(max (car gnus-group-list-mode) arg)))))
|
||||
(gnus-group-list-groups (and (numberp arg) arg))
|
||||
(when gnus-group-use-permanent-levels
|
||||
(setq gnus-group-use-permanent-levels (gnus-group-default-level arg)))))
|
||||
|
||||
(defun gnus-group-get-new-news-this-group (&optional n dont-scan)
|
||||
"Check for newly arrived news in the current group (and the N-1 next groups).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue