Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* new func: gnus-group-list-more-groups
@ 2008-01-29 18:30 Walt Buehring
  2008-02-14 19:49 ` Reiner Steib
  0 siblings, 1 reply; 2+ messages in thread
From: Walt Buehring @ 2008-01-29 18:30 UTC (permalink / raw)
  To: info-gnus-english

Been making more use of group levels lately and thought it would be
awfully nice if "L" (normally gnus-group-list-all-groups) would
instead progressively increase the listing level in steps.  That is,
determine the currently listed level and bump it to display more.

Below is a poor implementation of the idea (with level bumps hardcoded
in a case stmt).  As a side benefit it also raises the activation
level once gnus-activate-level is exceeded - which is nice.(?)

-W


(defun gnus-group-list-more-groups (&optional arg)
  "Progressively list additional groups at increasing levels.
With arg, only list groups with level ARG or lower."
  (interactive "P")
  (if arg
      (gnus-group-list-groups arg t)
    ;; determine the max level group currently displayed
    (let ((maxlevel 0)
	  glevel newlevel)
      (save-excursion
	(goto-char (point-min))
	(while (not (eobp))
	  (setq glevel (or (get-text-property (point) 'gnus-level) 0)
		maxlevel (max glevel maxlevel))
	  (forward-line 1)))
      ;; choose next level in progression
      (setq newlevel (case maxlevel
		       (2 3)
		       (3 5)
		       (5 6)
		       (t 9)))
      ;; activate at new level if appropriate
      (when (> newlevel gnus-activate-level)
	(let ((gnus-activate-level newlevel)
	      (gnus-activate-foreign-newsgroups newlevel))
		(gnus-group-get-new-news newlevel)))
      (gnus-group-list-groups newlevel t))))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: new func: gnus-group-list-more-groups
  2008-01-29 18:30 new func: gnus-group-list-more-groups Walt Buehring
@ 2008-02-14 19:49 ` Reiner Steib
  0 siblings, 0 replies; 2+ messages in thread
From: Reiner Steib @ 2008-02-14 19:49 UTC (permalink / raw)
  To: Walt Buehring, ding; +Cc: info-gnus-english

[ Shifting this to the development list: `ding@gnus.org'.
  Mail-Followup-To set. ]

On Tue, Jan 29 2008, Walt Buehring wrote:

> Been making more use of group levels lately and thought it would be
> awfully nice if "L" (normally gnus-group-list-all-groups) would
> instead progressively increase the listing level in steps.  

It should be a separate command, I think.

> That is, determine the currently listed level and bump it to display
> more.
>
> Below is a poor implementation of the idea (with level bumps hardcoded
> in a case stmt).  

I need to clarify if your disclaimer (for changes to Emacs) is
sufficient to install these changes.

> As a side benefit it also raises the activation level once
> gnus-activate-level is exceeded - which is nice.(?)
>
> -W
>
> (defun gnus-group-list-more-groups (&optional arg)
>   "Progressively list additional groups at increasing levels.
> With arg, only list groups with level ARG or lower."
>   (interactive "P")
>   (if arg
>       (gnus-group-list-groups arg t)

I don't think it's useful to duplicate `gnus-group-list-groups' here.

>     ;; determine the max level group currently displayed
>     (let ((maxlevel 0)
> 	  glevel newlevel)
>       (save-excursion
> 	(goto-char (point-min))
> 	(while (not (eobp))
> 	  (setq glevel (or (get-text-property (point) 'gnus-level) 0)
> 		maxlevel (max glevel maxlevel))
> 	  (forward-line 1)))
>       ;; choose next level in progression
>       (setq newlevel (case maxlevel
> 		       (2 3)
> 		       (3 5)
> 		       (5 6)
> 		       (t 9)))

I'd simply use `(1+ maxlevel)' unless maxlevel is >= `gnus-level-killed'.

>       ;; activate at new level if appropriate
>       (when (> newlevel gnus-activate-level)
> 	(let ((gnus-activate-level newlevel)
> 	      (gnus-activate-foreign-newsgroups newlevel))
> 		(gnus-group-get-new-news newlevel)))

Instead, the prefix arg could be `activate', i.e. only call
`gnus-activate-foreign-newsgroups' when `activate' is non-nil.

>       (gnus-group-list-groups newlevel t))))

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-14 19:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-29 18:30 new func: gnus-group-list-more-groups Walt Buehring
2008-02-14 19:49 ` Reiner Steib

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).